bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69387: 30.0.50; A string shouldn't be both a docstring and a return


From: Philip Kaludercic
Subject: bug#69387: 30.0.50; A string shouldn't be both a docstring and a return value
Date: Mon, 26 Feb 2024 14:47:28 +0000

Eshel Yaron <me@eshelyaron.com> writes:

> Hi Stefan,
>
> Stefan Monnier writes:
>
>> Package: Emacs
>> Version: 30.0.50
>>
>>
>> Currently, ELisp defines
>>
>>     (lambda (blabla) "Help!")
>>
>> as a function that returns "Help!" *and* whose docstring is "Help!".
>> As seen in commit eeb89a5cb292bffe40ba7d0b0cf81f82f8452bf8, it can be
>> a source of annoyance as well.
>>
>> I cannot remember finding source code which makes use of this "feature".
>
> vc-mode kind of abuses of this feature:
>
> (defun vc-mode (&optional _arg)
>   ;; Dummy function for C-h m
>   "Version Control minor mode.
> This minor mode is automatically activated whenever you visit a file under
> control of one of the revision control systems in `vc-handled-backends'.
> VC commands are globally reachable under the prefix \\[vc-prefix-map]:
> \\{vc-prefix-map}")

But cases like these can be easily resolved, e.g. just by adding a nil
to the end of the body.

> Here the assumption is that the string is used as a doc string, which
> indeed leads to unexpected results, see Bug#65092.
>
>
> Best,
>
> Eshel
>
>
>
>

-- 
        Philip Kaludercic on peregrine





reply via email to

[Prev in Thread] Current Thread [Next in Thread]