summaryrefslogtreecommitdiff
path: root/lisp/vc
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-05-14 11:43:49 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2019-05-15 18:55:27 +0200
commit26f735ff198e52370aafe09ed5ed669e78f196ab (patch)
treeb54c83556db3e13b5852642c84097ee0c4531778 /lisp/vc
parentd0ebc389ebba0ca5b99e019c47c4a616941378ac (diff)
downloademacs-26f735ff198e52370aafe09ed5ed669e78f196ab.tar.gz
Add standard unmatchable regexp
Add `regexp-unmatchable' as a standard unmatchable regexp, defined as "\\`a\\`". Use it where such a regexp is needed, replacing slower expressions in several places. From a suggestion by Philippe Schnoebelen. * lisp/subr.el (regexp-unmatchable): New defconst. * etc/NEWS (Lisp Changes): Mention `regexp-unmatchable'. * doc/lispref/searching.texi (Regexp Functions): Document it. * lisp/emacs-lisp/regexp-opt.el (regexp-opt) * lisp/progmodes/cc-defs.el (cc-conditional-require-after-load) (c-make-keywords-re) * lisp/progmodes/cc-engine.el (c-beginning-of-statement-1) (c-forward-<>-arglist-recur, c-forward-decl-or-cast-1) (c-looking-at-decl-block) * lisp/progmodes/cc-fonts.el (c-doc-line-join-re) (c-doc-bright-comment-start-re) * lisp/progmodes/cc-langs.el (c-populate-syntax-table) (c-assignment-op-regexp) (c-block-comment-ender-regexp, c-font-lock-comment-end-skip) (c-block-comment-start-regexp, c-line-comment-start-regexp) (c-doc-comment-start-regexp, c-decl-start-colon-kwd-re) (c-type-decl-prefix-key, c-type-decl-operator-prefix-key) (c-pre-id-bracelist-key, c-enum-clause-introduction-re) (c-nonlabel-token-2-key) * lisp/progmodes/cc-mode.el (c-doc-fl-decl-start, c-doc-fl-decl-end) * lisp/progmodes/cc-vars.el (c-noise-macro-with-parens-name-re) (c-noise-macro-name-re, c-make-noise-macro-regexps) * lisp/progmodes/octave.el (octave-help-mode) * lisp/vc/vc-bzr.el (vc-bzr-log-view-mode, vc-bzr-revision-completion-table) * lisp/vc/vc-git.el (vc-git-log-view-mode) * lisp/vc/vc-hg.el (vc-hg-log-view-mode) * lisp/vc/vc-mtn.el (vc-mtn-log-view-mode): Use `regexp-unmatchable'. * lisp/textmodes/ispell.el (ispell-non-empty-string): Use `regexp-unmatchable', fixing a broken never-match regexp.
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/vc-bzr.el5
-rw-r--r--lisp/vc/vc-git.el2
-rw-r--r--lisp/vc/vc-hg.el2
-rw-r--r--lisp/vc/vc-mtn.el2
4 files changed, 6 insertions, 5 deletions
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index ab5a449cd3d..ee1646cae5a 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -702,7 +702,7 @@ or a superior directory.")
(remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack.
(require 'add-log)
(set (make-local-variable 'log-view-per-file-logs) nil)
- (set (make-local-variable 'log-view-file-re) "\\`a\\`")
+ (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
(set (make-local-variable 'log-view-message-re)
(if (eq vc-log-view-type 'short)
"^ *\\([0-9.]+\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?"
@@ -1319,7 +1319,8 @@ stream. Standard error output is discarded."
((string-match "\\`annotate:" string)
(completion-table-with-context
(substring string 0 (match-end 0))
- (apply-partially #'completion-table-with-terminator '(":" . "\\`a\\`")
+ (apply-partially #'completion-table-with-terminator
+ (cons ":" regexp-unmatchable)
#'completion-file-name-table)
(substring string (match-end 0)) pred action))
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 192e6cf68f6..61c13026cc5 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1087,7 +1087,7 @@ If LIMIT is a revision string, use it as an end-revision."
(define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View"
(require 'add-log) ;; We need the faces add-log.
;; Don't have file markers, so use impossible regexp.
- (set (make-local-variable 'log-view-file-re) "\\`a\\`")
+ (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-message-re)
(if (not (eq vc-log-view-type 'long))
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index d3f132dae70..876d824ceac 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -444,7 +444,7 @@ If LIMIT is non-nil, show no more than this many entries."
(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View"
(require 'add-log) ;; we need the add-log faces
- (set (make-local-variable 'log-view-file-re) "\\`a\\`")
+ (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-message-re)
(if (eq vc-log-view-type 'short)
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index f0b12489c1b..91cc28021cf 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -240,7 +240,7 @@ If LIMIT is non-nil, show no more than this many entries."
(define-derived-mode vc-mtn-log-view-mode log-view-mode "Mtn-Log-View"
;; Don't match anything.
- (set (make-local-variable 'log-view-file-re) "\\`a\\`")
+ (set (make-local-variable 'log-view-file-re) regexp-unmatchable)
(set (make-local-variable 'log-view-per-file-logs) nil)
;; TODO: Use a more precise regexp than "[ |/]+" to avoid false positives
;; in the ChangeLog text.