]> git.eshelyaron.com Git - emacs.git/commitdiff
Accept more wide function signatures in docstrings
authorStefan Kangas <stefankangas@gmail.com>
Fri, 16 Sep 2022 20:24:20 +0000 (22:24 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Fri, 16 Sep 2022 20:28:46 +0000 (22:28 +0200)
* 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.

lisp/emacs-lisp/bytecomp.el
test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el [new file with mode: 0644]
test/lisp/emacs-lisp/bytecomp-tests.el

index 48929e62bdfb0996039feff340bdfbfbb02df6ac..3b3f7bb6190810e1a6654351dcdc924f3af0b29d 100644 (file)
@@ -1705,7 +1705,7 @@ URLs."
               (+ " " (or
                       ;; Arguments.
                       (+ (or (syntax symbol)
-                             (any word "-/:[]&=().?^\\#'")))
+                             (any word "-/:[]&=()<>.,?^\\#*'\"")))
                       ;; Argument that is a list.
                       (seq "(" (* (not ")")) ")")))
               ")")))
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el
new file mode 100644 (file)
index 0000000..e83f516
--- /dev/null
@@ -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)")
index bc9f8d802a6c5172f19a063ea68f4fceb515e498..1ca44dc7a488a0aa85b2e0bb9737ab2adbcf06d8 100644 (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)