summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/checkdoc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/checkdoc.el')
-rw-r--r--lisp/emacs-lisp/checkdoc.el31
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 75aefdc7ba0..00cc7777e1a 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -160,9 +160,6 @@
;; not specifically docstring related. Would this even be useful?
;;; Code:
-(defvar checkdoc-version "0.6.2"
- "Release version of checkdoc you are currently running.")
-(make-obsolete-variable 'checkdoc-version nil "28.1")
(require 'cl-lib)
(require 'help-mode) ;; for help-xref-info-regexp
@@ -931,16 +928,20 @@ don't move point."
;; Don't bug out if the file is empty (or a
;; definition ends prematurely.
(end-of-file)))
- (`(,(or 'defun 'defvar 'defcustom 'defmacro 'defconst 'defsubst 'defadvice
- 'cl-defun 'cl-defgeneric 'cl-defmethod 'cl-defmacro)
+ (`(,(and (pred symbolp) def
+ (let (and doc (guard doc)) (function-get def 'doc-string-elt)))
,(pred symbolp)
;; Require an initializer, i.e. ignore single-argument `defvar'
;; forms, which never have a doc string.
,_ . ,_)
(down-list)
- ;; Skip over function or macro name, symbol to be defined, and
- ;; initializer or argument list.
- (forward-sexp 3)
+ ;; Skip over function or macro name.
+ (forward-sexp 1)
+ ;; And now skip until the docstring.
+ (forward-sexp (1- ; We already skipped the function or macro name.
+ (cond
+ ((numberp doc) doc)
+ ((functionp doc) (funcall doc)))))
(skip-chars-forward " \n\t")
t)))
@@ -1241,7 +1242,7 @@ bound to \\<checkdoc-minor-mode-map>\\[checkdoc-eval-defun] and `checkdoc-eval-c
checking of documentation strings.
\\{checkdoc-minor-mode-map}"
- nil checkdoc-minor-mode-string nil
+ :lighter checkdoc-minor-mode-string
:group 'checkdoc)
;;; Subst utils
@@ -2130,8 +2131,8 @@ buffer, otherwise stop after the first error."
(user-error "No spellchecker installed: check the variable `ispell-program-name'"))
(save-excursion
(skip-chars-forward "^a-zA-Z")
- (let (word sym case-fold-search err word-beginning word-end)
- (while (and (not err) (< (point) end))
+ (let (word sym case-fold-search word-beginning word-end) ;; err
+ (while (and (< (point) end)) ;; (not err)
(if (save-excursion (forward-char -1) (looking-at "[('`]"))
;; Skip lists describing meta-syntax, or bound variables
(forward-sexp 1)
@@ -2163,7 +2164,7 @@ buffer, otherwise stop after the first error."
(sit-for 0)
(message "Continuing..."))))))))
(skip-chars-forward "^a-zA-Z"))
- err))))
+ nil)))) ;; err
;;; Rogue space checking engine
;;
@@ -2705,6 +2706,12 @@ function called to create the messages."
(custom-add-option 'emacs-lisp-mode-hook 'checkdoc-minor-mode)
+;; Obsolete
+
+(defvar checkdoc-version "0.6.2"
+ "Release version of checkdoc you are currently running.")
+(make-obsolete-variable 'checkdoc-version 'emacs-version "28.1")
+
(provide 'checkdoc)
;;; checkdoc.el ends here