checkdoc: Don't warn about command substitutions by default
* lisp/emacs-lisp/checkdoc.el (checkdoc-max-keyref-before-warn): Add new valid value nil meaning to never warn about too many command substitutions, and use this value as the default. This is no longer a performance problem on modern machines. (Bug#50599) (checkdoc-this-string-valid-engine): Respect above new valid value nil.
This commit is contained in:
parent
3d1f51382f
commit
0762c7c67f
1 changed files with 20 additions and 15 deletions
|
@ -249,11 +249,18 @@ with these words enabled."
|
||||||
"List of words that are correct when spell-checking Lisp documentation.")
|
"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)
|
;;;###autoload(put 'checkdoc-ispell-list-words 'safe-local-variable #'checkdoc-list-of-strings-p)
|
||||||
|
|
||||||
(defcustom checkdoc-max-keyref-before-warn 10
|
(defcustom checkdoc-max-keyref-before-warn nil
|
||||||
"The number of \\ [command-to-keystroke] tokens allowed in a doc string.
|
"If non-nil, number of \\\\=[command-to-keystroke] tokens allowed in a doc string.
|
||||||
Any more than this and a warning is generated suggesting that the construct
|
Any more than this and a warning is generated suggesting that the construct
|
||||||
\\ {keymap} be used instead."
|
\\\\={keymap} be used instead. If the value is nil, never warn.
|
||||||
:type 'integer)
|
|
||||||
|
It used to not be practical to use `\\\\=[...]' very many times,
|
||||||
|
because display of the documentation string would become slow.
|
||||||
|
This is not an issue on modern machines, unless you have
|
||||||
|
thousands of substitutions."
|
||||||
|
:type '(choice (const nil)
|
||||||
|
integer)
|
||||||
|
:version "28.1")
|
||||||
|
|
||||||
(defcustom checkdoc-arguments-in-order-flag nil
|
(defcustom checkdoc-arguments-in-order-flag nil
|
||||||
"Non-nil means warn if arguments appear out of order.
|
"Non-nil means warn if arguments appear out of order.
|
||||||
|
@ -1543,17 +1550,15 @@ mouse-[0-3]\\)\\)\\>"))
|
||||||
" embedded in doc string. Use \\\\<keymap> & \\\\[function] "
|
" embedded in doc string. Use \\\\<keymap> & \\\\[function] "
|
||||||
"instead")
|
"instead")
|
||||||
(match-beginning 1) (match-end 1) t))))
|
(match-beginning 1) (match-end 1) t))))
|
||||||
;; It is not practical to use `\\[...]' very many times, because
|
;; Optionally warn about too many command substitutions.
|
||||||
;; display of the documentation string will become slow. So use this
|
(when checkdoc-max-keyref-before-warn
|
||||||
;; to describe the most important commands in your major mode, and
|
(save-excursion
|
||||||
;; then use `\\{...}' to display the rest of the mode's keymap.
|
(if (and (re-search-forward "\\\\\\\\\\[\\w+" e t
|
||||||
(save-excursion
|
(1+ checkdoc-max-keyref-before-warn))
|
||||||
(if (and (re-search-forward "\\\\\\\\\\[\\w+" e t
|
(not (re-search-forward "\\\\\\\\{\\w+}" e t)))
|
||||||
(1+ checkdoc-max-keyref-before-warn))
|
(checkdoc-create-error
|
||||||
(not (re-search-forward "\\\\\\\\{\\w+}" e t)))
|
"Too many occurrences of \\[function]. Use \\{keymap} instead"
|
||||||
(checkdoc-create-error
|
s (marker-position e)))))
|
||||||
"Too many occurrences of \\[function]. Use \\{keymap} instead"
|
|
||||||
s (marker-position e))))
|
|
||||||
;; Ambiguous quoted symbol. When a symbol is both bound and fbound,
|
;; Ambiguous quoted symbol. When a symbol is both bound and fbound,
|
||||||
;; and is referred to in documentation, it should be prefixed with
|
;; and is referred to in documentation, it should be prefixed with
|
||||||
;; something to disambiguate it. This check must be before the
|
;; something to disambiguate it. This check must be before the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue