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>, emacs-devel@gnu.org
Subject: Re: Scan of regexps in emacs
Date: Sun, 10 Mar 2019 19:45:40 -0700	[thread overview]
Message-ID: <e2c22e99-6db7-938f-6d1d-b6624ce6fc94@cs.ucla.edu> (raw)
In-Reply-To: <9f6f677b29f514c5f0bb1bb805e89d62eb146999.camel@acm.org>

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

Mattias Engdegård wrote:
> Here is a new regexp error scan of the Emacs source tree.

Thanks. Alan fixed some of them and I installed the attached, which I hope fixes 
the rest.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-More-regexp-corrections-and-tweaks.patch --]
[-- Type: text/x-patch; name="0001-More-regexp-corrections-and-tweaks.patch", Size: 5480 bytes --]

From 7c6cdb122008ff902a3edec021b97027aa416c24 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 10 Mar 2019 19:42:11 -0700
Subject: [PATCH] More regexp corrections and tweaks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00247.html
* lisp/align.el (align-rules-list):
* lisp/comint.el (comint-output-filter):
* lisp/language/china-util.el (encode-hz-region):
* lisp/progmodes/cperl-mode.el (cperl-indent-exp):
* lisp/progmodes/idlwave.el (idlwave-is-pointer-dereference):
* lisp/progmodes/scheme.el (dsssl-font-lock-keywords):
* lisp/textmodes/texinfmt.el (texinfo-accent-commands):
* test/src/regex-emacs-tests.el (regex-tests-re-even-escapes):
Fix some regular-expression typos.
---
 lisp/align.el                 | 2 +-
 lisp/comint.el                | 2 +-
 lisp/language/china-util.el   | 2 +-
 lisp/progmodes/cperl-mode.el  | 2 +-
 lisp/progmodes/idlwave.el     | 2 +-
 lisp/progmodes/scheme.el      | 2 +-
 lisp/textmodes/texinfmt.el    | 8 +-------
 test/src/regex-emacs-tests.el | 2 +-
 8 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/lisp/align.el b/lisp/align.el
index 43918811b9..594d15eee1 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -399,7 +399,7 @@ align-rules-list
 		   (lambda (end reverse)
 		     (funcall (if reverse 're-search-backward
 				're-search-forward)
-			      (concat "[^ \t\n\\\\]"
+			      (concat "[^ \t\n\\]"
 				      (regexp-quote comment-start)
 				      "\\(.+\\)$") end t))))
      (modes    . align-open-comment-modes))
diff --git a/lisp/comint.el b/lisp/comint.el
index a5fca7ea2a..e5012be982 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2081,7 +2081,7 @@ comint-output-filter
                        (prompt-re (concat "\\`" (regexp-quote prompt))))
                   (while (string-match prompt-re string)
                     (setq string (substring string (match-end 0)))))))
-            (while (string-match (concat "\\(^" comint-prompt-regexp
+            (while (string-match (concat "\\(" comint-prompt-regexp
                                          "\\)\\1+")
                                  string)
               (setq string (replace-match "\\1" nil nil string)))
diff --git a/lisp/language/china-util.el b/lisp/language/china-util.el
index 70710bac18..1638565133 100644
--- a/lisp/language/china-util.el
+++ b/lisp/language/china-util.el
@@ -168,7 +168,7 @@ encode-hz-region
 	      ;; ESC ESC -> ESC
 	      (delete-char 1)
 	    (forward-char -1)
-	    (if (looking-at iso2022-gb-designation)
+	    (if (looking-at "\e\\$A")
 		(progn
 		  (delete-region (match-beginning 0) (match-end 0))
 		  (insert hz-gb-designation)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index a9402e17a9..970c5669c6 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -4924,7 +4924,7 @@ cperl-indent-exp
 			      (if (looking-at "\\(state\\|my\\|local\\|our\\)\\>")
 				  (forward-sexp -1))))
 			(if (looking-at
-			     (concat "\\(\\elsif\\|if\\|unless\\|while\\|until"
+			     (concat "\\(elsif\\|if\\|unless\\|while\\|until"
 				     "\\|for\\(each\\)?\\>\\(\\("
 				     cperl-maybe-white-and-comment-rex
 				     "\\(state\\|my\\|local\\|our\\)\\)?"
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 25bc788ffc..5ff22571b9 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -3690,7 +3690,7 @@ idlwave-is-pointer-dereference
    (save-excursion
      (forward-char)
      (re-search-backward (concat "\\(" idlwave-idl-keywords
-                                 "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t))))
+                                 "\\|[-[(*+/=,^><]\\)\\s-*\\*") limit t))))
 
 
 ;; Statement templates
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index 62f521ee94..507a4c7085 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -433,7 +433,7 @@ dsssl-font-lock-keywords
               ;; (make-regexp '("case" "cond" "else" "if" "lambda"
               ;; "let" "let*" "letrec" "and" "or" "map" "with-mode"))
               "and\\|c\\(ase\\|ond\\)\\|else\\|if\\|"
-              "l\\(ambda\\|et\\(\\|*\\|rec\\)\\)\\|map\\|or\\|with-mode"
+              "l\\(ambda\\|et\\(\\|\\*\\|rec\\)\\)\\|map\\|or\\|with-mode"
               "\\)\\>")
       1)
      ;; DSSSL syntax
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index 61c31a511c..4bfecb48b6 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -552,13 +552,7 @@ texinfo-no-refill-regexp
 
 (defvar texinfo-accent-commands
   (concat
-   "@^\\|"
-   "@`\\|"
-   "@'\\|"
-   "@\"\\|"
-   "@,\\|"
-   "@=\\|"
-   "@~\\|"
+   "@[\"',=^`~]\\|"
    "@OE{\\|"
    "@oe{\\|"
    "@AA{\\|"
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el
index 9a40316573..0ae50c94d4 100644
--- a/test/src/regex-emacs-tests.el
+++ b/test/src/regex-emacs-tests.el
@@ -278,7 +278,7 @@ regex-tests-match
 
 
 (defconst regex-tests-re-even-escapes
-  "\\(?:^\\|[^\\\\]\\)\\(?:\\\\\\\\\\)*"
+  "\\(?:^\\|[^\\]\\)\\(?:\\\\\\\\\\)*"
   "Regex that matches an even number of \\ characters")
 
 (defconst regex-tests-re-odd-escapes
-- 
2.17.1


  parent reply	other threads:[~2019-03-11  2:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-09 13:26 Scan of regexps in emacs Mattias Engdegård
2019-03-09 14:56 ` Alan Mackenzie
2019-03-09 15:09   ` Alan Mackenzie
2019-03-10 11:19     ` Mattias Engdegård
2019-03-09 17:06   ` Paul Eggert
2019-03-09 17:46     ` Alan Mackenzie
2019-03-11  2:45 ` Paul Eggert [this message]
2019-03-11  2:56   ` Clément Pit-Claudel
2019-03-11  3:37     ` Paul Eggert
2019-03-11  8:39       ` Mattias Engdegård
2019-03-11  8:51   ` Mattias Engdegård
2019-03-11 22:49     ` Paul Eggert
2019-03-12 10:21       ` 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=e2c22e99-6db7-938f-6d1d-b6624ce6fc94@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.