diff options
| author | Paul Eggert | 2019-08-04 11:39:03 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-04 11:39:54 -0700 |
| commit | a5b796a8798a809044d847568e6472cc5eca077e (patch) | |
| tree | 951f7dbc59d5ef840185d3f70560e6e3fb422e04 | |
| parent | 7748ef218cd7a9cffa984d165abe261cd60fae1a (diff) | |
| download | emacs-a5b796a8798a809044d847568e6472cc5eca077e.tar.gz emacs-a5b796a8798a809044d847568e6472cc5eca077e.zip | |
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.
| -rw-r--r-- | lisp/calendar/diary-lib.el | 2 | ||||
| -rw-r--r-- | lisp/cedet/inversion.el | 6 | ||||
| -rw-r--r-- | lisp/org/ob-haskell.el | 2 | ||||
| -rw-r--r-- | lisp/org/org-capture.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 4 | ||||
| -rw-r--r-- | 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 a0e90c439bf..06f1161b44a 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -109,7 +109,7 @@ are: `string', `symbol', `int', `tnil', `stringtnil.'" | |||
| 109 | :tag "A string, t, or nil")))) | 109 | :tag "A string, t, or nil")))) |
| 110 | :group 'diary) | 110 | :group 'diary) |
| 111 | 111 | ||
| 112 | (defcustom diary-glob-file-regexp-prefix "^\\#" | 112 | (defcustom diary-glob-file-regexp-prefix "^#" |
| 113 | "Regular expression pre-pended to `diary-face-attrs' for file-wide specifiers." | 113 | "Regular expression pre-pended to `diary-face-attrs' for file-wide specifiers." |
| 114 | :type 'regexp | 114 | :type 'regexp |
| 115 | :group 'diary) | 115 | :group 'diary) |
diff --git a/lisp/cedet/inversion.el b/lisp/cedet/inversion.el index c62a57ee48c..3bed9d70534 100644 --- a/lisp/cedet/inversion.el +++ b/lisp/cedet/inversion.el | |||
| @@ -79,9 +79,9 @@ | |||
| 79 | 79 | ||
| 80 | (defconst inversion-decoders | 80 | (defconst inversion-decoders |
| 81 | '( | 81 | '( |
| 82 | (alpha "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)?\\s-*\\.?alpha\\([0-9]+\\)?$" 4) | 82 | (alpha "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?alpha\\([0-9]+\\)?$" 4) |
| 83 | (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)?\\s-*\\.?beta\\([0-9]+\\)?$" 4) | 83 | (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?beta\\([0-9]+\\)?$" 4) |
| 84 | (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)?\\s-*\\.?(beta\\([0-9]+\\)?)$" 4) | 84 | (beta "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.?\\([0-9]*\\)\\s-*\\.?(beta\\([0-9]+\\)?)$" 4) |
| 85 | (beta "^[^/]+/\\w+--\\w+--\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)--patch-\\([0-9]+\\)" 4) | 85 | (beta "^[^/]+/\\w+--\\w+--\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)--patch-\\([0-9]+\\)" 4) |
| 86 | (beta "^\\w+: v\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)-\\([0-9]+\\)-\\(.*\\)" 5) | 86 | (beta "^\\w+: v\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)-\\([0-9]+\\)-\\(.*\\)" 5) |
| 87 | (prerelease "^\\([0-9]+\\)\\.\\([0-9]+\\)\\s-*\\.?pre\\([0-9]+\\)?$" 3) | 87 | (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 3c0a102fb2e..50d1b57969c 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." | |||
| 160 | (interactive "P") | 160 | (interactive "P") |
| 161 | (let* ((contents (buffer-string)) | 161 | (let* ((contents (buffer-string)) |
| 162 | (haskell-regexp | 162 | (haskell-regexp |
| 163 | (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)?[\r\n]" | 163 | (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)[\r\n]" |
| 164 | "\\([^\000]*?\\)[\r\n][ \t]*#\\+end_src.*")) | 164 | "\\([^\000]*?\\)[\r\n][ \t]*#\\+end_src.*")) |
| 165 | (base-name (file-name-sans-extension (buffer-file-name))) | 165 | (base-name (file-name-sans-extension (buffer-file-name))) |
| 166 | (tmp-file (org-babel-temp-file "haskell-")) | 166 | (tmp-file (org-babel-temp-file "haskell-")) |
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index cbcf6c72f9f..829872c3826 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." | |||
| 1683 | (org-capture-expand-embedded-elisp 'mark) | 1683 | (org-capture-expand-embedded-elisp 'mark) |
| 1684 | 1684 | ||
| 1685 | ;; Expand non-interactive templates. | 1685 | ;; Expand non-interactive templates. |
| 1686 | (let ((regexp "%\\(:[-a-za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)")) | 1686 | (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)")) |
| 1687 | (save-excursion | 1687 | (save-excursion |
| 1688 | (while (re-search-forward regexp nil t) | 1688 | (while (re-search-forward regexp nil t) |
| 1689 | ;; `org-capture-escaped-%' may modify buffer and cripple | 1689 | ;; `org-capture-escaped-%' may modify buffer and cripple |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 60a9de5ddb5..76f5de212f2 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." | |||
| 1397 | 1397 | ||
| 1398 | ;; Move to end of logical line (as it will be after the change, or as it | 1398 | ;; Move to end of logical line (as it will be after the change, or as it |
| 1399 | ;; was before unescaping a NL.) | 1399 | ;; was before unescaping a NL.) |
| 1400 | (re-search-forward "\\(\\\\\\(.\\|\n\\|\r\\)\\|[^\\\n\r]\\)*" nil t) | 1400 | (re-search-forward "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r]\\)*" nil t) |
| 1401 | ;; We're at an EOLL or point-max. | 1401 | ;; We're at an EOLL or point-max. |
| 1402 | (if (equal (c-get-char-property (point) 'syntax-table) '(15)) | 1402 | (if (equal (c-get-char-property (point) 'syntax-table) '(15)) |
| 1403 | (if (memq (char-after) '(?\n ?\r)) | 1403 | (if (memq (char-after) '(?\n ?\r)) |
| @@ -1505,7 +1505,7 @@ Note that the style variables are always made local to the buffer." | |||
| 1505 | (progn | 1505 | (progn |
| 1506 | (goto-char (min (1+ end) ; 1+, in case a NL has become escaped. | 1506 | (goto-char (min (1+ end) ; 1+, in case a NL has become escaped. |
| 1507 | (point-max))) | 1507 | (point-max))) |
| 1508 | (re-search-forward "\\(\\\\\\(.\\|\n\\|\r\\)\\|[^\\\n\r]\\)*" | 1508 | (re-search-forward "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r]\\)*" |
| 1509 | nil t) | 1509 | nil t) |
| 1510 | (point)) | 1510 | (point)) |
| 1511 | c-new-END)) | 1511 | c-new-END)) |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 439e0dfc620..48c7dde9f51 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." | |||
| 2714 | (insert "]")))))) | 2714 | (insert "]")))))) |
| 2715 | (goto-char (point-min)) | 2715 | (goto-char (point-min)) |
| 2716 | (insert "{") | 2716 | (insert "{") |
| 2717 | (let ((re (concat "\\([[:alnum:]-_]+\\)="))) | 2717 | (let ((re (concat "\\([[:alnum:]_-]+\\)="))) |
| 2718 | (while (re-search-forward re nil t) | 2718 | (while (re-search-forward re nil t) |
| 2719 | (replace-match "\"\\1\":" nil nil) | 2719 | (replace-match "\"\\1\":" nil nil) |
| 2720 | (if (eq (char-after) ?\") (forward-sexp) (forward-char)))) | 2720 | (if (eq (char-after) ?\") (forward-sexp) (forward-char)))) |