Subject: bug#79197: [PATCH] ; * lisp/simple.el (yank): Update docstring.

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Aug 2025 09:15:50 +0300

> From: James Thomas <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>
> Date: Sat, 09 Aug 2025 04:08:06 +0530
> 
> Eli Zaretskii  writes:
> 
> >> Date: Fri, 08 Aug 2025 02:52:28 +0530
> >> From:  James Thomas via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <[email-masked]>
> >> 
> >> +If N is negative, reinsert the earliest available kill.
> >
> > Thanks, but that is not what I see when I try "C-u - 1 C-y".  It
> > inserts the 2nd earliest kill, i.e., not the first one I killed, but
> > the one after it.  Which seems to be consistent with this snippet:
> 
> Well, obviously, because it's wrong! :-) And undocumented to boot...

Your patch is the exact opposite of commit 8e5d85ffc0, and will make
"C-u -" produce a different effect from "C-u - 1", which is very
surprising.  So at least we need to also change the handling of
negative numerical argument as well, to make them consistent.

And anyway, something is still amiss.  Try killing several pieces of
text, then type "C-u - 1 C-y" several times, with some typing between
the yank commands (to avoid any dwim-ish behavior when several yank
commands are invoked one after another).  That is,

  C-u - 1 C-y
  foo
  C-u - 1 C-y
  foo
  C-u - 1 C-y
  foo
  C-u - 1 C-y
  foo
  C-u - 1 C-y
  foo

Each yank will insert a different text, so saying "the earliest kill
available" is incorrect, because what that "earliest" kill is depends
on what the user manual calls "last yank pointer".  See current-kill,
which determines what happens here.  (The manual doesn't say anything
about negative arguments to C-y, which is at least interesting.)