aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-09-16 22:24:20 +0200
committerStefan Kangas2022-09-16 22:28:46 +0200
commit6938a2ddd2d9861a0f04e79d05ba976bdf91cc8c (patch)
treef9127391fe41200867cf71ca3aa7f057d8831ad3
parentaaf39c38784198353b61bf6086f48a689b199f0d (diff)
downloademacs-6938a2ddd2d9861a0f04e79d05ba976bdf91cc8c.tar.gz
emacs-6938a2ddd2d9861a0f04e79d05ba976bdf91cc8c.zip
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.
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el4
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el4
3 files changed, 9 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 48929e62bdf..3b3f7bb6190 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1705,7 +1705,7 @@ URLs."
1705 (+ " " (or 1705 (+ " " (or
1706 ;; Arguments. 1706 ;; Arguments.
1707 (+ (or (syntax symbol) 1707 (+ (or (syntax symbol)
1708 (any word "-/:[]&=().?^\\#'"))) 1708 (any word "-/:[]&=()<>.,?^\\#*'\"")))
1709 ;; Argument that is a list. 1709 ;; Argument that is a list.
1710 (seq "(" (* (not ")")) ")"))) 1710 (seq "(" (* (not ")")) ")")))
1711 ")"))) 1711 ")")))
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
index 00000000000..e83f516e58c
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el
@@ -0,0 +1,4 @@
1;;; -*- lexical-binding: t -*-
2(defun foo-bar ()
3 "This should not warn:
4(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)")
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index bc9f8d802a6..1ca44dc7a48 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -1007,6 +1007,10 @@ byte-compiled. Run with dynamic binding."
1007 "defvar .foo-bar. docstring wider than .* characters" 'reverse) 1007 "defvar .foo-bar. docstring wider than .* characters" 'reverse)
1008 1008
1009(bytecomp--define-warning-file-test 1009(bytecomp--define-warning-file-test
1010 "warn-wide-docstring-ignore-function-signature.el"
1011 "defvar .foo-bar. docstring wider than .* characters" 'reverse)
1012
1013(bytecomp--define-warning-file-test
1010 "warn-wide-docstring-ignore-override.el" 1014 "warn-wide-docstring-ignore-override.el"
1011 "defvar .foo-bar. docstring wider than .* characters" 'reverse) 1015 "defvar .foo-bar. docstring wider than .* characters" 'reverse)
1012 1016