aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-02-03 13:00:15 +0200
committerEli Zaretskii2024-02-03 13:00:15 +0200
commit492e16f2ff33e7ff65ff965e9cd2ba658c9f9a45 (patch)
tree7288cb8ebfe1c08bd04b5eef8469498fe7331c69
parent37efb63a3df969fb2eeed70dfe7fcf6c187e05be (diff)
downloademacs-492e16f2ff33e7ff65ff965e9cd2ba658c9f9a45.tar.gz
emacs-492e16f2ff33e7ff65ff965e9cd2ba658c9f9a45.zip
Fix downcasing of mode-name in compile.el
* lisp/progmodes/compile.el (compilation--downcase-mode-name): New function. (compilation-start, kill-compilation): Use it instead of calling 'downcase' on 'mode-name'. (Bug#68795)
-rw-r--r--lisp/progmodes/compile.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 51c81b9d2f6..11d400e145a 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1890,6 +1890,12 @@ process from additional information inserted by Emacs."
1890(defvar-local compilation--start-time nil 1890(defvar-local compilation--start-time nil
1891 "The time when the compilation started as returned by `float-time'.") 1891 "The time when the compilation started as returned by `float-time'.")
1892 1892
1893(defun compilation--downcase-mode-name (mode)
1894 "Downcase the name of major MODE, even if MODE is not a string.
1895The function `downcase' will barf if passed the name of a `major-mode'
1896which is not a string, but instead a symbol or a list."
1897 (downcase (format-mode-line mode)))
1898
1893;;;###autoload 1899;;;###autoload
1894(defun compilation-start (command &optional mode name-function highlight-regexp 1900(defun compilation-start (command &optional mode name-function highlight-regexp
1895 continue) 1901 continue)
@@ -2081,11 +2087,12 @@ Returns the compilation buffer created."
2081 (get-buffer-process 2087 (get-buffer-process
2082 (with-no-warnings 2088 (with-no-warnings
2083 (comint-exec 2089 (comint-exec
2084 outbuf (downcase mode-name) 2090 outbuf (compilation--downcase-mode-name mode-name)
2085 shell-file-name 2091 shell-file-name
2086 nil `(,shell-command-switch ,command))))) 2092 nil `(,shell-command-switch ,command)))))
2087 (start-file-process-shell-command (downcase mode-name) 2093 (start-file-process-shell-command
2088 outbuf command)))) 2094 (compilation--downcase-mode-name mode-name)
2095 outbuf command))))
2089 ;; Make the buffer's mode line show process state. 2096 ;; Make the buffer's mode line show process state.
2090 (setq mode-line-process 2097 (setq mode-line-process
2091 '((:propertize ":%s" face compilation-mode-line-run) 2098 '((:propertize ":%s" face compilation-mode-line-run)
@@ -2790,7 +2797,8 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)."
2790 (let ((buffer (compilation-find-buffer))) 2797 (let ((buffer (compilation-find-buffer)))
2791 (if (get-buffer-process buffer) 2798 (if (get-buffer-process buffer)
2792 (interrupt-process (get-buffer-process buffer)) 2799 (interrupt-process (get-buffer-process buffer))
2793 (error "The %s process is not running" (downcase mode-name))))) 2800 (error "The %s process is not running"
2801 (compilation--downcase-mode-name mode-name)))))
2794 2802
2795(defalias 'compile-mouse-goto-error 'compile-goto-error) 2803(defalias 'compile-mouse-goto-error 'compile-goto-error)
2796 2804