,(if (memq '&key args)
`(&whole cl-whole &cl-quote ,@args)
(cons '&cl-quote args))
- ,(format "compiler-macro for inlining `%s'." name)
+ ;; NB. This will produce incorrect results in some
+ ;; cases, as our coding conventions says that the first
+ ;; line must be a full sentence. However, if we don't
+ ;; word wrap we will have byte-compiler warnings about
+ ;; overly long docstrings. So we can't have a perfect
+ ;; result here, and choose to avoid the byte-compiler
+ ;; warnings.
+ ,(internal--format-docstring-line "compiler-macro for `%s'." name)
(cl--defsubst-expand
',argns '(cl-block ,name ,@(cdr (macroexp-parse-body body)))
nil
(bytecomp--with-warning-test "defvar.*foo.*wider than.*characters"
`(defvar foo t ,bytecomp-tests--docstring)))
+(ert-deftest bytecomp-warn-wide-docstring/cl-defsubst ()
+ (bytecomp--without-warning-test
+ `(cl-defsubst short-name ()
+ "Do something."))
+ (bytecomp--without-warning-test
+ `(cl-defsubst long-name-with-less-80-characters-but-still-quite-a-bit ()
+ "Do something."))
+ (bytecomp--with-warning-test "wider than.*characters"
+ `(cl-defsubst long-name-with-more-than-80-characters-yes-this-is-a-very-long-name-but-why-not!! ()
+ "Do something.")))
+
(ert-deftest bytecomp-warn-quoted-condition ()
(bytecomp--with-warning-test
"Warning: `condition-case' condition should not be quoted: 'arith-error"