diff options
author | Andrea Corallo <akrl@sdf.org> | 2021-03-12 16:42:51 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2021-03-12 16:42:51 +0100 |
commit | 82bd6d57d54d4cdb205d921c2476d1dbb17f4188 (patch) | |
tree | fca7c47620f8d246015b85aab8dd91e440847743 /lisp/emacs-lisp/checkdoc.el | |
parent | d9cd55a4f1c3f391b996dfbe77ed24306b37ac9f (diff) | |
parent | a0854f939ce3a1de2c8cbc5e38b106a8df4480f6 (diff) | |
download | emacs-82bd6d57d54d4cdb205d921c2476d1dbb17f4188.tar.gz emacs-82bd6d57d54d4cdb205d921c2476d1dbb17f4188.tar.bz2 emacs-82bd6d57d54d4cdb205d921c2476d1dbb17f4188.zip |
Merge remote-tracking branch 'savannah/master' into native-comp
Diffstat (limited to 'lisp/emacs-lisp/checkdoc.el')
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 213ab43184f..62851660c66 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -931,35 +931,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-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-chars-forward " \n\t") - t) - (`(,'cl-defmethod - ,(pred symbolp) - . ,rest) - (down-list) - (forward-sexp (pcase (car rest) - ;; No qualifier, so skip like we would have skipped in - ;; the first clause of the outer `pcase'. - ((pred listp) 3) - (':extra - ;; Skip the :extra qualifier together with its string too. - ;; Skip any additional qualifier. - (if (memq (nth 2 rest) '(:around :before :after)) - 6 - 5)) - ;; Skip :before, :after or :around qualifier too. - ((or ':around ':before ':after) - 4))) + ;; 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))) @@ -2149,8 +2134,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) @@ -2182,7 +2167,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 ;; |