From: Mattias EngdegÄrd Date: Wed, 18 Mar 2020 15:01:02 +0000 (+0100) Subject: Make compilation-mode regexp matching case-sensitive (bug#40119) X-Git-Tag: emacs-28.0.90~7721 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d08c9472e821615da06f92756e49c271be8da7f1;p=emacs.git 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. --- diff --git a/etc/NEWS b/etc/NEWS index 1be5ad6acc0..910d9fa2d23 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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 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." :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))