[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 6938a2ddd2 2/2: Accept more wide function signatures in docstring
From: |
Stefan Kangas |
Subject: |
master 6938a2ddd2 2/2: Accept more wide function signatures in docstrings |
Date: |
Fri, 16 Sep 2022 16:29:39 -0400 (EDT) |
branch: master
commit 6938a2ddd2d9861a0f04e79d05ba976bdf91cc8c
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
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.
---
lisp/emacs-lisp/bytecomp.el | 2 +-
.../warn-wide-docstring-ignore-function-signature.el | 4 ++++
test/lisp/emacs-lisp/bytecomp-tests.el | 4 ++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 48929e62bd..3b3f7bb619 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -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
index 0000000000..e83f516e58
--- /dev/null
+++
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el
@@ -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)")
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el
b/test/lisp/emacs-lisp/bytecomp-tests.el
index bc9f8d802a..1ca44dc7a4 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -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)