aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-04-19 09:00:04 -0700
committerPaul Eggert2019-04-19 09:02:25 -0700
commit9e4bb0d221bbd97f9318bacba0650d93708f0290 (patch)
tree0711cf59f86e4782cd8e0081921330097eb252de
parente6a9785f8228130c339aad5ba0a514fee6539cab (diff)
downloademacs-9e4bb0d221bbd97f9318bacba0650d93708f0290.tar.gz
emacs-9e4bb0d221bbd97f9318bacba0650d93708f0290.zip
Fix regexp branches that subsume other branches
Problems reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2019-04/msg00803.html * lisp/arc-mode.el (archive-rar-summarize): * lisp/eshell/em-hist.el (eshell-hist-word-designator): * lisp/info.el (Info-dir-remove-duplicates): * lisp/international/ja-dic-cnv.el (skkdic-convert-postfix) (skkdic-convert-prefix, skkdic-collect-okuri-nasi): * lisp/progmodes/cc-awk.el (c-awk-esc-pair-re): * lisp/xml.el (xml-att-type-re): Omit regexp branches that subsume other branches. * lisp/progmodes/cperl-mode.el (cperl-beautify-regexp-piece): $ and ^ aren’t simple-codes.
-rw-r--r--lisp/arc-mode.el2
-rw-r--r--lisp/eshell/em-hist.el2
-rw-r--r--lisp/info.el2
-rw-r--r--lisp/international/ja-dic-cnv.el10
-rw-r--r--lisp/progmodes/cc-awk.el2
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/xml.el1
7 files changed, 10 insertions, 11 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 6a58d61a547..1c88f9a1a18 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -2019,7 +2019,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2019 (re-search-forward "^\\(\s+=+\s*\\)+\n") 2019 (re-search-forward "^\\(\s+=+\s*\\)+\n")
2020 (while (looking-at (concat "^\s+[0-9.]+\s+D?-+\s+" ; Flags 2020 (while (looking-at (concat "^\s+[0-9.]+\s+D?-+\s+" ; Flags
2021 "\\([0-9-]+\\)\s+" ; Size 2021 "\\([0-9-]+\\)\s+" ; Size
2022 "\\([-0-9.%]+\\|-+\\)\s+" ; Ratio 2022 "\\([-0-9.%]+\\)\s+" ; Ratio
2023 "\\([0-9a-zA-Z]+\\)\s+" ; Mode 2023 "\\([0-9a-zA-Z]+\\)\s+" ; Mode
2024 "\\([0-9-]+\\)\s+" ; Date 2024 "\\([0-9-]+\\)\s+" ; Date
2025 "\\([0-9:]+\\)\s+" ; Time 2025 "\\([0-9:]+\\)\s+" ; Time
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 614faaa131e..adb028002be 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -153,7 +153,7 @@ element, regardless of any text on the command line. In that case,
153 :group 'eshell-hist) 153 :group 'eshell-hist)
154 154
155(defcustom eshell-hist-word-designator 155(defcustom eshell-hist-word-designator
156 "^:?\\([0-9]+\\|[$^%*]\\)?\\(\\*\\|-[0-9]*\\|[$^%*]\\)?" 156 "^:?\\([0-9]+\\|[$^%*]\\)?\\(-[0-9]*\\|[$^%*]\\)?"
157 "The regexp used to identify history word designators." 157 "The regexp used to identify history word designators."
158 :type 'regexp 158 :type 'regexp
159 :group 'eshell-hist) 159 :group 'eshell-hist)
diff --git a/lisp/info.el b/lisp/info.el
index f3b413a2f9f..2e5f433dc8b 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1531,7 +1531,7 @@ is non-nil)."
1531 (save-restriction 1531 (save-restriction
1532 (narrow-to-region start (point)) 1532 (narrow-to-region start (point))
1533 (goto-char (point-min)) 1533 (goto-char (point-min))
1534 (while (re-search-forward "^\\* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)" nil 'move) 1534 (while (re-search-forward "^\\* \\([^:\n]+:[^.\n]+.\\)" nil 'move)
1535 ;; Fold case straight away; `member-ignore-case' here wasteful. 1535 ;; Fold case straight away; `member-ignore-case' here wasteful.
1536 (let ((x (downcase (match-string 1)))) 1536 (let ((x (downcase (match-string 1))))
1537 (if (member x seen) 1537 (if (member x seen)
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 578cd63a590..e7210831891 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -124,7 +124,7 @@
124 (setq l (cdr l))))) 124 (setq l (cdr l)))))
125 125
126 ;; Search postfix entries. 126 ;; Search postfix entries.
127 (while (re-search-forward "^[#<>?]\\(\\(\\cH\\|ー\\)+\\) " nil t) 127 (while (re-search-forward "^[#<>?]\\(\\cH+\\) " nil t)
128 (let ((kana (match-string-no-properties 1)) 128 (let ((kana (match-string-no-properties 1))
129 str candidates) 129 str candidates)
130 (while (looking-at "/[#0-9 ]*\\([^/\n]*\\)/") 130 (while (looking-at "/[#0-9 ]*\\([^/\n]*\\)/")
@@ -157,7 +157,7 @@
157 (insert ";; Setting prefix entries.\n" 157 (insert ";; Setting prefix entries.\n"
158 "(skkdic-set-prefix\n")) 158 "(skkdic-set-prefix\n"))
159 (save-excursion 159 (save-excursion
160 (while (re-search-forward "^\\(\\(\\cH\\|ー\\)+\\)[<>?] " nil t) 160 (while (re-search-forward "^\\(\\cH+\\)[<>?] " nil t)
161 (let ((kana (match-string-no-properties 1)) 161 (let ((kana (match-string-no-properties 1))
162 str candidates) 162 str candidates)
163 (while (looking-at "/\\([^/\n]+\\)/") 163 (while (looking-at "/\\([^/\n]+\\)/")
@@ -275,11 +275,11 @@
275 (let ((progress (make-progress-reporter "Collecting OKURI-NASI entries" 275 (let ((progress (make-progress-reporter "Collecting OKURI-NASI entries"
276 (point) (point-max) 276 (point) (point-max)
277 nil 10))) 277 nil 10)))
278 (while (re-search-forward "^\\(\\(\\cH\\|ー\\)+\\) \\(/\\cj.*\\)/$" 278 (while (re-search-forward "^\\(\\cH+\\) \\(/\\cj.*\\)/$"
279 nil t) 279 nil t)
280 (let ((kana (match-string-no-properties 1)) 280 (let ((kana (match-string-no-properties 1))
281 (candidates (skkdic-get-candidate-list (match-beginning 3) 281 (candidates (skkdic-get-candidate-list (match-beginning 2)
282 (match-end 3)))) 282 (match-end 2))))
283 (setq skkdic-okuri-nasi-entries 283 (setq skkdic-okuri-nasi-entries
284 (cons (cons kana candidates) skkdic-okuri-nasi-entries)) 284 (cons (cons kana candidates) skkdic-okuri-nasi-entries))
285 (progress-reporter-update progress (point)) 285 (progress-reporter-update progress (point))
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el
index 70aa3c4b1f1..1a67a95927b 100644
--- a/lisp/progmodes/cc-awk.el
+++ b/lisp/progmodes/cc-awk.el
@@ -95,7 +95,7 @@
95;; Emacs has in the past used \r to mark hidden lines in some fashion (and 95;; Emacs has in the past used \r to mark hidden lines in some fashion (and
96;; maybe still does). 96;; maybe still does).
97 97
98(defconst c-awk-esc-pair-re "\\\\\\(.\\|\n\\|\r\\|\\'\\)") 98(defconst c-awk-esc-pair-re "\\\\\\(.\\|\n\\|\\'\\)")
99;; Matches any escaped (with \) character-pair, including an escaped newline. 99;; Matches any escaped (with \) character-pair, including an escaped newline.
100(defconst c-awk-non-eol-esc-pair-re "\\\\\\(.\\|\\'\\)") 100(defconst c-awk-non-eol-esc-pair-re "\\\\\\(.\\|\\'\\)")
101;; Matches any escaped (with \) character-pair, apart from an escaped newline. 101;; Matches any escaped (with \) character-pair, apart from an escaped newline.
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 73b55e29a5a..ba007d67c0d 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -7983,7 +7983,7 @@ prototype \\&SUB Returns prototype of the function given a reference.
7983 "\\|" ; $ ^ 7983 "\\|" ; $ ^
7984 "[$^]" 7984 "[$^]"
7985 "\\|" ; simple-code simple-code*? 7985 "\\|" ; simple-code simple-code*?
7986 "\\(\\\\.\\|[^][()#|*+?\n]\\)\\([*+{?]\\??\\)?" ; 4 5 7986 "\\(\\\\.\\|[^][()#|*+?$^\n]\\)\\([*+{?]\\??\\)?" ; 4 5
7987 "\\|" ; Class 7987 "\\|" ; Class
7988 "\\(\\[\\)" ; 6 7988 "\\(\\[\\)" ; 6
7989 "\\|" ; Grouping 7989 "\\|" ; Grouping
diff --git a/lisp/xml.el b/lisp/xml.el
index b5b923f863e..1f3c05f4d92 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -245,7 +245,6 @@ See also `xml-get-attribute-or-nil'."
245;; [54] AttType ::= StringType | TokenizedType | EnumeratedType 245;; [54] AttType ::= StringType | TokenizedType | EnumeratedType
246;; [55] StringType ::= 'CDATA' 246;; [55] StringType ::= 'CDATA'
247(defconst xml-att-type-re (concat "\\(?:CDATA\\|" xml-tokenized-type-re 247(defconst xml-att-type-re (concat "\\(?:CDATA\\|" xml-tokenized-type-re
248 "\\|" xml-notation-type-re
249 "\\|" xml-enumerated-type-re "\\)")) 248 "\\|" xml-enumerated-type-re "\\)"))
250 249
251;; [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) 250;; [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)