diff options
| author | Damien Cassou | 2023-09-12 08:28:37 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2023-09-13 16:34:45 +0200 |
| commit | f045750fa5e94659e96bab85d1d05ddf65a4c557 (patch) | |
| tree | 06325a9095a0cf20678048d944194033a3ebb05f /test | |
| parent | d436c559a4fa7154802f4c898630266a3ff6efa9 (diff) | |
| download | emacs-f045750fa5e94659e96bab85d1d05ddf65a4c557.tar.gz emacs-f045750fa5e94659e96bab85d1d05ddf65a4c557.zip | |
Shorten docstrings generated by cl-defsubst
* lisp/emacs-lisp/cl-macs.el (cl-defsubst): Split the first line of
the docstring into 2 lines if the function name is very long.
Additionally, remove the word "inlining" in the generated docstring as
it is not very useful and increases the likelihood of "docstring wider
than 80 characters" errors. (Bug#65790)
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index c0adab75269..102616c9bb7 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el | |||
| @@ -972,6 +972,17 @@ byte-compiled. Run with dynamic binding." | |||
| 972 | (bytecomp--with-warning-test "defvar.*foo.*wider than.*characters" | 972 | (bytecomp--with-warning-test "defvar.*foo.*wider than.*characters" |
| 973 | `(defvar foo t ,bytecomp-tests--docstring))) | 973 | `(defvar foo t ,bytecomp-tests--docstring))) |
| 974 | 974 | ||
| 975 | (ert-deftest bytecomp-warn-wide-docstring/cl-defsubst () | ||
| 976 | (bytecomp--without-warning-test | ||
| 977 | `(cl-defsubst short-name () | ||
| 978 | "Do something.")) | ||
| 979 | (bytecomp--without-warning-test | ||
| 980 | `(cl-defsubst long-name-with-less-80-characters-but-still-quite-a-bit () | ||
| 981 | "Do something.")) | ||
| 982 | (bytecomp--with-warning-test "wider than.*characters" | ||
| 983 | `(cl-defsubst long-name-with-more-than-80-characters-yes-this-is-a-very-long-name-but-why-not!! () | ||
| 984 | "Do something."))) | ||
| 985 | |||
| 975 | (ert-deftest bytecomp-warn-quoted-condition () | 986 | (ert-deftest bytecomp-warn-quoted-condition () |
| 976 | (bytecomp--with-warning-test | 987 | (bytecomp--with-warning-test |
| 977 | "Warning: `condition-case' condition should not be quoted: 'arith-error" | 988 | "Warning: `condition-case' condition should not be quoted: 'arith-error" |