From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#48478: 28.0.50; yank-from-kill-ring and kill-ring-yank-pointer Date: Sun, 06 Jun 2021 23:52:17 +0300 Organization: LINKOV.NET Message-ID: <87k0n6lnr2.fsf@mail.linkov.net> References: <83h7j1twym.fsf@gnu.org> <87k0nqo570.fsf@mail.linkov.net> <83a6olkjca.fsf@gnu.org> <87pmxe649v.fsf@mail.linkov.net> <835yz5bszn.fsf@gnu.org> <87y2c1yvqq.fsf@mail.linkov.net> <835yz4ab0s.fsf@gnu.org> <87wnrfx380.fsf@mail.linkov.net> <83a6ob2jiy.fsf@gnu.org> <87pmx6k6lf.fsf@mail.linkov.net> <838s3t236k.fsf@gnu.org> <8735u1e5hd.fsf@mail.linkov.net> <83lf7sxqiw.fsf@gnu.org> <87v96wc6jd.fsf@mail.linkov.net> <838s3rxyf3.fsf@gnu.org> <877djazn16.fsf@mail.linkov.net> <834keew4rs.fsf@gnu.org> <87r1hh60jb.fsf@mail.linkov.net> <83r1hhlae1.fsf@gnu.org> <87pmx03sg1.fsf@mail.linkov.net> <83sg1vilpg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2314"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 48478@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 06 23:16:36 2021 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 1lq08G-00005a-P3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 23:16:32 +0200 Original-Received: from localhost ([::1]:56442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lq08F-0000lr-QZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 17:16:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lq07m-0008RF-Jm for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 17:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lq07m-0008CG-DF for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 17:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lq07m-000065-9x for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 17:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Jun 2021 21:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48478 X-GNU-PR-Package: emacs Original-Received: via spool by 48478-submit@debbugs.gnu.org id=B48478.162301411832744 (code B ref 48478); Sun, 06 Jun 2021 21:16:02 +0000 Original-Received: (at 48478) by debbugs.gnu.org; 6 Jun 2021 21:15:18 +0000 Original-Received: from localhost ([127.0.0.1]:54047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lq074-0008W3-CI for submit@debbugs.gnu.org; Sun, 06 Jun 2021 17:15:18 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:34421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lq072-0008VY-G3 for 48478@debbugs.gnu.org; Sun, 06 Jun 2021 17:15:17 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id D3E6640005; Sun, 6 Jun 2021 21:15:09 +0000 (UTC) In-Reply-To: <83sg1vilpg.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 06 Jun 2021 08:52:27 +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" Xref: news.gmane.io gmane.emacs.bugs:208160 Archived-At: > I think the conclusion up-thread was that if the entry is edited > before it's inserted, then the edited entry should be added to the > head of the kill-ring, and the pointer set there. IOW, if I edit the > previous kill and insert it, the edited string becomes the one I get > on the next C-y. The discussion concluded that doing this is possible > without extensive changes, whereas the other alternative is "hard" as > it goes against the current design and implementation of the functions > involved in this. I'm okay with this behavior, and it is easy to > describe in the manual and easy to remember. I'm still unsure why the command that only yanks text should add new text to the kill-ring. This goes against the logic of yanking because currently only killing commands can add text to the kill-ring. So it would be very strange to call 'kill-new' from 'yank-from-kill-ring': diff --git a/lisp/simple.el b/lisp/simple.el index 9e827320f1..1aa720edba 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5781,8 +5781,9 @@ yank-from-kill-ring (insert-for-yank string) (when yank-from-kill-ring-rotate (let ((pos (seq-position kill-ring string))) - (when pos - (setq kill-ring-yank-pointer (nthcdr pos kill-ring))))) + (if pos + (setq kill-ring-yank-pointer (nthcdr pos kill-ring)) + (kill-new string)))) (if (consp arg) ;; Swap point and mark like in `yank' and `yank-pop'. (goto-char (prog1 (mark t)