diff options
| author | Mattias EngdegÄrd | 2020-02-20 15:45:44 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2020-02-20 16:05:18 +0100 |
| commit | 770f76f050376bbd77a3cc8cf44db57cf855a27c (patch) | |
| tree | 9cfc115c6130b67939865c7e56d92075eff6484a | |
| parent | 8dc4034ed6f86455c294f22a3d345b00cd4aa143 (diff) | |
| download | emacs-770f76f050376bbd77a3cc8cf44db57cf855a27c.tar.gz emacs-770f76f050376bbd77a3cc8cf44db57cf855a27c.zip | |
Remove subsumed repetitions in regexps
Make regexps smaller and faster by removing terms that are superfluous
by virtue of standing next to another term that matches more. See
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00949.html
for details.
* lisp/bs.el (bs--make-header-match-string):
* lisp/gnus/deuglify.el (gnus-outlook-repair-attribution-block):
* lisp/gnus/message.el (message-subject-trailing-was-ask-regexp)
(message-subject-trailing-was-regexp):
* lisp/informat.el (Info-validate):
* lisp/net/browse-url.el (browse-url-button-regexp):
* lisp/net/rcirc.el (rcirc-url-regexp):
* lisp/org/ob-core.el (org-babel-remove-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/org-capture.el (org-capture-set-target-location):
* lisp/org/org-table.el (org-table-expand-lhs-ranges):
* lisp/org/org.el (org-maybe-keyword-time-regexp, org-ts-regexp)
(org-ts-regexp-inactive, org-ts-regexp-both):
* lisp/play/gametree.el (gametree-hack-file-layout):
* lisp/progmodes/cc-mode.el (c-Java-defun-prompt-regexp):
* lisp/progmodes/idlw-shell.el (idlwave-shell-halting-error):
* lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
* lisp/progmodes/verilog-mode.el (verilog-error-font-lock-keywords)
(verilog-verilint-off, verilog-case-indent-level)
(verilog-within-translate-off, verilog-start-translate-off)
(verilog-back-to-start-translate-off, verilog-end-translate-off)
(verilog-expand-dirnames):
* lisp/term.el (term-control-seq-regexp):
* lisp/textmodes/reftex-vars.el (featurep):
* lisp/url/url-gw.el (url-open-telnet):
* lisp/vc/ediff-ptch.el (ediff-context-diff-label-regexp):
* lisp/vc/pcvs-parse.el (cvs-parse-status):
* test/src/regex-emacs-tests.el (regex-tests-PCRE):
Remove subsumed repetitions.
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function):
Simplify repetition of a repetition.
| -rw-r--r-- | lisp/bs.el | 7 | ||||
| -rw-r--r-- | lisp/gnus/deuglify.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 4 | ||||
| -rw-r--r-- | lisp/informat.el | 2 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 2 | ||||
| -rw-r--r-- | lisp/net/rcirc.el | 2 | ||||
| -rw-r--r-- | lisp/org/ob-core.el | 2 | ||||
| -rw-r--r-- | lisp/org/ob-fortran.el | 2 | ||||
| -rw-r--r-- | lisp/org/org-capture.el | 2 | ||||
| -rw-r--r-- | lisp/org/org-table.el | 2 | ||||
| -rw-r--r-- | lisp/org/org.el | 8 | ||||
| -rw-r--r-- | lisp/play/gametree.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/idlw-shell.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 18 | ||||
| -rw-r--r-- | lisp/term.el | 4 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-vars.el | 2 | ||||
| -rw-r--r-- | lisp/url/url-gw.el | 2 | ||||
| -rw-r--r-- | lisp/vc/ediff-ptch.el | 2 | ||||
| -rw-r--r-- | lisp/vc/pcvs-parse.el | 2 | ||||
| -rw-r--r-- | test/src/regex-emacs-tests.el | 2 |
23 files changed, 42 insertions, 37 deletions
diff --git a/lisp/bs.el b/lisp/bs.el index f5cb93b5169..337d22ecf83 100644 --- a/lisp/bs.el +++ b/lisp/bs.el | |||
| @@ -173,7 +173,12 @@ return a string representing the column's value." | |||
| 173 | 173 | ||
| 174 | (defun bs--make-header-match-string () | 174 | (defun bs--make-header-match-string () |
| 175 | "Return a regexp matching the first line of a Buffer Selection Menu buffer." | 175 | "Return a regexp matching the first line of a Buffer Selection Menu buffer." |
| 176 | (concat "^\\(" (mapconcat #'car bs-attributes-list " *") " *$\\)")) | 176 | (concat "^\\(" |
| 177 | (apply #'concat (mapcan (lambda (e) | ||
| 178 | (and (not (equal (car e) "")) | ||
| 179 | (list " *" (car e)))) | ||
| 180 | bs-attributes-list)) | ||
| 181 | " *$\\)")) | ||
| 177 | 182 | ||
| 178 | ;; Font-Lock-Settings | 183 | ;; Font-Lock-Settings |
| 179 | (defvar bs-mode-font-lock-keywords | 184 | (defvar bs-mode-font-lock-keywords |
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el index 0ce4a7d2928..647f643c962 100644 --- a/lisp/gnus/deuglify.el +++ b/lisp/gnus/deuglify.el | |||
| @@ -403,9 +403,9 @@ NODISPLAY is non-nil, don't redisplay the article buffer." | |||
| 403 | (gnus-with-article-buffer | 403 | (gnus-with-article-buffer |
| 404 | (article-goto-body) | 404 | (article-goto-body) |
| 405 | (when (re-search-forward | 405 | (when (re-search-forward |
| 406 | (concat "^[" cite-marks " \t]*--* ?[^-]+ [^-]+ ?--*\\s *\n" | 406 | (concat "^[" cite-marks " \t]*--*[^-]+ [^-]+--*\\s *\n" |
| 407 | "[^\n:]+:[ \t]*\\([^\n]+\\)\n" | 407 | "[^\n:]+:[ \t]*\\([^\n]+\\)\n" |
| 408 | "\\([^\n:]+:[ \t]*[^\n]+\n\\)+") | 408 | "\\([^\n:]+:[^\n]+\n\\)+") |
| 409 | nil t) | 409 | nil t) |
| 410 | (gnus-kill-all-overlays) | 410 | (gnus-kill-all-overlays) |
| 411 | (replace-match "\\1 wrote:\n") | 411 | (replace-match "\\1 wrote:\n") |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 3abeec7e2f2..f1ace0eeb2e 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -322,7 +322,7 @@ used." | |||
| 322 | :group 'message-various) | 322 | :group 'message-various) |
| 323 | 323 | ||
| 324 | (defcustom message-subject-trailing-was-ask-regexp | 324 | (defcustom message-subject-trailing-was-ask-regexp |
| 325 | "[ \t]*\\([[(]+[Ww][Aa][Ss]:?[ \t]*.*[])]+\\)" | 325 | "[ \t]*\\([[(]+[Ww][Aa][Ss].*[])]+\\)" |
| 326 | "Regexp matching \"(was: <old subject>)\" in the subject line. | 326 | "Regexp matching \"(was: <old subject>)\" in the subject line. |
| 327 | 327 | ||
| 328 | The function `message-strip-subject-trailing-was' uses this regexp if | 328 | The function `message-strip-subject-trailing-was' uses this regexp if |
| @@ -337,7 +337,7 @@ It is okay to create some false positives here, as the user is asked." | |||
| 337 | :type 'regexp) | 337 | :type 'regexp) |
| 338 | 338 | ||
| 339 | (defcustom message-subject-trailing-was-regexp | 339 | (defcustom message-subject-trailing-was-regexp |
| 340 | "[ \t]*\\((*[Ww][Aa][Ss]:[ \t]*.*)\\)" | 340 | "[ \t]*\\((*[Ww][Aa][Ss]:.*)\\)" |
| 341 | "Regexp matching \"(was: <old subject>)\" in the subject line. | 341 | "Regexp matching \"(was: <old subject>)\" in the subject line. |
| 342 | 342 | ||
| 343 | If `message-subject-trailing-was-query' is set to t, the subject is | 343 | If `message-subject-trailing-was-query' is set to t, the subject is |
diff --git a/lisp/informat.el b/lisp/informat.el index 9873f66f215..7750ab00898 100644 --- a/lisp/informat.el +++ b/lisp/informat.el | |||
| @@ -337,7 +337,7 @@ Check that every node pointer points to an existing node." | |||
| 337 | (point)))) | 337 | (point)))) |
| 338 | (Info-extract-menu-node-name)))) | 338 | (Info-extract-menu-node-name)))) |
| 339 | (goto-char (point-min)) | 339 | (goto-char (point-min)) |
| 340 | (while (re-search-forward "\\*note[ \n]*[^:\t]*:" nil t) | 340 | (while (re-search-forward "\\*note\\>[^:\t]*:" nil t) |
| 341 | (goto-char (+ (match-beginning 0) 5)) | 341 | (goto-char (+ (match-beginning 0) 5)) |
| 342 | (skip-chars-forward " \n") | 342 | (skip-chars-forward " \n") |
| 343 | (Info-validate-node-name | 343 | (Info-validate-node-name |
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 25aabf6d61d..7aad44b2876 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -216,7 +216,7 @@ be used instead." | |||
| 216 | "\\(?:" | 216 | "\\(?:" |
| 217 | ;; Match paired parentheses, e.g. in Wikipedia URLs: | 217 | ;; Match paired parentheses, e.g. in Wikipedia URLs: |
| 218 | ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com | 218 | ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com |
| 219 | "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" | 219 | "[" chars punct "]+" "(" "[" chars punct "]+" ")" |
| 220 | "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?" | 220 | "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?" |
| 221 | "\\|" | 221 | "\\|" |
| 222 | "[" chars punct "]+" "[" chars "]" | 222 | "[" chars punct "]+" "[" chars "]" |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index ad06d31cf9a..a2234166903 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -2421,7 +2421,7 @@ keywords when no KEYWORD is given." | |||
| 2421 | (concat | 2421 | (concat |
| 2422 | "\\(?:" | 2422 | "\\(?:" |
| 2423 | ;; Match paired parentheses, e.g. in Wikipedia URLs: | 2423 | ;; Match paired parentheses, e.g. in Wikipedia URLs: |
| 2424 | "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" "[" chars "]" | 2424 | "[" chars punct "]+" "(" "[" chars punct "]+" ")" "[" chars "]" |
| 2425 | "\\|" | 2425 | "\\|" |
| 2426 | "[" chars punct "]+" "[" chars "]" | 2426 | "[" chars punct "]+" "[" chars "]" |
| 2427 | "\\)")) | 2427 | "\\)")) |
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 651561a2018..a5ad97a468b 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el | |||
| @@ -2437,7 +2437,7 @@ INFO may provide the values of these header arguments (in the | |||
| 2437 | (when location | 2437 | (when location |
| 2438 | (save-excursion | 2438 | (save-excursion |
| 2439 | (goto-char location) | 2439 | (goto-char location) |
| 2440 | (when (looking-at (concat org-babel-result-regexp ".*$")) | 2440 | (when (looking-at org-babel-result-regexp) |
| 2441 | (delete-region | 2441 | (delete-region |
| 2442 | (if keep-keyword (line-beginning-position 2) | 2442 | (if keep-keyword (line-beginning-position 2) |
| 2443 | (save-excursion | 2443 | (save-excursion |
diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el index 154465f28e1..149058f05f4 100644 --- a/lisp/org/ob-fortran.el +++ b/lisp/org/ob-fortran.el | |||
| @@ -106,7 +106,7 @@ its header arguments." | |||
| 106 | 106 | ||
| 107 | (defun org-babel-fortran-ensure-main-wrap (body params) | 107 | (defun org-babel-fortran-ensure-main-wrap (body params) |
| 108 | "Wrap body in a \"program ... end program\" block if none exists." | 108 | "Wrap body in a \"program ... end program\" block if none exists." |
| 109 | (if (string-match "^[ \t]*program[ \t]*.*" (capitalize body)) | 109 | (if (string-match "^[ \t]*program\\>" (capitalize body)) |
| 110 | (let ((vars (org-babel--get-vars params))) | 110 | (let ((vars (org-babel--get-vars params))) |
| 111 | (when vars (error "Cannot use :vars if `program' statement is present")) | 111 | (when vars (error "Cannot use :vars if `program' statement is present")) |
| 112 | body) | 112 | body) |
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index 003cbef1fdf..ace51270175 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el | |||
| @@ -1021,7 +1021,7 @@ Store them in the capture property list." | |||
| 1021 | (apply #'encode-time 0 0 | 1021 | (apply #'encode-time 0 0 |
| 1022 | org-extend-today-until | 1022 | org-extend-today-until |
| 1023 | (cl-cdddr (decode-time prompt-time)))) | 1023 | (cl-cdddr (decode-time prompt-time)))) |
| 1024 | ((string-match "\\([^ ]+\\)--?[^ ]+[ ]+\\(.*\\)" | 1024 | ((string-match "\\([^ ]+\\)-[^ ]+[ ]+\\(.*\\)" |
| 1025 | org-read-date-final-answer) | 1025 | org-read-date-final-answer) |
| 1026 | ;; Replace any time range by its start. | 1026 | ;; Replace any time range by its start. |
| 1027 | (apply #'encode-time | 1027 | (apply #'encode-time |
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 469e01be5d2..98702feb375 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el | |||
| @@ -3099,7 +3099,7 @@ function assumes the table is already analyzed (i.e., using | |||
| 3099 | (let ((lhs (car e)) | 3099 | (let ((lhs (car e)) |
| 3100 | (rhs (cdr e))) | 3100 | (rhs (cdr e))) |
| 3101 | (cond | 3101 | (cond |
| 3102 | ((string-match-p "\\`@-?[-+0-9]+\\$-?[0-9]+\\'" lhs) | 3102 | ((string-match-p "\\`@[-+0-9]+\\$-?[0-9]+\\'" lhs) |
| 3103 | ;; This just refers to one fixed field. | 3103 | ;; This just refers to one fixed field. |
| 3104 | (push e res)) | 3104 | (push e res)) |
| 3105 | ((string-match-p "\\`[a-zA-Z][_a-zA-Z0-9]*\\'" lhs) | 3105 | ((string-match-p "\\`[a-zA-Z][_a-zA-Z0-9]*\\'" lhs) |
diff --git a/lisp/org/org.el b/lisp/org/org.el index e8e1ef99f26..52b72817650 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -460,7 +460,7 @@ Matched keyword is in group 1.") | |||
| 460 | org-clock-string) | 460 | org-clock-string) |
| 461 | t) | 461 | t) |
| 462 | "\\)?" | 462 | "\\)?" |
| 463 | " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^]\r\n>]*?[]>]" | 463 | " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*[]>]" |
| 464 | "\\|" | 464 | "\\|" |
| 465 | "<%%([^\r\n>]*>\\)") | 465 | "<%%([^\r\n>]*>\\)") |
| 466 | "Matches a timestamp, possibly preceded by a keyword.") | 466 | "Matches a timestamp, possibly preceded by a keyword.") |
| @@ -564,14 +564,14 @@ Effort estimates given in this property need to have the format H:MM.") | |||
| 564 | 564 | ||
| 565 | ;;;; Timestamp | 565 | ;;;; Timestamp |
| 566 | 566 | ||
| 567 | (defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)>" | 567 | (defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*\\)>" |
| 568 | "Regular expression for fast time stamp matching.") | 568 | "Regular expression for fast time stamp matching.") |
| 569 | 569 | ||
| 570 | (defconst org-ts-regexp-inactive | 570 | (defconst org-ts-regexp-inactive |
| 571 | "\\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)\\]" | 571 | "\\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*\\)\\]" |
| 572 | "Regular expression for fast inactive time stamp matching.") | 572 | "Regular expression for fast inactive time stamp matching.") |
| 573 | 573 | ||
| 574 | (defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^]\r\n>]*?\\)[]>]" | 574 | (defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*\\)[]>]" |
| 575 | "Regular expression for fast time stamp matching.") | 575 | "Regular expression for fast time stamp matching.") |
| 576 | 576 | ||
| 577 | (defconst org-ts-regexp0 | 577 | (defconst org-ts-regexp0 |
diff --git a/lisp/play/gametree.el b/lisp/play/gametree.el index aa99b553244..ba74afce298 100644 --- a/lisp/play/gametree.el +++ b/lisp/play/gametree.el | |||
| @@ -324,7 +324,7 @@ This value is simply the outline heading level of the current line." | |||
| 324 | (defun gametree-hack-file-layout () | 324 | (defun gametree-hack-file-layout () |
| 325 | (save-excursion | 325 | (save-excursion |
| 326 | (goto-char (point-min)) | 326 | (goto-char (point-min)) |
| 327 | (if (looking-at "[^\n]*-*-[^\n]*gametree-local-layout: \\([^;\n]*\\);") | 327 | (if (looking-at "[^\n]*-[^\n]*gametree-local-layout: \\([^;\n]*\\);") |
| 328 | (progn | 328 | (progn |
| 329 | (goto-char (match-beginning 1)) | 329 | (goto-char (match-beginning 1)) |
| 330 | (delete-region (point) (match-end 1)) | 330 | (delete-region (point) (match-end 1)) |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 7496684d939..9c62b2bb065 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -2671,7 +2671,7 @@ Key bindings: | |||
| 2671 | ;; since it's practically impossible to write a regexp that reliably | 2671 | ;; since it's practically impossible to write a regexp that reliably |
| 2672 | ;; matches such a construct. Other tools are necessary. | 2672 | ;; matches such a construct. Other tools are necessary. |
| 2673 | (defconst c-Java-defun-prompt-regexp | 2673 | (defconst c-Java-defun-prompt-regexp |
| 2674 | "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()\^?=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f\v]*\\)+\\)?\\s-*") | 2674 | "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()\^?=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f\v]*\\)+\\)?\\s-*") |
| 2675 | 2675 | ||
| 2676 | (easy-menu-define c-java-menu java-mode-map "Java Mode Commands" | 2676 | (easy-menu-define c-java-menu java-mode-map "Java Mode Commands" |
| 2677 | (cons "Java" (c-lang-const c-mode-menu java))) | 2677 | (cons "Java" (c-lang-const c-mode-menu java))) |
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index dba70cb2821..6770fbe8abc 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el | |||
| @@ -1598,7 +1598,7 @@ number.") | |||
| 1598 | "A regular expression to match any IDL error.") | 1598 | "A regular expression to match any IDL error.") |
| 1599 | 1599 | ||
| 1600 | (defvar idlwave-shell-halting-error | 1600 | (defvar idlwave-shell-halting-error |
| 1601 | "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n" | 1601 | "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+.*\\)\n" |
| 1602 | "A regular expression to match errors which halt execution.") | 1602 | "A regular expression to match errors which halt execution.") |
| 1603 | 1603 | ||
| 1604 | (defvar idlwave-shell-cant-continue-error | 1604 | (defvar idlwave-shell-cant-continue-error |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 5da5577c108..e16225c7fa9 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -801,7 +801,7 @@ The style of the comment is controlled by `ruby-encoding-magic-comment-style'." | |||
| 801 | (let ((coding-system (ruby--detect-encoding))) | 801 | (let ((coding-system (ruby--detect-encoding))) |
| 802 | (when coding-system | 802 | (when coding-system |
| 803 | (if (looking-at "^#!") (beginning-of-line 2)) | 803 | (if (looking-at "^#!") (beginning-of-line 2)) |
| 804 | (cond ((looking-at "\\s *#\\s *.*\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)") | 804 | (cond ((looking-at "\\s *#.*\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)") |
| 805 | ;; update existing encoding comment if necessary | 805 | ;; update existing encoding comment if necessary |
| 806 | (unless (string= (match-string 2) coding-system) | 806 | (unless (string= (match-string 2) coding-system) |
| 807 | (goto-char (match-beginning 2)) | 807 | (goto-char (match-beginning 2)) |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index a241a1e69ba..044d7820ee3 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1096,7 +1096,7 @@ subshells can nest." | |||
| 1096 | (")" (0 (sh-font-lock-paren (match-beginning 0)))) | 1096 | (")" (0 (sh-font-lock-paren (match-beginning 0)))) |
| 1097 | ;; Highlight (possibly nested) subshells inside "" quoted | 1097 | ;; Highlight (possibly nested) subshells inside "" quoted |
| 1098 | ;; regions correctly. | 1098 | ;; regions correctly. |
| 1099 | ("\"\\(?:\\(?:[^\\\"]\\|\\\\.\\)*?\\)??\\(\\$(\\|`\\)" | 1099 | ("\"\\(?:[^\\\"]\\|\\\\.\\)*?\\(\\$(\\|`\\)" |
| 1100 | (1 (ignore | 1100 | (1 (ignore |
| 1101 | (if (nth 8 (save-excursion (syntax-ppss (match-beginning 0)))) | 1101 | (if (nth 8 (save-excursion (syntax-ppss (match-beginning 0)))) |
| 1102 | (goto-char (1+ (match-beginning 0))) | 1102 | (goto-char (1+ (match-beginning 0))) |
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 460957b7161..cc601601193 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -958,8 +958,8 @@ See `compilation-error-regexp-alist-alist' for the formatting. For XEmacs.") | |||
| 958 | ("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 bold t) | 958 | ("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 bold t) |
| 959 | ("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 2 bold t) | 959 | ("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 2 bold t) |
| 960 | ;; verilog-verilator | 960 | ;; verilog-verilator |
| 961 | (".*%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 bold t) | 961 | (".*\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 bold t) |
| 962 | (".*%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 4 bold t) | 962 | (".*\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 4 bold t) |
| 963 | ;; verilog-leda | 963 | ;; verilog-leda |
| 964 | ("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 1 bold t) | 964 | ("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 1 bold t) |
| 965 | ("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 2 bold t) | 965 | ("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 2 bold t) |
| @@ -5345,7 +5345,7 @@ becomes: | |||
| 5345 | (interactive) | 5345 | (interactive) |
| 5346 | (save-excursion | 5346 | (save-excursion |
| 5347 | (beginning-of-line) | 5347 | (beginning-of-line) |
| 5348 | (when (looking-at "\\(.*\\)([WE]\\([0-9A-Z]+\\)).*,\\s +line\\s +[0-9]+:\\s +\\([^:\n]+\\):?.*$") | 5348 | (when (looking-at "\\(.*\\)([WE]\\([0-9A-Z]+\\)).*,\\s +line\\s +[0-9]+:\\s +\\([^:\n]+\\).*$") |
| 5349 | (replace-match (format | 5349 | (replace-match (format |
| 5350 | ;; %3s makes numbers 1-999 line up nicely | 5350 | ;; %3s makes numbers 1-999 line up nicely |
| 5351 | "\\1//Verilint %3s off // WARNING: \\3" | 5351 | "\\1//Verilint %3s off // WARNING: \\3" |
| @@ -6788,7 +6788,7 @@ Do not count named blocks or case-statements." | |||
| 6788 | ((looking-at verilog-named-block-re) | 6788 | ((looking-at verilog-named-block-re) |
| 6789 | (current-column)) | 6789 | (current-column)) |
| 6790 | ((and (not (looking-at verilog-extended-case-re)) | 6790 | ((and (not (looking-at verilog-extended-case-re)) |
| 6791 | (looking-at "^[^:;]+[ \t]*:")) | 6791 | (looking-at "^[^:;]+:")) |
| 6792 | (verilog-re-search-forward ":" nil t) | 6792 | (verilog-re-search-forward ":" nil t) |
| 6793 | (skip-chars-forward " \t") | 6793 | (skip-chars-forward " \t") |
| 6794 | (current-column)) | 6794 | (current-column)) |
| @@ -7782,7 +7782,7 @@ If search fails, other files are checked based on | |||
| 7782 | "Return point if within translate-off region, else nil." | 7782 | "Return point if within translate-off region, else nil." |
| 7783 | (and (save-excursion | 7783 | (and (save-excursion |
| 7784 | (re-search-backward | 7784 | (re-search-backward |
| 7785 | (concat "//\\s-*.*\\s-*" verilog-directive-regexp "\\(on\\|off\\)\\>") | 7785 | (concat "//.*" verilog-directive-regexp "\\(on\\|off\\)\\>") |
| 7786 | nil t)) | 7786 | nil t)) |
| 7787 | (equal "off" (match-string 2)) | 7787 | (equal "off" (match-string 2)) |
| 7788 | (point))) | 7788 | (point))) |
| @@ -7790,14 +7790,14 @@ If search fails, other files are checked based on | |||
| 7790 | (defun verilog-start-translate-off (limit) | 7790 | (defun verilog-start-translate-off (limit) |
| 7791 | "Return point before translate-off directive if before LIMIT, else nil." | 7791 | "Return point before translate-off directive if before LIMIT, else nil." |
| 7792 | (when (re-search-forward | 7792 | (when (re-search-forward |
| 7793 | (concat "//\\s-*.*\\s-*" verilog-directive-regexp "off\\>") | 7793 | (concat "//.*" verilog-directive-regexp "off\\>") |
| 7794 | limit t) | 7794 | limit t) |
| 7795 | (match-beginning 0))) | 7795 | (match-beginning 0))) |
| 7796 | 7796 | ||
| 7797 | (defun verilog-back-to-start-translate-off (limit) | 7797 | (defun verilog-back-to-start-translate-off (limit) |
| 7798 | "Return point before translate-off directive if before LIMIT, else nil." | 7798 | "Return point before translate-off directive if before LIMIT, else nil." |
| 7799 | (when (re-search-backward | 7799 | (when (re-search-backward |
| 7800 | (concat "//\\s-*.*\\s-*" verilog-directive-regexp "off\\>") | 7800 | (concat "//.*" verilog-directive-regexp "off\\>") |
| 7801 | limit t) | 7801 | limit t) |
| 7802 | (match-beginning 0))) | 7802 | (match-beginning 0))) |
| 7803 | 7803 | ||
| @@ -7805,7 +7805,7 @@ If search fails, other files are checked based on | |||
| 7805 | "Return point after translate-on directive if before LIMIT, else nil." | 7805 | "Return point after translate-on directive if before LIMIT, else nil." |
| 7806 | 7806 | ||
| 7807 | (re-search-forward (concat | 7807 | (re-search-forward (concat |
| 7808 | "//\\s-*.*\\s-*" verilog-directive-regexp "on\\>") limit t)) | 7808 | "//.*" verilog-directive-regexp "on\\>") limit t)) |
| 7809 | 7809 | ||
| 7810 | (defun verilog-match-translate-off (limit) | 7810 | (defun verilog-match-translate-off (limit) |
| 7811 | "Match a translate-off block, setting `match-data' and returning t, else nil. | 7811 | "Match a translate-off block, setting `match-data' and returning t, else nil. |
| @@ -9982,7 +9982,7 @@ Or, just the existing dirnames themselves if there are no wildcards." | |||
| 9982 | (while dirnames | 9982 | (while dirnames |
| 9983 | (setq dirname (car dirnames) | 9983 | (setq dirname (car dirnames) |
| 9984 | dirnames (cdr dirnames)) | 9984 | dirnames (cdr dirnames)) |
| 9985 | (cond ((string-match (concat "^\\(\\|[/\\]*[^*?]*[/\\]\\)" ; root | 9985 | (cond ((string-match (concat "^\\(\\|[^*?]*[/\\]\\)" ; root |
| 9986 | "\\([^/\\]*[*?][^/\\]*\\)" ; filename with *? | 9986 | "\\([^/\\]*[*?][^/\\]*\\)" ; filename with *? |
| 9987 | "\\(.*\\)") ; rest | 9987 | "\\(.*\\)") ; rest |
| 9988 | dirname) | 9988 | dirname) |
diff --git a/lisp/term.el b/lisp/term.el index 09dfeb61d17..b990c83cfcb 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -2796,12 +2796,12 @@ See `term-prompt-regexp'." | |||
| 2796 | "\\(?:[\r\n\000\007\t\b\016\017]\\|" | 2796 | "\\(?:[\r\n\000\007\t\b\016\017]\\|" |
| 2797 | ;; some Emacs specific control sequences, implemented by | 2797 | ;; some Emacs specific control sequences, implemented by |
| 2798 | ;; `term-command-hook', | 2798 | ;; `term-command-hook', |
| 2799 | "\032[^\n]+\r?\n\\|" | 2799 | "\032[^\n]+\n\\|" |
| 2800 | ;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements | 2800 | ;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements |
| 2801 | ;; of the C1 set"), | 2801 | ;; of the C1 set"), |
| 2802 | "\e\\(?:[DM78c]\\|" | 2802 | "\e\\(?:[DM78c]\\|" |
| 2803 | ;; another Emacs specific control sequence, | 2803 | ;; another Emacs specific control sequence, |
| 2804 | "AnSiT[^\n]+\r?\n\\|" | 2804 | "AnSiT[^\n]+\n\\|" |
| 2805 | ;; or an escape sequence (section 5.4 "Control Sequences"), | 2805 | ;; or an escape sequence (section 5.4 "Control Sequences"), |
| 2806 | "\\[\\([\x30-\x3F]*\\)[\x20-\x2F]*[\x40-\x7E]\\)\\)") | 2806 | "\\[\\([\x30-\x3F]*\\)[\x20-\x2F]*[\x40-\x7E]\\)\\)") |
| 2807 | "Regexp matching control sequences handled by term.el.") | 2807 | "Regexp matching control sequences handled by term.el.") |
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 50dd6cd5f5a..c9fd19d2324 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el | |||
| @@ -925,7 +925,7 @@ DOWNCASE t: Downcase words before using them." | |||
| 925 | "\\<label[[:space:]]*=[[:space:]]*" | 925 | "\\<label[[:space:]]*=[[:space:]]*" |
| 926 | ;; Match the label value; braces around the value are | 926 | ;; Match the label value; braces around the value are |
| 927 | ;; optional. | 927 | ;; optional. |
| 928 | "{?\\(?1:[^] ,}\r\n\t%]+\\)}?" | 928 | "{?\\(?1:[^] ,}\r\n\t%]+\\)" |
| 929 | ;; We are done. Just search until the next closing bracket | 929 | ;; We are done. Just search until the next closing bracket |
| 930 | "[^]]*\\]")) | 930 | "[^]]*\\]")) |
| 931 | "List of regexps matching \\label definitions. | 931 | "List of regexps matching \\label definitions. |
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el index bcb67431aa8..f16fc234025 100644 --- a/lisp/url/url-gw.el +++ b/lisp/url/url-gw.el | |||
| @@ -191,7 +191,7 @@ linked Emacs under SunOS 4.x." | |||
| 191 | proc (concat (mapconcat 'identity | 191 | proc (concat (mapconcat 'identity |
| 192 | (append url-gateway-telnet-parameters | 192 | (append url-gateway-telnet-parameters |
| 193 | (list host service)) " ") "\n")) | 193 | (list host service)) " ") "\n")) |
| 194 | (url-wait-for-string "^\r*Escape character.*\r*\n+" proc) | 194 | (url-wait-for-string "^\r*Escape character.*\n+" proc) |
| 195 | (delete-region (point-min) (match-end 0)) | 195 | (delete-region (point-min) (match-end 0)) |
| 196 | (process-send-string proc "\^]\n") | 196 | (process-send-string proc "\^]\n") |
| 197 | (url-wait-for-string "^telnet" proc) | 197 | (url-wait-for-string "^telnet" proc) |
diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index cb0ae6ff6e1..f6af5a45550 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el | |||
| @@ -119,7 +119,7 @@ patch. So, don't change these variables, unless the default doesn't work." | |||
| 119 | (defcustom ediff-context-diff-label-regexp | 119 | (defcustom ediff-context-diff-label-regexp |
| 120 | (let ((stuff "\\([^ \t\n]+\\)")) | 120 | (let ((stuff "\\([^ \t\n]+\\)")) |
| 121 | (concat "\\(" ; context diff 2-liner | 121 | (concat "\\(" ; context diff 2-liner |
| 122 | "^\\*\\*\\* +" stuff "[^*]+[\t ]*\n--- +" stuff | 122 | "^\\*\\*\\* +" stuff "[^*]+\n--- +" stuff |
| 123 | "\\|" ; unified format diff 2-liner | 123 | "\\|" ; unified format diff 2-liner |
| 124 | "^--- +" stuff ".*\n\\+\\+\\+ +" stuff | 124 | "^--- +" stuff ".*\n\\+\\+\\+ +" stuff |
| 125 | "\\)")) | 125 | "\\)")) |
diff --git a/lisp/vc/pcvs-parse.el b/lisp/vc/pcvs-parse.el index 466c621311f..dd56aec94a0 100644 --- a/lisp/vc/pcvs-parse.el +++ b/lisp/vc/pcvs-parse.el | |||
| @@ -472,7 +472,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." | |||
| 472 | ;; Let's not get all worked up if the format changes a bit | 472 | ;; Let's not get all worked up if the format changes a bit |
| 473 | (cvs-match " *Working revision:.*$")) | 473 | (cvs-match " *Working revision:.*$")) |
| 474 | (cvs-or | 474 | (cvs-or |
| 475 | (cvs-match " *RCS Version:[ \t]*\\([0-9.]+\\)[ \t]*.*$" (head-rev 1)) | 475 | (cvs-match " *RCS Version:[ \t]*\\([0-9.]+\\).*$" (head-rev 1)) |
| 476 | (cvs-match " *Repository revision:[ \t]*\\([0-9.]+\\)[ \t]*\\(.*\\)$" | 476 | (cvs-match " *Repository revision:[ \t]*\\([0-9.]+\\)[ \t]*\\(.*\\)$" |
| 477 | (head-rev 1)) | 477 | (head-rev 1)) |
| 478 | (cvs-match " *Repository revision:.*")) | 478 | (cvs-match " *Repository revision:.*")) |
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el index ad0271049c3..f9372e37b11 100644 --- a/test/src/regex-emacs-tests.el +++ b/test/src/regex-emacs-tests.el | |||
| @@ -505,7 +505,7 @@ differences in behavior.") | |||
| 505 | (cond | 505 | (cond |
| 506 | 506 | ||
| 507 | ;; pattern | 507 | ;; pattern |
| 508 | ((save-excursion (re-search-forward "^/\\(.*\\)/\\(.*i?\\)$" nil t)) | 508 | ((save-excursion (re-search-forward "^/\\(.*\\)/\\(.*\\)$" nil t)) |
| 509 | (setq icase (string= "i" (match-string 2)) | 509 | (setq icase (string= "i" (match-string 2)) |
| 510 | pattern (regex-tests-unextend (match-string 1)))) | 510 | pattern (regex-tests-unextend (match-string 1)))) |
| 511 | 511 | ||