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: Regexp linting scan Date: Wed, 4 Dec 2019 16:57:10 -0800 Organization: UCLA Computer Science Department Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9DCE06A4BE22909E9A044817" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="77035"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 Cc: Emacs developers To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= , Richard Copley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 05 01:58:11 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1icfT9-000Jsk-CT for ged-emacs-devel@m.gmane.org; Thu, 05 Dec 2019 01:58:11 +0100 Original-Received: from localhost ([::1]:48542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icfT7-0008Uz-Mf for ged-emacs-devel@m.gmane.org; Wed, 04 Dec 2019 19:58:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44178) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icfSJ-0008TK-PD for emacs-devel@gnu.org; Wed, 04 Dec 2019 19:57:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icfSI-0000qi-7r for emacs-devel@gnu.org; Wed, 04 Dec 2019 19:57:19 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58604) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1icfSH-0000hN-SF for emacs-devel@gnu.org; Wed, 04 Dec 2019 19:57:18 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 82E61160231; Wed, 4 Dec 2019 16:57:12 -0800 (PST) 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 TfGIfYqbjX2a; Wed, 4 Dec 2019 16:57:11 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6846A1600AE; Wed, 4 Dec 2019 16:57:11 -0800 (PST) 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 SAM7EMWVojtK; Wed, 4 Dec 2019 16:57:11 -0800 (PST) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 49FCB16023B; Wed, 4 Dec 2019 16:57:11 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:243133 Archived-At: This is a multi-part message in MIME format. --------------9DCE06A4BE22909E9A044817 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the scan; I installed the attached. --------------9DCE06A4BE22909E9A044817 Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-regex-repetition-of-repetitions.patch" Content-Disposition: attachment; filename="0001-Fix-regex-repetition-of-repetitions.patch" Content-Transfer-Encoding: quoted-printable >From ab612302b4917fec5846922f3d8ffafa673c0d36 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 4 Dec 2019 16:53:39 -0800 Subject: [PATCH] Fix regex repetition of repetitions 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-12/msg00066.html * lisp/gnus/gnus-util.el (gnus-emacs-version): * lisp/mail/rfc2368.el (rfc2368-mailto-regexp): * lisp/net/tramp-sh.el (tramp-sh-inotifywait-process-filter): * lisp/obsolete/terminal.el (te-parse-program-and-args): * lisp/org/org-table.el (org-table-wrap-region): * lisp/progmodes/verilog-mode.el (verilog-inject-inst): Avoid repetition-of-repetition in regexp. --- lisp/gnus/gnus-util.el | 2 +- lisp/mail/rfc2368.el | 2 +- lisp/net/tramp-sh.el | 2 +- lisp/obsolete/terminal.el | 2 +- lisp/org/org-table.el | 2 +- lisp/progmodes/verilog-mode.el | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 8e390473aa..42021d3073 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1574,7 +1574,7 @@ gnus-emacs-version (cond ((not (memq 'emacs lst)) nil) - ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version) + ((string-match "^[.0-9]*\\.[0-9]+$" emacs-version) (concat "Emacs/" emacs-version (if system-v (concat " (" system-v ")") diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el index 05f27e4d99..b658ffab58 100644 --- a/lisp/mail/rfc2368.el +++ b/lisp/mail/rfc2368.el @@ -61,7 +61,7 @@ ;; only an approximation? ;; see rfc 1738 (defconst rfc2368-mailto-regexp - "^\\(mailto:\\)\\([^?]+\\)*\\(\\?\\(.*\\)\\)*" + "^\\(mailto:\\)\\([^?]+\\)?\\(\\?\\(.*\\)\\)*" "Regular expression to match and aid in parsing a mailto url.") =20 ;; describes 'mailto:' diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 59a93a839e..2aef6ea10f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3799,7 +3799,7 @@ tramp-sh-inotifywait-process-filter (unless (string-match (eval-when-compile (concat "^[^[:blank:]]+" - "[[:blank:]]+\\([^[:blank:]]+\\)+" + "[[:blank:]]+\\([^[:blank:]]+\\)" "\\([[:blank:]]+\\([^\n\r]+\\)\\)?")) line) (tramp-error proc 'file-notify-error "%s" line)) diff --git a/lisp/obsolete/terminal.el b/lisp/obsolete/terminal.el index ce6f2309fd..c12d225bef 100644 --- a/lisp/obsolete/terminal.el +++ b/lisp/obsolete/terminal.el @@ -1166,7 +1166,7 @@ te-parse-program-and-args (let ((l ()) (p 0)) (while p (setq l (cons (if (string-match - "\\([-a-zA-Z0-9+=3D_.@/:]+\\)\\([ \t]+\\)*" + "\\([-a-zA-Z0-9+=3D_.@/:]+\\)[ \t]*" s p) (prog1 (substring s p (match-end 1)) (setq p (match-end 0)) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index a21587acbe..5f42db5068 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -4642,7 +4642,7 @@ org-table-wrap-region (skip-chars-backward " ") (insert " " (org-trim s)) (org-table-align))) - ((looking-at "\\([^|]+\\)+|") ; Split field. + ((looking-at "\\([^|]+\\)|") ; Split field. (let ((s (match-string 1))) (replace-match " |") (goto-char (match-beginning 0)) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode= .el index 0afbdc3dd1..6ec8d995c1 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -10973,7 +10973,7 @@ verilog-inject-inst (t ;; Delete identical interconnect (let ((case-fold-search nil)) ; So we don't convert up= per-to-lower, etc - (while (verilog-re-search-forward-quick "\\.\\s *\\([a-zA-Z0-9`_$]+= \\)*\\s *(\\s *\\1\\s *)\\s *" end-pt t) + (while (verilog-re-search-forward-quick "\\.\\s *\\([a-zA-Z0-9`_$]+= \\)?\\s *(\\s *\\1\\s *)\\s *" end-pt t) (delete-region (match-beginning 0) (match-end 0)) (setq end-pt (- end-pt (- (match-end 0) (match-begi= nning 0)))) ; Keep it correct (while (or (looking-at "[ \t\n\f,]+") --=20 2.23.0 --------------9DCE06A4BE22909E9A044817--