Avoid false positives in bytecomp docstring width warning
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Ignore more function argument lists. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests-byte-compile--wide-docstring-p): New test.
This commit is contained in:
parent
44da8dd3e4
commit
f3a6fe2c7d
2 changed files with 34 additions and 2 deletions
|
@ -1649,14 +1649,22 @@ URLs."
|
|||
(replace-regexp-in-string
|
||||
(rx (or
|
||||
;; Ignore some URLs.
|
||||
(seq "http" (? "s") "://" (* anychar))
|
||||
(seq "http" (? "s") "://" (* nonl))
|
||||
;; Ignore these `substitute-command-keys' substitutions.
|
||||
(seq "\\" (or "="
|
||||
(seq "<" (* (not ">")) ">")
|
||||
(seq "{" (* (not "}")) "}")))
|
||||
;; Ignore the function signature that's stashed at the end of
|
||||
;; the doc string (in some circumstances).
|
||||
(seq bol "(fn (" (* nonl))))
|
||||
(seq bol "(" (+ (any word "-/:[]&"))
|
||||
;; One or more arguments.
|
||||
(+ " " (or
|
||||
;; Arguments.
|
||||
(+ (or (syntax symbol)
|
||||
(any word "-/:[]&=().?^\\#'")))
|
||||
;; Argument that is a list.
|
||||
(seq "(" (* (not ")")) ")")))
|
||||
")")))
|
||||
""
|
||||
;; Heuristic: assume these substitutions are of some length N.
|
||||
(replace-regexp-in-string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue