unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: master d08c947: Make compilation-mode regexp matching case-sensitive (bug#40119)
Date: Thu, 26 Mar 2020 17:25:02 +0100	[thread overview]
Message-ID: <289F6919-4BA3-476D-AF78-390944A79624@acm.org> (raw)
In-Reply-To: <jwv8sjn4wmc.fsf-monnier+emacs@gnu.org>

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

26 mars 2020 kl. 04.42 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> Then let's make it into a simple `defvar` rather than a defcustom and
> make the docstring clarify that it's only useful for temporary
> backward compatibility.

Right; patch attached.

> In sml-mode.el (GNU ELPA) I set `compilation-error-screen-columns`
> buffer-locally but it really should be rule-local.  In tuareg-mode (not
> in GNU ELPA, sadly), I set both `compilation-first-column` and
> `compilation-error-screen-columns` buffer-locally for the same reason.

And here I've been staring at OCaml type errors for years and never noticed...

* Gcc and Clang also count characters rather than columns. (Bytes, in fact. Perhaps we need a setting for that as well?)

* Instead of making compilation-error-regexp-alist entries even more complex and overloaded, perhaps we should use plists? For example, each entry could be

 (REGEXP :file FILE :line LINE ...)

Adding :first-column and :screen-columns would then be more a more natural way of doing it.

* There could be multiple tools with different column-number semantics sharing a single pattern.

* Rule-specific column-number semantics can be done today by specifying a function as COLUMN parameter, so perhaps no extension is necessary.


[-- Attachment #2: 0001-Turn-compilation-error-case-fold-search-into-a-defva.patch --]
[-- Type: application/octet-stream, Size: 2305 bytes --]

From fb842363736881ad045764751d86aae6d1ee4abe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Thu, 26 Mar 2020 10:58:30 +0100
Subject: [PATCH] Turn compilation-error-case-fold-search into a defvar

See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00653.html

* lisp/progmodes/compile.el (compilation-error-case-fold-search):
Turn into a defvar.
* etc/NEWS: Update.
---
 etc/NEWS                  |  6 ++++--
 lisp/progmodes/compile.el | 10 ++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 910d9fa2d2..6569158f70 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -199,8 +199,10 @@ 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.
+The variable 'compilation-error-case-fold-search' can be set for
+case-insensitive matching of messages when the old behaviour is
+required, but the recommended solution is to use a correctly matching
+regexp instead.
 
 \f
 * New Modes and Packages in Emacs 28.1
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f4532b7edb..e5878b28f9 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -646,13 +646,15 @@ compilation-error-regexp-alist
   :link `(file-link :tag "example file"
 		    ,(expand-file-name "compilation.txt" data-directory)))
 
-(defcustom compilation-error-case-fold-search nil
+(defvar 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")
+If nil, matching is case-sensitive.
+
+This variable should only be set for backward compatibility as a temporary
+measure.  The proper solution is to use a regexp that matches the
+messages without case-folding.")
 
 ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp)
 (defvar compilation-directory nil
-- 
2.21.1 (Apple Git-122.3)


[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




      reply	other threads:[~2020-03-26 16:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200325204155.5002.75177@vcs0.savannah.gnu.org>
     [not found] ` <20200325204157.3643820E43@vcs0.savannah.gnu.org>
2020-03-25 20:54   ` master d08c947: Make compilation-mode regexp matching case-sensitive (bug#40119) Stefan Monnier
2020-03-25 22:29     ` Mattias Engdegård
2020-03-26  3:42       ` Stefan Monnier
2020-03-26 16:25         ` Mattias Engdegård [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=289F6919-4BA3-476D-AF78-390944A79624@acm.org \
    --to=mattiase@acm.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).