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 11:46:00 -0700 [thread overview]
Message-ID: <e5908e79-fb1e-3c8d-4aa1-f268aefda0d6@cs.ucla.edu> (raw)
In-Reply-To: <3B0BC169-9F40-456F-B249-0ABB43558EEA@acm.org>
[-- Attachment #1: Type: text/plain, Size: 733 bytes --]
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: Duplicated
character ` ' (pos 2)
" \t "
...^
[and similar matches] This seem to be assuming that the customized variable
fortran-comment-indent-char has its default value.
lisp/isearch.el:2191:23: In call to string-match-p: Error: Unknown syntax code
‘@’:
"\\`\\(?:\\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, but that
escape is documented as valid. Is there some problem with \s@ that I don't know
about?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-2019-08-04-regex-lint.patch --]
[-- Type: text/x-patch; name="0001-Fix-2019-08-04-regex-lint.patch", Size: 5713 bytes --]
From e47cb08df1d90e1d22ec3230ef465c23c3c1f8e4 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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=UTF-8
Content-Transfer-Encoding: 8bit
Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00085.html
* lisp/calendar/diary-lib.el (diary-glob-file-regexp-prefix):
Omit unnecessary ‘\’ before ordinary char.
* lisp/cedet/inversion.el (inversion-decoders):
* lisp/org/ob-haskell.el (org-babel-haskell-export-to-lhs):
Omit unnecessary ‘?’ 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 ‘.|\r’ to ‘.’.
* lisp/progmodes/gdb-mi.el (gdb-jsonify-buffer):
Put ‘-’ 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)
-(defcustom diary-glob-file-regexp-prefix "^\\#"
+(defcustom diary-glob-file-regexp-prefix "^#"
"Regular expression pre-pended to `diary-face-attrs' for file-wide specifiers."
: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
(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)
;; Expand non-interactive templates.
- (let ((regexp "%\\(:[-a-za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)"))
+ (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)"))
(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
;; 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:]-_]+\\)=")))
+ (let ((re (concat "\\([[:alnum:]_-]+\\)=")))
(while (re-search-forward re nil t)
(replace-match "\"\\1\":" nil nil)
(if (eq (char-after) ?\") (forward-sexp) (forward-char))))
--
2.17.1
next prev parent reply other threads:[~2019-08-04 18:46 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 [this message]
2019-08-04 19:07 ` Mattias Engdegård
2019-08-04 22:57 ` Paul Eggert
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=e5908e79-fb1e-3c8d-4aa1-f268aefda0d6@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.