all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#40119: [PATCH] Make compilation-mode regexp matching case-sensitive
@ 2020-03-18 15:31 Mattias Engdegård
  2020-03-18 18:05 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Mattias Engdegård @ 2020-03-18 15:31 UTC (permalink / raw)
  To: 40119

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

Since the regexps being matched in compilation-mode are numerous, independently written, and often intersect, it makes sense to use case-sensitive matching. After all, compiler messages do not change case between runs.

Doing so improves performance: case-insensitive matching is slightly slower and stricter matching allows for earlier rejection. It also reduces collisions, and it is probably what everybody assumed anyway.


[-- Attachment #2: 0001-Make-compilation-mode-regexp-matching-case-sensitive.patch --]
[-- Type: application/octet-stream, Size: 1718 bytes --]

From c48d1607d2401f1bd6e05a3f44c7f9ec8ec30b91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Wed, 18 Mar 2020 16:01:02 +0100
Subject: [PATCH] Make compilation-mode regexp matching case-sensitive

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

* lisp/progmodes/compile.el (compilation-parse-errors):
Bind case-fold-search to nil during matching.
* etc/NEWS: Announce.
---
 etc/NEWS                  | 4 ++++
 lisp/progmodes/compile.el | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 87e634f2c1..8bea9b2d5f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -174,6 +174,10 @@ key             binding
 / v             package-menu-filter-by-version
 / /             package-menu-filter-clear
 
+** Compilation mode
+
+*** Regexp matching of messages is now case-sensitive.
+
 \f
 * New Modes and Packages in Emacs 28.1
 
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 455f181f50..aefaa1707a 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1435,7 +1435,8 @@ compilation-parse-errors
     (if (symbolp item)
         (setq item (cdr (assq item
                               compilation-error-regexp-alist-alist))))
-    (let ((file (nth 1 item))
+    (let ((case-fold-search nil)
+          (file (nth 1 item))
           (line (nth 2 item))
           (col (nth 3 item))
           (type (nth 4 item))
-- 
2.21.1 (Apple Git-122.3)


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-25 20:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-18 15:31 bug#40119: [PATCH] Make compilation-mode regexp matching case-sensitive Mattias Engdegård
2020-03-18 18:05 ` Eli Zaretskii
2020-03-18 18:30   ` Mattias Engdegård
2020-03-18 19:29     ` Eli Zaretskii
2020-03-18 22:05       ` Mattias Engdegård
2020-03-25 20:41         ` Mattias Engdegård
2020-03-25 20:55       ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.