Commit d08c9472 authored by Mattias Engdegård's avatar Mattias Engdegård

Make compilation-mode regexp matching case-sensitive (bug#40119)

The number of regexps is large, they are written independently of one
another, and they frequently intersect.  Using case-sensitive matching
improves separation and performance, and is probably what everyone
have being assuming was used by compilation-mode all along.

* lisp/progmodes/compile.el (compilation-error-case-fold-search): New.
(compilation-parse-errors): Bind case-fold-search to
compilation-error-case-fold-search during matching.
* etc/NEWS: Announce.
parent 1060a640
Pipeline #5089 failed with stage
in 53 minutes and 13 seconds
......@@ -196,6 +196,12 @@ key binding
*** New user option 'gravatar-service' for host to query for gravatars.
Defaults to Libravatar, with Unicornify and Gravatar as options.
** Compilation mode
*** Regexp matching of messages is now case-sensitive by default.
The user option 'compilation-error-case-fold-search' can be set
for case-insensitive matching of messages.
* New Modes and Packages in Emacs 28.1
......
......@@ -646,6 +646,14 @@ matched file names, and weeding out false positives."
:link `(file-link :tag "example file"
,(expand-file-name "compilation.txt" data-directory)))
(defcustom compilation-error-case-fold-search nil
"If non-nil, use case-insensitive matching of compilation errors
by the regexps of `compilation-error-regexp-alist' and
`compilation-error-regexp-alist-alist'.
If nil, matching is case-sensitive."
:type 'boolean
:version "28.1")
;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp)
(defvar compilation-directory nil
"Directory to restore to when doing `recompile'.")
......@@ -1435,7 +1443,8 @@ to `compilation-error-regexp-alist' if RULES is nil."
(if (symbolp item)
(setq item (cdr (assq item
compilation-error-regexp-alist-alist))))
(let ((file (nth 1 item))
(let ((case-fold-search compilation-error-case-fold-search)
(file (nth 1 item))
(line (nth 2 item))
(col (nth 3 item))
(type (nth 4 item))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment