[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a5b796a: Fix 2019-08-04 regex lint
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master a5b796a: Fix 2019-08-04 regex lint |
Date: |
Sun, 4 Aug 2019 14:39:58 -0400 (EDT) |
branch: master
commit a5b796a8798a809044d847568e6472cc5eca077e
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Fix 2019-08-04 regex lint
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 a0e90c4..06f1161 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -109,7 +109,7 @@ are: `string', `symbol', `int', `tnil', `stringtnil.'"
: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 c62a57e..3bed9d7 100644
--- a/lisp/cedet/inversion.el
+++ b/lisp/cedet/inversion.el
@@ -79,9 +79,9 @@
(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 3c0a102..50d1b57 100644
--- a/lisp/org/ob-haskell.el
+++ b/lisp/org/ob-haskell.el
@@ -160,7 +160,7 @@ constructs (header arguments, no-web syntax etc...) are
ignored."
(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 cbcf6c7..829872c 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -1683,7 +1683,7 @@ The template may still contain \"%?\" for cursor
positioning."
(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 60a9de5..76f5de2 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1397,7 +1397,7 @@ Note that the style variables are always made local to
the buffer."
;; 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 @@ Note that the style variables are always made local to
the buffer."
(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 439e0df..48c7dde 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -2714,7 +2714,7 @@ If `default-directory' is remote, full file names are
adapted accordingly."
(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))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master a5b796a: Fix 2019-08-04 regex lint,
Paul Eggert <=