diff options
| author | Paul Eggert | 2019-04-12 19:43:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-04-12 19:43:41 -0700 |
| commit | 7ddd08bd3ebc48998062a7d29274cf080256a48f (patch) | |
| tree | da54083040dc4675dc5b9084ab32a0ed4ec6a8f5 /lisp/erc | |
| parent | 8635e011edd1c50678074a49cbbf857b35823e9d (diff) | |
| download | emacs-7ddd08bd3ebc48998062a7d29274cf080256a48f.tar.gz emacs-7ddd08bd3ebc48998062a7d29274cf080256a48f.zip | |
Omit/rewrite useless regexp repetitions
Problem reported by Mattias EngdegÄrd in:
https://lists.gnu.org/r/emacs-devel/2019-04/msg00527.html
* lisp/align.el (align-rules-list):
* lisp/cedet/srecode/srt-mode.el (srecode-font-lock-keywords):
* lisp/emacs-lisp/copyright.el (copyright-regexp):
* lisp/erc/erc-backend.el (JOIN):
* lisp/erc/erc-goodies.el (erc-unmorse):
* lisp/mail/mail-extr.el (mail-extr-telephone-extension-pattern):
* lisp/net/tramp-adb.el (tramp-adb-prompt):
* lisp/org/org-table.el (org-table-range-regexp):
* lisp/progmodes/idlwave.el (idlwave-where):
* lisp/progmodes/verilog-mode.el (verilog-declaration-re-2-no-macro)
(verilog-declaration-re-2-macro, verilog-delete-auto-buffer)
(verilog-auto-inst-port):
* lisp/url/url-misc.el (url-data):
Omit or rewrite useless repetitions that risk being very slow in
the backtracking regexp engine in Emacs.
Diffstat (limited to 'lisp/erc')
| -rw-r--r-- | lisp/erc/erc-backend.el | 2 | ||||
| -rw-r--r-- | lisp/erc/erc-goodies.el | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 2854cde19cc..210830a2b49 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el | |||
| @@ -1285,7 +1285,7 @@ add things to `%s' instead." | |||
| 1285 | (pcase-let ((`(,nick ,login ,host) | 1285 | (pcase-let ((`(,nick ,login ,host) |
| 1286 | (erc-parse-user (erc-response.sender parsed)))) | 1286 | (erc-parse-user (erc-response.sender parsed)))) |
| 1287 | ;; strip the stupid combined JOIN facility (IRC 2.9) | 1287 | ;; strip the stupid combined JOIN facility (IRC 2.9) |
| 1288 | (if (string-match "^\\(.*\\)?\^g.*$" chnl) | 1288 | (if (string-match "^\\(.*\\)\^g.*$" chnl) |
| 1289 | (setq chnl (match-string 1 chnl))) | 1289 | (setq chnl (match-string 1 chnl))) |
| 1290 | (save-excursion | 1290 | (save-excursion |
| 1291 | (let* ((str (cond | 1291 | (let* ((str (cond |
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 117b6783b8d..884c594b9ed 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el | |||
| @@ -548,7 +548,7 @@ channel that has weird people talking in morse to each other. | |||
| 548 | 548 | ||
| 549 | See also `unmorse-region'." | 549 | See also `unmorse-region'." |
| 550 | (goto-char (point-min)) | 550 | (goto-char (point-min)) |
| 551 | (when (re-search-forward "[.-]+\\([.-]*/? *\\)+[.-]+/?" nil t) | 551 | (when (re-search-forward "[.-]+[./ -]*[.-]/?" nil t) |
| 552 | (save-restriction | 552 | (save-restriction |
| 553 | (narrow-to-region (match-beginning 0) (match-end 0)) | 553 | (narrow-to-region (match-beginning 0) (match-end 0)) |
| 554 | ;; Turn " / " into " " | 554 | ;; Turn " / " into " " |