Subject: Re: bug#72862: 29.1; Strange interaction between append-next-kill and kill-whole-line

From: Eli Zaretskii <[email-masked]>
Date: Thu, 29 Aug 2024 07:53:52 +0300

> From: Sean McAfee <[email-masked]>
> Date: Wed, 28 Aug 2024 14:12:11 -0700
> 
> Starting from emacs -Q:
> 
> - Enter the text "12345\n" in the scratch buffer.
> - Kill the text by any means, eg: C-SPC C-p C-w
> - Enter the text "ABCDE" and put point on the C.
> - Run append-next-kill with C-M-w and then kill-whole-line with C-S-<backspace>.
> - Yank the most recent kill with C-y.
> 
> The text I get back is "AB12345\nCDE".  Apparently the killed whole line
> is being wrapped around the preceding kill, at the place where point
> was, rather than being appended to it.

Yes, because kill-whole-line kills the line in two parts.  The
commentary to the code there says:

  ;; - We need to kill in two steps, because the previous command
  ;;   could have been a kill command, in which case the text before
  ;;   point needs to be prepended to the current kill ring entry and
  ;;   the text after point appended.

Perhaps what the code there does needs to be augmented for the case of
append-next-kill.