Accept more wide function signatures in docstrings

* test/lisp/emacs-lisp/bytecomp-tests.el
("warn-wide-docstring-ignore-function-signature.el"): New test.
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p):
Make regexp more allowing to silence warning.
* test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el:
New file.
This commit is contained in:
Stefan Kangas 2022-09-16 22:24:20 +02:00
parent aaf39c3878
commit 6938a2ddd2
3 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,4 @@
;;; -*- lexical-binding: t -*-
(defun foo-bar ()
"This should not warn:
(fn COMMAND &rest ARGS &key (MARGIN (rx bol (+ \" \"))) (ARGUMENT (rx \"-\" (+ (any \"-\" alnum)) (32 \"=\"))) (METAVAR (rx (32 \" \") (or (+ (any alnum \"_-\")) (seq \"[\" (+? nonl) \"]\") (seq \"<\" (+? nonl) \">\") (seq \"{\" (+? nonl) \"}\")))) (SEPARATOR (rx \", \" symbol-start)) (DESCRIPTION (rx (* nonl) (* \"\\=\\n\" (>= 9 \" \") (* nonl)))) NARROW-START NARROW-END)")

View file

@ -1006,6 +1006,10 @@ byte-compiled. Run with dynamic binding."
"warn-wide-docstring-ignore-fill-column.el"
"defvar .foo-bar. docstring wider than .* characters" 'reverse)
(bytecomp--define-warning-file-test
"warn-wide-docstring-ignore-function-signature.el"
"defvar .foo-bar. docstring wider than .* characters" 'reverse)
(bytecomp--define-warning-file-test
"warn-wide-docstring-ignore-override.el"
"defvar .foo-bar. docstring wider than .* characters" 'reverse)