aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDamien Cassou2023-09-12 08:28:37 +0200
committerStefan Kangas2023-09-13 16:34:45 +0200
commit1f7113e68988fa0bcbdeca5ae364cba8d6db3637 (patch)
tree5b71e005c00ba9dae01448ae7e69d4f04780dbb7 /test
parentf045750fa5e94659e96bab85d1d05ddf65a4c557 (diff)
downloademacs-1f7113e68988fa0bcbdeca5ae364cba8d6db3637.tar.gz
emacs-1f7113e68988fa0bcbdeca5ae364cba8d6db3637.zip
Shorten docstrings generated by cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Split the first line of generated docstrings if either the struct name or a field name is very long. This reduces the likelihood of "docstring wider than 80 characters" errors. (Bug#65790)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 102616c9bb7..03aed5263b6 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -983,6 +983,23 @@ byte-compiled. Run with dynamic binding."
983 `(cl-defsubst long-name-with-more-than-80-characters-yes-this-is-a-very-long-name-but-why-not!! () 983 `(cl-defsubst long-name-with-more-than-80-characters-yes-this-is-a-very-long-name-but-why-not!! ()
984 "Do something."))) 984 "Do something.")))
985 985
986(ert-deftest bytecomp-warn-wide-docstring/cl-defstruct ()
987 (bytecomp--without-warning-test
988 `(cl-defstruct short-name
989 field))
990 (bytecomp--without-warning-test
991 `(cl-defstruct short-name
992 long-name-with-less-80-characters-but-still-quite-a-bit))
993 (bytecomp--without-warning-test
994 `(cl-defstruct long-name-with-less-80-characters-but-still-quite-a-bit
995 field))
996 (bytecomp--with-warning-test "wider than.*characters"
997 `(cl-defstruct short-name
998 long-name-with-more-than-80-characters-yes-this-is-a-very-long-name-but-why-not!!))
999 (bytecomp--with-warning-test "wider than.*characters"
1000 `(cl-defstruct long-name-with-more-than-80-characters-yes-this-is-a-very-long-name-but-why-not!!
1001 field)))
1002
986(ert-deftest bytecomp-warn-quoted-condition () 1003(ert-deftest bytecomp-warn-quoted-condition ()
987 (bytecomp--with-warning-test 1004 (bytecomp--with-warning-test
988 "Warning: `condition-case' condition should not be quoted: 'arith-error" 1005 "Warning: `condition-case' condition should not be quoted: 'arith-error"