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 run in Emacs tree Date: Sun, 4 Aug 2019 11:46:00 -0700 Organization: UCLA Computer Science Department Message-ID: References: <3B0BC169-9F40-456F-B249-0ABB43558EEA@acm.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------A0CD11F2440DEADAF7CFD51B" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="152230"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: Emacs Development To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 04 20:46:18 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 1huLWK-000dTF-LR for ged-emacs-devel@m.gmane.org; Sun, 04 Aug 2019 20:46:17 +0200 Original-Received: from localhost ([::1]:49206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huLWI-00053W-Dz for ged-emacs-devel@m.gmane.org; Sun, 04 Aug 2019 14:46:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49208) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huLW9-00053P-A3 for Emacs-devel@gnu.org; Sun, 04 Aug 2019 14:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huLW7-0000Z2-Pl for Emacs-devel@gnu.org; Sun, 04 Aug 2019 14:46:05 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35740) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1huLW7-0000YI-GT for Emacs-devel@gnu.org; Sun, 04 Aug 2019 14:46:03 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1F010162639; Sun, 4 Aug 2019 11:46:02 -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 h3vYsEWBoIhB; Sun, 4 Aug 2019 11:46:00 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C81571626A7; Sun, 4 Aug 2019 11:46:00 -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 XYWpFdSRkPXc; Sun, 4 Aug 2019 11:46:00 -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 6A945162639; Sun, 4 Aug 2019 11:46:00 -0700 (PDT) In-Reply-To: <3B0BC169-9F40-456F-B249-0ABB43558EEA@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.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:239167 Archived-At: This is a multi-part message in MIME format. --------------A0CD11F2440DEADAF7CFD51B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Thanks, I installed the attached to master. The following seem to be false alarms, though: lisp/progmodes/fortran.el:1823:36: In call to skip-chars-backward: Duplic= ated=20 character ` ' (pos 2) " \t " ...^ [and similar matches] This seem to be assuming that the customized variab= le=20 fortran-comment-indent-char has its default value. lisp/isearch.el:2191:23: In call to string-match-p: Error: Unknown syntax= code=20 =E2=80=98@=E2=80=99:=20 "\\`\\(?:\\s-\\|\\s.\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s/\\|\\s$\\|\\s'\\= |\\s<\\|\\s>\\|\\s@\\|\\s!\\|\\s|\\)+\\'" [and similar matches] This seems to be assuming that \s@ is not valid, bu= t that=20 escape is documented as valid. Is there some problem with \s@ that I don'= t know=20 about? --------------A0CD11F2440DEADAF7CFD51B Content-Type: text/x-patch; name="0001-Fix-2019-08-04-regex-lint.patch" Content-Disposition: attachment; filename="0001-Fix-2019-08-04-regex-lint.patch" Content-Transfer-Encoding: quoted-printable >From e47cb08df1d90e1d22ec3230ef465c23c3c1f8e4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 4 Aug 2019 11:39:03 -0700 Subject: [PATCH] Fix 2019-08-04 regex lint MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Problem reported by Mattias Engdeg=C3=A5rd in: https://lists.gnu.org/r/emacs-devel/2019-08/msg00085.html * lisp/calendar/diary-lib.el (diary-glob-file-regexp-prefix): Omit unnecessary =E2=80=98\=E2=80=99 before ordinary char. * lisp/cedet/inversion.el (inversion-decoders): * lisp/org/ob-haskell.el (org-babel-haskell-export-to-lhs): Omit unnecessary =E2=80=98?=E2=80=99 after nullable pattern. * lisp/org/org-capture.el (org-capture-fill-template): Match upper-case as well as lower-case letters. * lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings) (c-after-change-mark-abnormal-strings): Simplify =E2=80=98.|\r=E2=80=99 to =E2=80=98.=E2=80=99. * lisp/progmodes/gdb-mi.el (gdb-jsonify-buffer): Put =E2=80=98-=E2=80=99 at end of bracket expression. --- lisp/calendar/diary-lib.el | 2 +- lisp/cedet/inversion.el | 6 +++--- lisp/org/ob-haskell.el | 2 +- lisp/org/org-capture.el | 2 +- lisp/progmodes/cc-mode.el | 4 ++-- lisp/progmodes/gdb-mi.el | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index a0e90c439b..06f1161b44 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -109,7 +109,7 @@ diary-face-attrs :tag "A string, t, or nil")))) :group 'diary) =20 -(defcustom diary-glob-file-regexp-prefix "^\\#" +(defcustom diary-glob-file-regexp-prefix "^#" "Regular expression pre-pended to `diary-face-attrs' for file-wide spe= cifiers." :type 'regexp :group 'diary) diff --git a/lisp/cedet/inversion.el b/lisp/cedet/inversion.el index c62a57ee48..3bed9d7053 100644 --- a/lisp/cedet/inversion.el +++ b/lisp/cedet/inversion.el @@ -79,9 +79,9 @@ inversion-incompatible-version =20 (defconst inversion-decoders '( - (alpha "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)?\\s-*\\.?alpha= \\([0-9]+\\)?$" 4) - (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)?\\s-*\\.?beta\= \([0-9]+\\)?$" 4) - (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)?\\s-*\\.?(beta= \\([0-9]+\\)?)$" 4) + (alpha "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?alpha\= \([0-9]+\\)?$" 4) + (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?beta\\= ([0-9]+\\)?$" 4) + (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?(beta\= \([0-9]+\\)?)$" 4) (beta "^[^/]+/\\w+--\\w+--\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\= )--patch-\\([0-9]+\\)" 4) (beta "^\\w+: v\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)-\\([0-9]+\= \)-\\(.*\\)" 5) (prerelease "^\\([0-9]+\\)\\.\\([0-9]+\\)\\s-*\\.?pre\\([0-9]+\\)?$"= 3) diff --git a/lisp/org/ob-haskell.el b/lisp/org/ob-haskell.el index 3c0a102fb2..50d1b57969 100644 --- a/lisp/org/ob-haskell.el +++ b/lisp/org/ob-haskell.el @@ -160,7 +160,7 @@ org-babel-haskell-export-to-lhs (interactive "P") (let* ((contents (buffer-string)) (haskell-regexp - (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)?[\r\n= ]" + (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)[\r\n]= " "\\([^\000]*?\\)[\r\n][ \t]*#\\+end_src.*")) (base-name (file-name-sans-extension (buffer-file-name))) (tmp-file (org-babel-temp-file "haskell-")) diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index cbcf6c72f9..829872c382 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el @@ -1683,7 +1683,7 @@ org-capture-fill-template (org-capture-expand-embedded-elisp 'mark) =20 ;; Expand non-interactive templates. - (let ((regexp "%\\(:[-a-za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuU= x]\\)")) + (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuU= x]\\)")) (save-excursion (while (re-search-forward regexp nil t) ;; `org-capture-escaped-%' may modify buffer and cripple diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 60a9de5ddb..76f5de212f 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1397,7 +1397,7 @@ c-before-change-check-unbalanced-strings =20 ;; Move to end of logical line (as it will be after the change, or= as it ;; was before unescaping a NL.) - (re-search-forward "\\(\\\\\\(.\\|\n\\|\r\\)\\|[^\\\n\r]\\)*" nil = t) + (re-search-forward "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r]\\)*" nil t) ;; We're at an EOLL or point-max. (if (equal (c-get-char-property (point) 'syntax-table) '(15)) (if (memq (char-after) '(?\n ?\r)) @@ -1505,7 +1505,7 @@ c-after-change-mark-abnormal-strings (progn (goto-char (min (1+ end) ; 1+, in case a NL has become escaped. (point-max))) - (re-search-forward "\\(\\\\\\(.\\|\n\\|\r\\)\\|[^\\\n\r]\\)*" + (re-search-forward "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r]\\)*" nil t) (point)) c-new-END)) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 439e0dfc62..48c7dde9f5 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2714,7 +2714,7 @@ gdb-jsonify-buffer (insert "]")))))) (goto-char (point-min)) (insert "{") - (let ((re (concat "\\([[:alnum:]-_]+\\)=3D"))) + (let ((re (concat "\\([[:alnum:]_-]+\\)=3D"))) (while (re-search-forward re nil t) (replace-match "\"\\1\":" nil nil) (if (eq (char-after) ?\") (forward-sexp) (forward-char)))) --=20 2.17.1 --------------A0CD11F2440DEADAF7CFD51B--