GNU bug report logs - #79197
[PATCH] ; * lisp/simple.el (yank): Update docstring.

Previous Next

Package: emacs;

Reported by: James Thomas <jimjoe <at> gmx.net>

Date: Thu, 7 Aug 2025 21:23:01 UTC

Severity: normal

Tags: patch

Full log


Message #62 received at 79197 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: James Thomas <jimjoe <at> gmx.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 79197 <at> debbugs.gnu.org
Subject: Re: bug#79197: [PATCH] ; * lisp/simple.el (yank): Update
 docstring., Re: bug#79197: [PATCH] ; * lisp/simple.el (yank): Update
 docstring., Re: bug#79197: [PATCH] ; * lisp/simple.el (yank): Update
 docstring.
Date: Fri, 15 Aug 2025 03:39:41 -0400
>>> diff --git a/lisp/simple.el b/lisp/simple.el
>>> index cd13e0a55f4..97701ead69d 100644
>>> --- a/lisp/simple.el
>>> +++ b/lisp/simple.el
>>> @@ -5758,9 +5758,10 @@ kill-new
>>>  	  (setcar kill-ring string)
>>>          (let ((history-delete-duplicates nil))
>>>            (add-to-history 'kill-ring string kill-ring-max t))))
>>> -    (setq kill-ring-yank-pointer kill-ring)
>>> +    (prog1
>>> +        (setq kill-ring-yank-pointer kill-ring)
>>>      (if interprogram-cut-function
>>> -        (funcall interprogram-cut-function string))))
>>> +        (funcall interprogram-cut-function string)))))
>>
>> Why do we need this hunk?
>
> For the correct return value?

That's already what `prog1` says in the code, so it just pushes the
question a step further: why do we care about the return value here?
The docstring doesn't mention anything about the return value (so it's
not clear which value is more "correct"), and a quick perusal of the
code suggests that most callers don't care about the return value.

So, if we keep this hunk, it should come with a comment explaining why
we care, or a change to the docstring to document the return value.


        Stefan





This bug report was last modified 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.