all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Emacs Development <Emacs-devel@gnu.org>
Subject: Re: regexp linting run in Emacs tree
Date: Sun, 4 Aug 2019 15:57:29 -0700	[thread overview]
Message-ID: <2dcc229d-75ce-51df-0224-f484eec622e3@cs.ucla.edu> (raw)
In-Reply-To: <C9C6482C-A003-4BFE-B8CA-E631B7F142DF@acm.org>

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

Mattias Engdegård wrote:

> relint blindly assumes default values of global variables. What about adding a `delete-dups' to make it shut up?

That would slow down and complicate the source a bit. Maybe just add the glitch 
to the delinter's exception list, if any.
> @ isn't a valid syntax code in regexps, since it only means 'inherit from standard syntax table' which is fine for specifying the syntax of a character but makes no sense when we are trying to match something.

Oh, thanks, I see the point now. I installed the attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-one-more-2019-08-04-regex-lint.patch --]
[-- Type: text/x-patch; name="0001-Fix-one-more-2019-08-04-regex-lint.patch", Size: 2139 bytes --]

From 00e6e5205a3eee2f965f5649fc3f98dd37c94437 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 4 Aug 2019 15:54:17 -0700
Subject: [PATCH] Fix one more 2019-08-04 regex lint
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problem clarified by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00087.html
* lisp/isearch.el (isearch-symbol-regexp):
Remove \s@ from regexp as it cannot match.
---
 lisp/isearch.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 97c75b2978..09729034d7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2184,16 +2184,19 @@ isearch-symbol-regexp
 the beginning or the end of the string need not match a symbol boundary."
   (let ((not-word-symbol-re
 	 ;; This regexp matches all syntaxes except word and symbol syntax.
-	 ;; FIXME: Replace it with something shorter if possible (bug#14602).
-	 "\\(?:\\s-\\|\\s.\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s/\\|\\s$\\|\\s'\\|\\s<\\|\\s>\\|\\s@\\|\\s!\\|\\s|\\)+"))
+	 "\\(?:\\s-\\|\\s.\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s/\\|\\s$\\|\\s'\\|\\s<\\|\\s>\\|\\s!\\|\\s|\\)+"))
     (cond
      ((equal string "") "")
-     ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string) not-word-symbol-re)
+     ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string)
+      not-word-symbol-re)
      (t (concat
-	 (if (string-match-p (format "\\`%s" not-word-symbol-re) string) not-word-symbol-re
+	 (if (string-match-p (format "\\`%s" not-word-symbol-re) string)
+	     not-word-symbol-re
 	   "\\_<")
-	 (mapconcat 'regexp-quote (split-string string not-word-symbol-re t) not-word-symbol-re)
-	 (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re
+	 (mapconcat 'regexp-quote (split-string string not-word-symbol-re t)
+		    not-word-symbol-re)
+	 (if (string-match-p (format "%s\\'" not-word-symbol-re) string)
+	     not-word-symbol-re
 	   (unless lax "\\_>")))))))
 
 ;; Search with lax whitespace
-- 
2.17.1


  reply	other threads:[~2019-08-04 22:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-04 17:49 regexp linting run in Emacs tree Mattias Engdegård
2019-08-04 18:46 ` Paul Eggert
2019-08-04 19:07   ` Mattias Engdegård
2019-08-04 22:57     ` Paul Eggert [this message]
2019-08-05 11:33       ` Mattias Engdegård
2019-08-05 17:17         ` Paul Eggert
2019-08-05 21:18           ` Mattias Engdegård
2019-08-08 11:01       ` Mattias Engdegård

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

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

  git send-email \
    --in-reply-to=2dcc229d-75ce-51df-0224-f484eec622e3@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=Emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    /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 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.