From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Scan of regexps in emacs Date: Sun, 10 Mar 2019 19:45:40 -0700 Organization: UCLA Computer Science Department Message-ID: References: <9f6f677b29f514c5f0bb1bb805e89d62eb146999.camel@acm.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------066092245C3986FF15E1351B" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="29961"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 11 03:48:17 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3Az9-0007el-Ot for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2019 03:48:15 +0100 Original-Received: from localhost ([127.0.0.1]:54309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Az8-0006QS-PX for ged-emacs-devel@m.gmane.org; Sun, 10 Mar 2019 22:48:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Ay5-0006OQ-Sw for emacs-devel@gnu.org; Sun, 10 Mar 2019 22:47:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Awi-00021G-2j for emacs-devel@gnu.org; Sun, 10 Mar 2019 22:45:45 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3Awh-0001yL-Nq for emacs-devel@gnu.org; Sun, 10 Mar 2019 22:45:44 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F2A18161560; Sun, 10 Mar 2019 19:45:41 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 2yxX5Z_Z0ILc; Sun, 10 Mar 2019 19:45:40 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BC41D161561; Sun, 10 Mar 2019 19:45:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id J1vhm78YVHPH; Sun, 10 Mar 2019 19:45:40 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 947D716155A; Sun, 10 Mar 2019 19:45:40 -0700 (PDT) In-Reply-To: <9f6f677b29f514c5f0bb1bb805e89d62eb146999.camel@acm.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234048 Archived-At: This is a multi-part message in MIME format. --------------066092245C3986FF15E1351B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Mattias Engdeg=C3=A5rd 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 hop= e fixes=20 the rest. --------------066092245C3986FF15E1351B Content-Type: text/x-patch; name="0001-More-regexp-corrections-and-tweaks.patch" Content-Disposition: attachment; filename="0001-More-regexp-corrections-and-tweaks.patch" Content-Transfer-Encoding: quoted-printable >From 7c6cdb122008ff902a3edec021b97027aa416c24 Mon Sep 17 00:00:00 2001 From: Paul Eggert 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=3DUTF-8 Content-Transfer-Encoding: 8bit Problems reported by Mattias Engdeg=C3=A5rd 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 - "\\|[[(*+-/=3D,^><]\\)\\s-*\\*") limit = t)))) + "\\|[-[(*+/=3D,^><]\\)\\s-*\\*") limit = t)))) =20 =20 ;; 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-mod= e" "\\)\\>") 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 =20 (defvar texinfo-accent-commands (concat - "@^\\|" - "@`\\|" - "@'\\|" - "@\"\\|" - "@,\\|" - "@=3D\\|" - "@~\\|" + "@[\"',=3D^`~]\\|" "@OE{\\|" "@oe{\\|" "@AA{\\|" diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.e= l 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 =20 =20 (defconst regex-tests-re-even-escapes - "\\(?:^\\|[^\\\\]\\)\\(?:\\\\\\\\\\)*" + "\\(?:^\\|[^\\]\\)\\(?:\\\\\\\\\\)*" "Regex that matches an even number of \\ characters") =20 (defconst regex-tests-re-odd-escapes --=20 2.17.1 --------------066092245C3986FF15E1351B--