diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2024-03-06 12:03:06 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2024-03-07 13:47:53 +0100 |
commit | 61b2f5f96b1d9dfd2fd908e09fac0d4163049c42 (patch) | |
tree | e76095045e99141e287be64920502e053de5a787 /test/lisp/emacs-lisp/bytecomp-resources | |
parent | 8aabd835747297818d538cc16b3f53fcc1dd67f6 (diff) | |
download | emacs-61b2f5f96b1d9dfd2fd908e09fac0d4163049c42.tar.gz emacs-61b2f5f96b1d9dfd2fd908e09fac0d4163049c42.tar.bz2 emacs-61b2f5f96b1d9dfd2fd908e09fac0d4163049c42.zip |
Single string literal in body is return value only, not doc string
A function or macro body consisting of a single string literal now only
uses it as a return value. Previously, it had the dual uses as return
value and doc string, which was never what the programmer wanted and
had some inconvenient consequences (bug#69387).
This change applies to `lambda`, `defun`, `defsubst` and `defmacro`
forms; most other defining forms already worked in the sensible way.
* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda):
Don't use a lone string literal as doc string.
* test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el
(foo): Update docstring warning test.
* doc/lispref/functions.texi (Function Documentation): Update.
* etc/NEWS: Announce.
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-resources')
-rw-r--r-- | test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el index 94b0e80c979..571f7f6f095 100644 --- a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el @@ -1,3 +1,4 @@ ;;; -*- lexical-binding: t -*- (defun foo () - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + nil) |