diff options
| author | Mattias EngdegÄrd | 2020-03-18 16:01:02 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2020-03-25 21:41:49 +0100 |
| commit | d08c9472e821615da06f92756e49c271be8da7f1 (patch) | |
| tree | cbfb74ec17bf4a25f5d57a85d780ac0d46e049c5 | |
| parent | 1060a6401b8ee9aaa4b2056025402e7fa1ad1643 (diff) | |
| download | emacs-d08c9472e821615da06f92756e49c271be8da7f1.tar.gz emacs-d08c9472e821615da06f92756e49c271be8da7f1.zip | |
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.
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 11 |
2 files changed, 16 insertions, 1 deletions
| @@ -196,6 +196,12 @@ key binding | |||
| 196 | *** New user option 'gravatar-service' for host to query for gravatars. | 196 | *** New user option 'gravatar-service' for host to query for gravatars. |
| 197 | Defaults to Libravatar, with Unicornify and Gravatar as options. | 197 | Defaults to Libravatar, with Unicornify and Gravatar as options. |
| 198 | 198 | ||
| 199 | ** Compilation mode | ||
| 200 | |||
| 201 | *** Regexp matching of messages is now case-sensitive by default. | ||
| 202 | The user option 'compilation-error-case-fold-search' can be set | ||
| 203 | for case-insensitive matching of messages. | ||
| 204 | |||
| 199 | 205 | ||
| 200 | * New Modes and Packages in Emacs 28.1 | 206 | * New Modes and Packages in Emacs 28.1 |
| 201 | 207 | ||
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 455f181f501..f4532b7edb7 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -646,6 +646,14 @@ matched file names, and weeding out false positives." | |||
| 646 | :link `(file-link :tag "example file" | 646 | :link `(file-link :tag "example file" |
| 647 | ,(expand-file-name "compilation.txt" data-directory))) | 647 | ,(expand-file-name "compilation.txt" data-directory))) |
| 648 | 648 | ||
| 649 | (defcustom compilation-error-case-fold-search nil | ||
| 650 | "If non-nil, use case-insensitive matching of compilation errors | ||
| 651 | by the regexps of `compilation-error-regexp-alist' and | ||
| 652 | `compilation-error-regexp-alist-alist'. | ||
| 653 | If nil, matching is case-sensitive." | ||
| 654 | :type 'boolean | ||
| 655 | :version "28.1") | ||
| 656 | |||
| 649 | ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) | 657 | ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) |
| 650 | (defvar compilation-directory nil | 658 | (defvar compilation-directory nil |
| 651 | "Directory to restore to when doing `recompile'.") | 659 | "Directory to restore to when doing `recompile'.") |
| @@ -1435,7 +1443,8 @@ to `compilation-error-regexp-alist' if RULES is nil." | |||
| 1435 | (if (symbolp item) | 1443 | (if (symbolp item) |
| 1436 | (setq item (cdr (assq item | 1444 | (setq item (cdr (assq item |
| 1437 | compilation-error-regexp-alist-alist)))) | 1445 | compilation-error-regexp-alist-alist)))) |
| 1438 | (let ((file (nth 1 item)) | 1446 | (let ((case-fold-search compilation-error-case-fold-search) |
| 1447 | (file (nth 1 item)) | ||
| 1439 | (line (nth 2 item)) | 1448 | (line (nth 2 item)) |
| 1440 | (col (nth 3 item)) | 1449 | (col (nth 3 item)) |
| 1441 | (type (nth 4 item)) | 1450 | (type (nth 4 item)) |