(defcustom checkdoc-minor-mode-string " CDoc"
"String to display in mode line when Checkdoc mode is enabled; nil for none."
:type '(choice string (const :tag "None" nil))
- :group 'checkdoc
:version "23.1")
(defcustom checkdoc-autofix-flag 'semiautomatic
is `semiautomatic' or any other value, then simple fixes are made
without asking, and complex changes are made by asking the user first.
The value `never' is the same as nil, never ask or change anything."
- :group 'checkdoc
:type '(choice (const automatic)
(const query)
(const never)
"Non-nil means to \"bounce\" to auto-fix locations.
Setting this to nil will silently make fixes that require no user
interaction. See `checkdoc-autofix-flag' for auto-fixing details."
- :group 'checkdoc
:type 'boolean)
(defcustom checkdoc-force-docstrings-flag t
Style guide dictates that interactive functions MUST have documentation,
and that it's good but not required practice to make non user visible items
have doc strings."
- :group 'checkdoc
:type 'boolean)
-;;;###autoload(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp)
+;;;###autoload(put 'checkdoc-force-docstrings-flag 'safe-local-variable #'booleanp)
(defcustom checkdoc-force-history-flag nil
"Non-nil means that files should have a History section or ChangeLog file.
This helps document the evolution of, and recent changes to, the package."
- :group 'checkdoc
:type 'boolean)
-;;;###autoload(put 'checkdoc-force-history-flag 'safe-local-variable 'booleanp)
+;;;###autoload(put 'checkdoc-force-history-flag 'safe-local-variable #'booleanp)
(defcustom checkdoc-permit-comma-termination-flag nil
"Non-nil means the first line of a docstring may end with a comma.
there is a substantial caveat to the one-line description -- the comma
should be used when the first part could stand alone as a sentence, but
it indicates that a modifying clause follows."
- :group 'checkdoc
:type 'boolean)
-;;;###autoload(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable 'booleanp)
+;;;###autoload(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable #'booleanp)
(defcustom checkdoc-spellcheck-documentation-flag nil
"Non-nil means run Ispell on text based on value.
buffer - Spell-check when style checking the whole buffer
interactive - Spell-check during any interactive check.
t - Always spell-check"
- :group 'checkdoc
:type '(choice (const nil)
(const defun)
(const buffer)
(const interactive)
(const t)))
+;;;###autoload(put 'checkdoc-spellcheck-documentation-flag 'safe-local-variable #'booleanp)
(defvar checkdoc-ispell-lisp-words
'("alist" "emacs" "etags" "keymap" "paren" "regexp" "sexp" "xemacs")
"List of words that are correct when spell-checking Lisp documentation.")
+;;;###autoload(put 'checkdoc-ispell-list-words 'safe-local-variable #'checkdoc-list-of-strings-p)
(defcustom checkdoc-max-keyref-before-warn 10
"The number of \\ [command-to-keystroke] tokens allowed in a doc string.
Any more than this and a warning is generated suggesting that the construct
\\ {keymap} be used instead."
- :group 'checkdoc
:type 'integer)
(defcustom checkdoc-arguments-in-order-flag t
appear in the proper form in the documentation, not that they are in
the same order as they appear in the argument list. No mention is
made in the style guide relating to order."
- :group 'checkdoc
:type 'boolean)
-;;;###autoload(put 'checkdoc-arguments-in-order-flag 'safe-local-variable 'booleanp)
+;;;###autoload(put 'checkdoc-arguments-in-order-flag 'safe-local-variable #'booleanp)
(define-obsolete-variable-alias 'checkdoc-style-hooks
'checkdoc-style-functions "24.3")
"Non-nil means to attempt to check the voice of the doc string.
This check keys off some words which are commonly misused. See the
variable `checkdoc-common-verbs-wrong-voice' if you wish to add your own."
- :group 'checkdoc
:type 'boolean)
+;;;###autoload(put 'checkdoc-verb-check-experimental-flag 'safe-local-variable #'booleanp)
(defvar checkdoc-generate-compile-warnings-flag nil
"Non-nil means generate warnings in a buffer for browsing.
"A list of symbol names (strings) which also happen to make good words.
These words are ignored when unquoted symbols are searched for.
This should be set in an Emacs Lisp file's local variables."
- :group 'checkdoc
:type '(repeat (symbol :tag "Word")))
-;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable 'checkdoc-list-of-strings-p)
+;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p)
;;;###autoload
(defun checkdoc-list-of-strings-p (obj)
;; this is a function so it might be shared by checkdoc-proper-noun-list
;; and/or checkdoc-ispell-lisp-words in the future
(and (listp obj)
- (not (memq nil (mapcar 'stringp obj)))))
+ (not (memq nil (mapcar #'stringp obj)))))
(defvar checkdoc-proper-noun-list
'("ispell" "xemacs" "emacs" "lisp")
(regexp-opt checkdoc-proper-noun-list t)
"\\(\\_>\\|[.!?][ \t\n\"]\\)")
"Regular expression derived from `checkdoc-proper-noun-regexp'.")
+;;;###autoload(put 'checkdoc-proper-noun-regexp 'safe-local-variable 'stringp)
(defvar checkdoc-common-verbs-regexp nil
"Regular expression derived from `checkdoc-common-verbs-regexp'.")
+;;;###autoload(put 'checkdoc-common-verbs-regexp 'safe-local-variable 'stringp)
(defvar checkdoc-common-verbs-wrong-voice
'(("adds" . "add")
;;; Compatibility
;;
(defalias 'checkdoc-make-overlay
- (if (featurep 'xemacs) 'make-extent 'make-overlay))
+ (if (featurep 'xemacs) #'make-extent #'make-overlay))
(defalias 'checkdoc-overlay-put
- (if (featurep 'xemacs) 'set-extent-property 'overlay-put))
+ (if (featurep 'xemacs) #'set-extent-property #'overlay-put))
(defalias 'checkdoc-delete-overlay
- (if (featurep 'xemacs) 'delete-extent 'delete-overlay))
+ (if (featurep 'xemacs) #'delete-extent #'delete-overlay))
(defalias 'checkdoc-overlay-start
- (if (featurep 'xemacs) 'extent-start 'overlay-start))
+ (if (featurep 'xemacs) #'extent-start #'overlay-start))
(defalias 'checkdoc-overlay-end
- (if (featurep 'xemacs) 'extent-end 'overlay-end))
+ (if (featurep 'xemacs) #'extent-end #'overlay-end))
(defalias 'checkdoc-mode-line-update
- (if (featurep 'xemacs) 'redraw-modeline 'force-mode-line-update))
+ (if (featurep 'xemacs) #'redraw-modeline #'force-mode-line-update))
(defalias 'checkdoc-char=
- (if (featurep 'xemacs) 'char= '=))
+ (if (featurep 'xemacs) #'char= #'=))
;;; User level commands
;;
;; Due to a design flaw, this will never spell check
;; docstrings.
(checkdoc-interactive-loop start-here showstatus
- 'checkdoc-next-error)
+ #'checkdoc-next-error)
;; This is a workaround to perform spell checking.
(checkdoc-interactive-ispell-loop start-here))))
(prog1
;; Due to a design flaw, this will never spell check messages.
(checkdoc-interactive-loop start-here showstatus
- 'checkdoc-next-message-error)
+ #'checkdoc-next-message-error)
;; This is a workaround to perform spell checking.
(checkdoc-message-interactive-ispell-loop start-here))))
(goto-char (cdr (car err-list)))
;; `automatic-then-never' tells the autofix function
;; to only allow one fix to be automatic. The autofix
- ;; function will then set the flag to 'never, allowing
+ ;; function will then set the flag to `never', allowing
;; the checker to return a different error.
(let ((checkdoc-autofix-flag 'automatic-then-never)
(fixed nil))
documentation is checked. If there is a documentation error, then the display
of what was evaluated will be overwritten by the diagnostic message."
(interactive)
- (call-interactively 'eval-defun)
+ (call-interactively #'eval-defun)
(checkdoc-defun))
;;;###autoload
;;
;;;###autoload
-(defun checkdoc-ispell (&optional take-notes)
+(defun checkdoc-ispell ()
"Check the style and spelling of everything interactively.
Calls `checkdoc' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc'"
+Prefix argument is the same as for `checkdoc'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc nil current-prefix-arg)))
+ (call-interactively #'checkdoc nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-current-buffer (&optional take-notes)
+(defun checkdoc-ispell-current-buffer ()
"Check the style and spelling of the current buffer.
Calls `checkdoc-current-buffer' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-current-buffer'"
+Prefix argument is the same as for `checkdoc-current-buffer'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-current-buffer nil current-prefix-arg)))
+ (call-interactively #'checkdoc-current-buffer nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-interactive (&optional take-notes)
+(defun checkdoc-ispell-interactive ()
"Check the style and spelling of the current buffer interactively.
Calls `checkdoc-interactive' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-interactive'"
+Prefix argument is the same as for `checkdoc-interactive'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-interactive nil current-prefix-arg)))
+ (call-interactively #'checkdoc-interactive nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-message-interactive (&optional take-notes)
+(defun checkdoc-ispell-message-interactive ()
"Check the style and spelling of message text interactively.
Calls `checkdoc-message-interactive' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-message-interactive'"
+Prefix argument is the same as for `checkdoc-message-interactive'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-message-interactive nil current-prefix-arg)))
+ (call-interactively #'checkdoc-message-interactive
+ nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-message-text (&optional take-notes)
+(defun checkdoc-ispell-message-text ()
"Check the style and spelling of message text interactively.
Calls `checkdoc-message-text' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-message-text'"
+Prefix argument is the same as for `checkdoc-message-text'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-message-text nil current-prefix-arg)))
+ (call-interactively #'checkdoc-message-text nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-start (&optional take-notes)
+(defun checkdoc-ispell-start ()
"Check the style and spelling of the current buffer.
Calls `checkdoc-start' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-start'"
+Prefix argument is the same as for `checkdoc-start'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-start nil current-prefix-arg)))
+ (call-interactively #'checkdoc-start nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-continue (&optional take-notes)
+(defun checkdoc-ispell-continue ()
"Check the style and spelling of the current buffer after point.
Calls `checkdoc-continue' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-continue'"
+Prefix argument is the same as for `checkdoc-continue'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-continue nil current-prefix-arg)))
+ (call-interactively #'checkdoc-continue nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-comments (&optional take-notes)
+(defun checkdoc-ispell-comments ()
"Check the style and spelling of the current buffer's comments.
Calls `checkdoc-comments' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-comments'"
+Prefix argument is the same as for `checkdoc-comments'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-comments nil current-prefix-arg)))
+ (call-interactively #'checkdoc-comments nil current-prefix-arg)))
;;;###autoload
-(defun checkdoc-ispell-defun (&optional take-notes)
+(defun checkdoc-ispell-defun ()
"Check the style and spelling of the current defun with Ispell.
Calls `checkdoc-defun' with spell-checking turned on.
-Prefix argument TAKE-NOTES is the same as for `checkdoc-defun'"
+Prefix argument is the same as for `checkdoc-defun'"
(interactive)
(let ((checkdoc-spellcheck-documentation-flag t))
- (call-interactively 'checkdoc-defun nil current-prefix-arg)))
+ (call-interactively #'checkdoc-defun nil current-prefix-arg)))
;;; Error Management
;;
(defsubst checkdoc-run-hooks (hookvar &rest args)
"Run hooks in HOOKVAR with ARGS."
(if (fboundp 'run-hook-with-args-until-success)
- (apply 'run-hook-with-args-until-success hookvar args)
+ (apply #'run-hook-with-args-until-success hookvar args)
;; This method was similar to above. We ignore the warning
;; since we will use the above for future Emacs versions
- (apply 'run-hook-with-args hookvar args)))
+ (apply #'run-hook-with-args hookvar args)))
(defsubst checkdoc-create-common-verbs-regexp ()
"Rebuild the contents of `checkdoc-common-verbs-regexp'."
nil
(require 'lisp-mnt)
;; Old XEmacs don't have `lm-commentary-mark'
- (if (and (not (fboundp 'lm-commentary-mark)) (boundp 'lm-commentary))
- (defalias 'lm-commentary-mark 'lm-commentary)))
+ (if (and (not (fboundp 'lm-commentary-mark)) (fboundp 'lm-commentary))
+ (defalias 'lm-commentary-mark #'lm-commentary)))
(save-excursion
(let* ((f1 (file-name-nondirectory (buffer-file-name)))
(fn (file-name-sans-extension f1))
(if (or (not checkdoc-force-history-flag)
(file-exists-p "ChangeLog")
(file-exists-p "../ChangeLog")
- (let ((fn 'lm-history-mark)) ;bestill byte-compiler
- (and (fboundp fn) (funcall fn))))
+ (and (fboundp 'lm-history-mark) (funcall #'lm-history-mark)))
nil
(progn
(goto-char (or (lm-commentary-mark) (point-min)))
(define-derived-mode checkdoc-output-mode compilation-mode "Checkdoc"
"Set up the major mode for the buffer containing the list of errors."
- (set (make-local-variable 'compilation-error-regexp-alist)
- checkdoc-output-error-regex-alist)
- (set (make-local-variable 'compilation-mode-font-lock-keywords)
- checkdoc-output-font-lock-keywords))
+ (setq-local compilation-error-regexp-alist
+ checkdoc-output-error-regex-alist)
+ (setq-local compilation-mode-font-lock-keywords
+ checkdoc-output-font-lock-keywords))
(defun checkdoc-buffer-label ()
"The name to use for a checkdoc buffer in the error list."
(with-current-buffer (get-buffer checkdoc-diagnostic-buffer)
(goto-char (point-max))
(let ((inhibit-read-only t))
- (apply 'insert text)))))
+ (apply #'insert text)))))
(defun checkdoc-show-diagnostics ()
"Display the checkdoc diagnostic buffer in a temporary window."