[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39705: 28.0.50; mode-line-process in comint-redirect-setup

From: Juri Linkov
Subject: bug#39705: 28.0.50; mode-line-process in comint-redirect-setup
Date: Fri, 21 Feb 2020 01:45:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

Tags: patch

I customized mode-line-process to highlight its status with a color

(add-hook 'comint-mode-hook
          (lambda ()
            (require 'compile)
            (setq mode-line-process
                  '(:propertize ":%s" face compilation-mode-line-fail))))

as was recommended in 

But comint.el signals an error because it expects mode-line-process to be
in its default value.  I don't know how to make mode-line customization
to be less brittle, but at least this case can be fixed by:

diff --git a/lisp/comint.el b/lisp/comint.el
index 5c521ff0fd..ea06f8af87 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3641,7 +3641,7 @@ comint-redirect-setup
     (setq-local comint-redirect-previous-input-string "")
     (setq mode-line-process
-         (if mode-line-process
+         (if (and mode-line-process (stringp (elt mode-line-process 0)))
              (list (concat (elt mode-line-process 0) " Redirection"))
            (list ":%s Redirection")))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]