From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72862: 29.1; Strange interaction between append-next-kill and kill-whole-line Date: Sun, 08 Sep 2024 09:56:51 +0300 Message-ID: <86mskiws3w.fsf@gnu.org> References: <865xrkgc9r.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72862@debbugs.gnu.org To: eefacm@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 08 08:58:38 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1snBsb-0000Zj-OO for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Sep 2024 08:58:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snBs2-0004k2-6j; Sun, 08 Sep 2024 02:58:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snBs0-0004jV-Jd for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 02:58:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1snBs0-00073g-A5 for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 02:58:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=uNTFwh2inRWmpB9gyCR5VWy259WqCERZK6B+RTVvbII=; b=OJTQFt3SFIHKJ82gqP3AYjIROpjqIRaytzssa09nORJXCczhPzY5jdOAgOBpp8to56naaG8ptB4lAPHsnF0C2o1vo4fGzyKECy18kQBOviCGxBzE+QXwlvzps6aGI5U7uUMj2LaEcVd+bz3Rq7oohmND4vrZiQvLnYD0huDWVSnj5oa2+KnMNqo1BHNjaxy+4RelrjqGnnn3lMiyNqdrGF4JJHCT6cR77hEWNVklN+DT+q5n14sbcyU/FGPiUK2FPVHwtNidGu7Qe5y9uSi8PZEhbV/ltGoV+f2jgRGgUMiGD3iI5W8oFYxB+6Ba4/BMQ/tiWX/XNpb8R8IIBMIN3A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snBs2-0001NV-2H for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 02:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Sep 2024 06:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72862 X-GNU-PR-Package: emacs Original-Received: via spool by 72862-submit@debbugs.gnu.org id=B72862.17257786235196 (code B ref 72862); Sun, 08 Sep 2024 06:58:02 +0000 Original-Received: (at 72862) by debbugs.gnu.org; 8 Sep 2024 06:57:03 +0000 Original-Received: from localhost ([127.0.0.1]:57898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snBr5-0001Lk-CE for submit@debbugs.gnu.org; Sun, 08 Sep 2024 02:57:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snBr2-0001LC-Vo for 72862@debbugs.gnu.org; Sun, 08 Sep 2024 02:57:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snBqv-00070G-Rr; Sun, 08 Sep 2024 02:56:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uNTFwh2inRWmpB9gyCR5VWy259WqCERZK6B+RTVvbII=; b=hrqFJIBYGlNQ EOAhNsSWJJ8cBhqwKg91mB97wPQuIOS0ibWV2E/aRYg7KObqobSx8kdCTcS1x8iNVK9bDjUJKkptW G9tZ8zsJYy7Z+81A/FeMKNmCMCr7g+cUBWjjAB+6AKWpZXpcvsnBj45hYsLKPF9A43LlEw5Wuuflm YZNssV5Ms42VrsMakGggd1/CY2QFfLrfPUFjA+CQPAoefUxAIDQBCDoPv5RsmRNIR6BJUVN5DRbCo UBIshyPiN4kzIt3XWh4hm7cHp0Z61hDiyPZSY6oAjAuLPFk2RSZ0mjAgd9isaQfQ5sxb7Yh8jXBqi gaWmPuaaQJyIXaXaCR4IfA==; In-Reply-To: <865xrkgc9r.fsf@gnu.org> (message from Eli Zaretskii on Thu, 29 Aug 2024 07:53:52 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291426 Archived-At: > Cc: 72862@debbugs.gnu.org > Date: Thu, 29 Aug 2024 07:53:52 +0300 > From: Eli Zaretskii > > > From: Sean McAfee > > 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-. > > - 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. After reading the documentation of append-next-kill, I think I'm changing my mind on this. The doc string of append-next-kill says: (append-next-kill &optional INTERACTIVE) Cause following command, if it kills, to add to previous kill. If the next command kills forward from point, the kill is appended to the previous killed text. If the command kills backward, the kill is prepended. Since kill-whole-line kills both backward and forward from point, it seems we should expect that the first part is prepended to previous kill, whereas the second part is appended. Which is what the command already does. WDYT?