[Top][All Lists]

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

Re: Texinfo-mode: C-c C-c TeX RET gives an error

From: Arash Esbati
Subject: Re: Texinfo-mode: C-c C-c TeX RET gives an error
Date: Wed, 15 Jun 2022 10:22:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Tassilo Horn <> writes:

> Ikumi Keita <> writes:
>> Thank you Tassilo for fixing this up.
> No problem at all.

Yes, thanks for the quick fix.

> But what about the seemingly invalid minor-mode-alist entry I've asked
> about in <>?

I thought we provide there compat-code to older Emacs'en after this
change in Emacs itself:

--8<---------------cut here---------------start------------->8---
>From 3479ec7332a474b3400cbc6b681c2a1f5637db94 Mon Sep 17 00:00:00 2001
From: Lars Ingebrigtsen
Date: Tue, 23 Jul 2019 19:49:48 +0200
Subject: Make "Compiling" in the mode line a clickable command

* lisp/progmodes/compile.el (compilation-goto-in-progress-buffer):
New command.
(compilation-in-progress): Don't put the in-progress mode-line
marker among the minor modes (because it's not a minor mode), and
add a command that allows you to switch to the in-progress
compilation buffer (bug#27252).
 lisp/progmodes/compile.el | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

(limited to 'lisp/progmodes/compile.el')

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 4b2fc51..f4750c0 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -107,9 +107,30 @@ and a string describing how the process finished.")
 (defvar compilation-in-progress nil
   "List of compilation processes now running.")
-(or (assq 'compilation-in-progress minor-mode-alist)
-    (setq minor-mode-alist (cons '(compilation-in-progress " Compiling")
-                                minor-mode-alist)))
+(or (assq 'compilation-in-progress mode-line-modes)
+    (add-to-list 'mode-line-modes
+                 (list 'compilation-in-progress
+                       (propertize "[Compiling] "
+                                  'help-echo "Compiling; mouse-2: Goto Buffer"
+                                   'mouse-face 'mode-line-highlight
+                                   'local-map
+                                   (make-mode-line-mouse-map
+                                    'mouse-2
+                                   #'compilation-goto-in-progress-buffer)))))
+(defun compilation-goto-in-progress-buffer ()
+  "Switch to the compilation buffer."
+  (interactive)
+  (cond
+   ((> (length compilation-in-progress) 1)
+    (switch-to-buffer (completing-read
+                       "Several compilation buffers; switch to: "
+                       (mapcar #'buffer-name compilation-in-progress)
+                       nil t)))
+   (compilation-in-progress
+    (switch-to-buffer (process-buffer (car compilation-in-progress))))
+   (t
+    (error "No ongoing compilations"))))
 (defvar compilation-error "error"
   "Stem of message to print when no matches are found.")
--8<---------------cut here---------------end--------------->8---

Best, Arash

reply via email to

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