summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-defs.el6
-rw-r--r--lisp/progmodes/cc-engine.el10
-rw-r--r--lisp/progmodes/cc-fonts.el4
-rw-r--r--lisp/progmodes/cc-langs.el26
-rw-r--r--lisp/progmodes/cc-mode.el4
-rw-r--r--lisp/progmodes/cc-vars.el8
-rw-r--r--lisp/progmodes/grep.el3
-rw-r--r--lisp/progmodes/octave.el2
8 files changed, 33 insertions, 30 deletions
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index cd4ed6b352e..d20e3ef32d9 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -81,7 +81,7 @@
(progn
(require 'font-lock)
(let (font-lock-keywords)
- (font-lock-compile-keywords '("a\\`")) ; doesn't match anything.
+ (font-lock-compile-keywords (list regexp-unmatchable))
font-lock-keywords))))
@@ -1890,8 +1890,8 @@ when it's needed. The default is the current language taken from
;; Produce a regexp that doesn't match anything.
(if adorn
- "\\(a\\`\\)"
- "a\\`")))
+ (concat "\\(" regexp-unmatchable "\\)")
+ regexp-unmatchable)))
(put 'c-make-keywords-re 'lisp-indent-function 1)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index ed8310d0e67..41bab270daa 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -907,7 +907,7 @@ comment at the start of cc-engine.el for more info."
stack
;; Regexp which matches "for", "if", etc.
(cond-key (or c-opt-block-stmt-key
- "a\\`")) ; Doesn't match anything.
+ regexp-unmatchable))
;; Return value.
(ret 'same)
;; Positions of the last three sexps or bounds we've stopped at.
@@ -7646,7 +7646,9 @@ comment at the start of cc-engine.el for more info."
(progn
(c-forward-syntactic-ws)
(when (or (and c-record-type-identifiers all-types)
- (not (equal c-inside-<>-type-key "\\(a\\`\\)")))
+ (not (equal c-inside-<>-type-key
+ (concat
+ "\\(" regexp-unmatchable "\\)"))))
(c-forward-syntactic-ws)
(cond
((eq (char-after) ??)
@@ -9253,7 +9255,7 @@ This function might do hidden buffer changes."
;; Skip over type decl prefix operators. (Note similar code in
;; `c-forward-declarator'.)
(if (and c-recognize-typeless-decls
- (equal c-type-decl-prefix-key "a\\`")) ; Regexp which doesn't match
+ (equal c-type-decl-prefix-key regexp-unmatchable))
(when (eq (char-after) ?\()
(progn
(setq paren-depth (1+ paren-depth))
@@ -10886,7 +10888,7 @@ comment at the start of cc-engine.el for more info."
;; legal because it's part of a "compound keyword" like
;; "enum class". Of course, if c-after-brace-list-key
;; is nil, we can skip the test.
- (or (equal c-after-brace-list-key "a\\`") ; Regexp which doesn't match
+ (or (equal c-after-brace-list-key regexp-unmatchable)
(save-match-data
(save-excursion
(not
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 5f09be60a67..b3a9dd480b8 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -2580,14 +2580,14 @@ need for `pike-font-lock-extra-types'.")
;;; Doc comments.
-(defvar c-doc-line-join-re "a\\`")
+(defvar c-doc-line-join-re regexp-unmatchable)
;; Matches a join of two lines in a doc comment.
;; This should not be changed directly, but instead set by
;; `c-setup-doc-comment-style'. This variable is used in `c-find-decl-spots'
;; in (e.g.) autodoc style comments to bridge the gap between a "@\n" at an
;; EOL and the token following "//!" on the next line.
-(defvar c-doc-bright-comment-start-re "a\\`")
+(defvar c-doc-bright-comment-start-re regexp-unmatchable)
;; Matches the start of a "bright" comment, one whose contents may be
;; fontified by, e.g., `c-font-lock-declarations'.
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 30da10a6c03..9d2f689e584 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -945,7 +945,7 @@ file name in angle brackets or quotes."
(c-make-keywords-re 'appendable
(c-lang-const c-cpp-include-directives))
"[ \t]*")
- "a\\`")) ; Doesn't match anything
+ regexp-unmatchable))
(c-lang-defvar c-cpp-include-key (c-lang-const c-cpp-include-key))
(c-lang-defconst c-opt-cpp-macro-define
@@ -1331,7 +1331,7 @@ operators."
(c--set-difference (c-lang-const c-assignment-operators)
'("=")
:test 'string-equal)))
- "a\\`")) ; Doesn't match anything.
+ regexp-unmatchable))
(c-lang-defvar c-assignment-op-regexp
(c-lang-const c-assignment-op-regexp))
@@ -1554,7 +1554,7 @@ properly."
;; language)
t (if (c-lang-const c-block-comment-ender)
(regexp-quote (c-lang-const c-block-comment-ender))
- "a\\`")) ; Doesn't match anything.
+ regexp-unmatchable))
(c-lang-defvar c-block-comment-ender-regexp
(c-lang-const c-block-comment-ender-regexp))
@@ -1565,7 +1565,7 @@ properly."
;; `font-lock-comment-delimiter-face'.
t (if (c-lang-const c-block-comment-ender)
(concat "[ \t]*" (c-lang-const c-block-comment-ender-regexp))
- "a\\`")) ; Doesn't match anything.
+ regexp-unmatchable))
(c-lang-setvar font-lock-comment-end-skip
(c-lang-const c-font-lock-comment-end-skip))
@@ -1584,7 +1584,7 @@ properly."
;; language)
t (if (c-lang-const c-block-comment-starter)
(regexp-quote (c-lang-const c-block-comment-starter))
- "a\\`")) ; Doesn't match anything.
+ regexp-unmatchable))
(c-lang-defvar c-block-comment-start-regexp
(c-lang-const c-block-comment-start-regexp))
@@ -1593,7 +1593,7 @@ properly."
;; language; it does in all 7 CC Mode languages).
t (if (c-lang-const c-line-comment-starter)
(regexp-quote (c-lang-const c-line-comment-starter))
- "a\\`")) ; Doesn't match anything.
+ regexp-unmatchable))
(c-lang-defvar c-line-comment-start-regexp
(c-lang-const c-line-comment-start-regexp))
@@ -1628,7 +1628,7 @@ starter."
(c-lang-defconst c-doc-comment-start-regexp
"Regexp to match the start of documentation comments."
- t "a\\`" ; Doesn't match anything.
+ t regexp-unmatchable
;; From font-lock.el: `doxygen' uses /*! while others use /**.
(c c++ objc) "/\\*[*!]"
java "/\\*\\*"
@@ -3112,7 +3112,7 @@ Note that Java specific rules are currently applied to tell this from
"Regexp matching a keyword that is followed by a colon, where
the whole construct can precede a declaration.
E.g. \"public:\" in C++."
- t "a\\`" ; Doesn't match anything.
+ t regexp-unmatchable
c++ (c-make-keywords-re t (c-lang-const c-protection-kwds)))
(c-lang-defvar c-decl-start-colon-kwd-re
(c-lang-const c-decl-start-colon-kwd-re))
@@ -3309,7 +3309,7 @@ Identifier syntax is in effect when this is matched \(see
t (if (c-lang-const c-type-modifier-kwds)
(concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>")
;; Default to a regexp that never matches.
- "a\\`")
+ regexp-unmatchable)
;; Check that there's no "=" afterwards to avoid matching tokens
;; like "*=".
(c objc) (concat "\\("
@@ -3347,7 +3347,7 @@ that might precede the identifier in a declaration, e.g. the
as the end of the operator. Identifier syntax is in effect when
this is matched \(see `c-identifier-syntax-table')."
t ;; Default to a regexp that never matches.
- "a\\`"
+ regexp-unmatchable
;; Check that there's no "=" afterwards to avoid matching tokens
;; like "*=".
(c objc) (concat "\\(\\*\\)"
@@ -3506,7 +3506,7 @@ list."
(c-lang-defconst c-pre-id-bracelist-key
"A regexp matching tokens which, preceding an identifier, signify a bracelist.
"
- t "a\\`" ; Doesn't match anything.
+ t regexp-unmatchable
c++ "new\\([^[:alnum:]_$]\\|$\\)\\|&&?\\(\\S.\\|$\\)")
(c-lang-defvar c-pre-id-bracelist-key (c-lang-const c-pre-id-bracelist-key))
@@ -3562,7 +3562,7 @@ the invalidity of the putative template construct."
;; before the '{' of the enum list, to avoid searching too far.
"[^][{};/#=]*"
"{")
- "a\\`")) ; Doesn't match anything.
+ regexp-unmatchable))
(c-lang-defvar c-enum-clause-introduction-re
(c-lang-const c-enum-clause-introduction-re))
@@ -3703,7 +3703,7 @@ Only used if `c-recognize-colon-labels' is set."
"Regexp matching things that can't occur two symbols before a colon in
a label construct. This catches C++'s inheritance construct \"class foo
: bar\". Only used if `c-recognize-colon-labels' is set."
- t "a\\`" ; Doesn't match anything.
+ t regexp-unmatchable
c++ (c-make-keywords-re t '("class")))
(c-lang-defvar c-nonlabel-token-2-key (c-lang-const c-nonlabel-token-2-key))
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index bd62fc754ab..e4ff9f019d3 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1825,7 +1825,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
;; by `c-doc-line-join-re'), return the position of the first line of the
;; sequence. Otherwise, return nil. Point has no significance at entry to
;; and exit from this function.
- (when (not (equal c-doc-line-join-re "a\\`"))
+ (when (not (equal c-doc-line-join-re regexp-unmatchable))
(goto-char pos)
(back-to-indentation)
(and (or (looking-at c-comment-start-regexp)
@@ -1842,7 +1842,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
;; marker (as defined by `c-doc-line-join-re), return the position of
;; the BOL at the end of the sequence. Otherwise, return nil. Point has no
;; significance at entry to and exit from this function.
- (when (not (equal c-doc-line-join-re "a\\`"))
+ (when (not (equal c-doc-line-join-re regexp-unmatchable))
(goto-char pos)
(back-to-indentation)
(let ((here (point)))
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 6e8acd4c0dd..b818bced730 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1648,9 +1648,9 @@ white space either before or after the operator, but not both."
:group 'c)
;; Initialize the next two to a regexp which never matches.
-(defvar c-noise-macro-with-parens-name-re "a\\`")
+(defvar c-noise-macro-with-parens-name-re regexp-unmatchable)
(make-variable-buffer-local 'c-noise-macro-with-parens-name-re)
-(defvar c-noise-macro-name-re "a\\`")
+(defvar c-noise-macro-name-re regexp-unmatchable)
(make-variable-buffer-local 'c-noise-macro-name-re)
(defcustom c-noise-macro-names nil
@@ -1682,7 +1682,7 @@ These are recognized by CC Mode only in declarations."
;; Convert `c-noise-macro-names' and `c-noise-macro-with-parens-names' into
;; `c-noise-macro-name-re' and `c-noise-macro-with-parens-name-re'.
(setq c-noise-macro-with-parens-name-re
- (cond ((null c-noise-macro-with-parens-names) "a\\`") ; Never matches.
+ (cond ((null c-noise-macro-with-parens-names) regexp-unmatchable)
((consp c-noise-macro-with-parens-names)
(concat (regexp-opt c-noise-macro-with-parens-names t)
"\\([^[:alnum:]_$]\\|$\\)"))
@@ -1691,7 +1691,7 @@ These are recognized by CC Mode only in declarations."
(t (error "c-make-noise-macro-regexps: \
c-noise-macro-with-parens-names is invalid: %s" c-noise-macro-with-parens-names))))
(setq c-noise-macro-name-re
- (cond ((null c-noise-macro-names) "a\\`") ; Never matches anything.
+ (cond ((null c-noise-macro-names) regexp-unmatchable)
((consp c-noise-macro-names)
(concat (regexp-opt c-noise-macro-names t)
"\\([^[:alnum:]_$]\\|$\\)"))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 85f9078d46d..79178c4346e 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -837,7 +837,8 @@ This function is called from `compilation-filter-hook'."
grep-mode-line-matches)
;; compilation-directory-matcher can't be nil, so we set it to a regexp that
;; can never match.
- (set (make-local-variable 'compilation-directory-matcher) '("\\`a\\`"))
+ (set (make-local-variable 'compilation-directory-matcher)
+ (list regexp-unmatchable))
(set (make-local-variable 'compilation-process-setup-function)
'grep-process-setup)
(set (make-local-variable 'compilation-disable-input) t)
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 52e5fd477f4..8a7e24e5ada 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -1691,7 +1691,7 @@ code line."
(eval-and-compile (require 'help-mode))
;; Don't highlight `EXAMPLE' as elisp symbols by using a regexp that
;; can never match.
- (setq-local help-xref-symbol-regexp "x\\`"))
+ (setq-local help-xref-symbol-regexp regexp-unmatchable))
(defun octave-help (fn)
"Display the documentation of FN."