summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/checkdoc.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2022-07-04 14:12:24 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2022-07-04 14:56:11 +0200
commit544361d37f3877b2f10c362936a283f4a0b2fa71 (patch)
treea006de13e1f07efb57993c10823469b0a5d70572 /lisp/emacs-lisp/checkdoc.el
parent65df97f361ace8b7f272d050b56389eeb1a08b03 (diff)
downloademacs-544361d37f3877b2f10c362936a283f4a0b2fa71.tar.gz
emacs-544361d37f3877b2f10c362936a283f4a0b2fa71.tar.bz2
emacs-544361d37f3877b2f10c362936a283f4a0b2fa71.zip
Replace lisp-mode-symbol-regexp with (rx lisp-mode-symbol)
This is shorter, simplifies use inside rx expressions, and removes need for eval-when-compile elsewhere (for later exploitation). * lisp/emacs-lisp/lisp-mode.el (lisp-mode-symbol): New rx-define. (lisp-mode-symbol-regexp): Redefine using lisp-mode-symbol. (lisp-imenu-generic-expression, lisp--el-match-keyword) (lisp-fdefs, lisp-string-in-doc-position-p): * lisp/emacs-lisp/checkdoc.el (checkdoc--error-bad-format-p): * lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands): Use lisp-mode-symbol instead of lisp-mode-symbol-regexp.
Diffstat (limited to 'lisp/emacs-lisp/checkdoc.el')
-rw-r--r--lisp/emacs-lisp/checkdoc.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 2cb5fa120e0..2c9adfe2d27 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -165,7 +165,7 @@
(require 'cl-lib)
(require 'help-mode) ;; for help-xref-info-regexp
(require 'thingatpt) ;; for handy thing-at-point-looking-at
-(require 'lisp-mode) ;; for lisp-mode-symbol-regexp
+(require 'lisp-mode) ;; for lisp-mode-symbol regexp
(eval-when-compile (require 'dired)) ;; for dired-map-over-marks
(require 'lisp-mnt)
@@ -2604,13 +2604,13 @@ The correct format is \"Foo\" or \"some-symbol: Foo\". See also
(unless (let ((case-fold-search nil))
(looking-at (rx (or upper-case "%s"))))
;; A defined Lisp symbol is always okay.
- (unless (and (looking-at (rx (group (regexp lisp-mode-symbol-regexp))))
+ (unless (and (looking-at (rx (group lisp-mode-symbol)))
(or (fboundp (intern (match-string 1)))
(boundp (intern (match-string 1)))))
;; Other Lisp symbols are sometimes okay.
(rx-let ((c (? "\\\n"))) ; `c' is for a continued line
(let ((case-fold-search nil)
- (some-symbol (rx (regexp lisp-mode-symbol-regexp)
+ (some-symbol (rx lisp-mode-symbol
c ":" c (+ (any " \t\n"))))
(lowercase-str (rx c (group (any "a-z") (+ wordchar)))))
(if (looking-at some-symbol)