X-Loop: help-debbugs@HIDDEN Subject: bug#60143: 29.0.60; command `undo-redo` don't restore cursor position Resent-From: yinz Liu <liuyinz95@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 17 Dec 2022 03:35:04 +0000 Resent-Message-ID: <handler.60143.B.16712480834375 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 60143 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 60143 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.16712480834375 (code B ref -1); Sat, 17 Dec 2022 03:35:04 +0000 Received: (at submit) by debbugs.gnu.org; 17 Dec 2022 03:34:43 +0000 Received: from localhost ([127.0.0.1]:53351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1p6NyF-00018Q-Id for submit <at> debbugs.gnu.org; Fri, 16 Dec 2022 22:34:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:41154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <liuyinz95@HIDDEN>) id 1p6MDy-0003gx-0q for submit <at> debbugs.gnu.org; Fri, 16 Dec 2022 20:42:50 -0500 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 <liuyinz95@HIDDEN>) id 1p6MDx-0006fj-MC for bug-gnu-emacs@HIDDEN; Fri, 16 Dec 2022 20:42:49 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <liuyinz95@HIDDEN>) id 1p6MDv-00011m-UV for bug-gnu-emacs@HIDDEN; Fri, 16 Dec 2022 20:42:49 -0500 Received: by mail-lj1-x22f.google.com with SMTP id v11so3861628ljk.12 for <bug-gnu-emacs@HIDDEN>; Fri, 16 Dec 2022 17:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=doEHJxNX8ZdFZliYtkc2pGmQLWv3cBx6/5A4i2MmFIg=; b=M47STUy/MyAAXe6ikUBhJf59QIhBiyr+uXpOWBawzGBcYf7v3DvxKWO81UNOg+T9Xs cS+M+6judIatoTYbKjs7xXFecsWBAaltI5kKDKuQa0EAJFA/IqjTdrVGHX1GW2OX43fA 0/sQ3YZfz3VIAaGuIKcZIjfWJCcEHtJYxGsz8+ewtVLc5VMoIuVUKl9a5z8aWrVdYQLa APra2Ct6N0vNUb+5XS9MWCVSwnatSotkhirBlLIXwOXAhtBb9IWMnv7eMzmjwWeZjkk3 sFlar2AXnmzQpD62lCU7Jlwvu+cHk+LpGaoHH1BxHAhvh1glsBWO+YG4C1Or9CVKlj5+ 5Cbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=doEHJxNX8ZdFZliYtkc2pGmQLWv3cBx6/5A4i2MmFIg=; b=Q2zhAEZgEGQFjEjdpa5XPGMs0g5qSHrXSm677wYtH3xpgzuNHmPLLAlWQJWkrI4CJ0 vk4KeJnp1hrFm2CbEFCmUO/vwukQQqYx0G7VwcKvaKdJDn9cm6tSggnUoft5+wGvoOTb CNz8LtgoqLGpa4ThZS0mhXjSyLn4yEDwwdIgKyFIzgcQ96ZtQaP5upvYRjOs2XtazPoM W1CRdt2fMNSN+B2AZBvUJmFch6Q9U7C/rgDy51MVzydss4j4Uk26FX7ZJ/MwMnecf6WV 65c5YpSWTQAqq0e/G2W8HyCwmIT2ey0MwKrvpWE6mekr9imhJHdevwKP/IX8ZDx+R2H8 5EJg== X-Gm-Message-State: AFqh2kr0yNlFFuO+dMnoJJUu/ujG+EGBUsA9dYIlj99oOpU+/F3ttS6u ABHM7hp/8PMsSjEuINHyrczOQLZ2wpTSOm+/Iu8dKM3TKiyfcA== X-Google-Smtp-Source: AMrXdXtVGugPfDGK+lO0sQ8XviPSjwJNdOXYeti/Vg4ux+JOgj6fIw1cFX6H1VygrFul1d/tIFjzSQchA1Dey6DXG0U= X-Received: by 2002:a05:651c:221f:b0:27e:5ba8:cdd1 with SMTP id y31-20020a05651c221f00b0027e5ba8cdd1mr375470ljq.142.1671241365127; Fri, 16 Dec 2022 17:42:45 -0800 (PST) MIME-Version: 1.0 From: yinz Liu <liuyinz95@HIDDEN> Date: Sat, 17 Dec 2022 09:42:28 +0800 Message-ID: <CA+NXa3gQxcLwT_hTjmd4AMzgnM8-UQ_+y+Dr4prnZLwL9i=PpQ@HIDDEN> Content-Type: multipart/alternative; boundary="000000000000e707b805effc3336" Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=liuyinz95@HIDDEN; helo=mail-lj1-x22f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Mailman-Approved-At: Fri, 16 Dec 2022 22:34:38 -0500 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.1 (--) --000000000000e707b805effc3336 Content-Type: text/plain; charset="UTF-8" aaaa ! bbbb @ cccc # 1. when cursor at position "#", call `undo', cursor jump to "@" 2. when cursor at position "@", call `undo-redo', text "cccc" restore, but cursor still remain in "@", don't move to "#". my workaround fow now: in function primitive-undo <https://github.com/emacs-mirror/emacs/blob/149e6e03b3f860c3d78031bf3377d8a4c99a7a64/lisp/simple.el#L3622-L3624> : change L3624 to : `(goto-char (+ pos (length string)))` --000000000000e707b805effc3336 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"> <p class=3D"gmail-p1" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue"">aaaa ! bbbb @ cccc #</p> <p class=3D"gmail-p2" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue";min-height:15px"><br></p> <p class=3D"gmail-p1" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue"">1. when cursor at position &qu= ot;#", call `undo', cursor jump to "@"</p> <p class=3D"gmail-p1" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue"">2. when cursor at position &qu= ot;@", call `undo-redo', text "cccc" restore,</p> <p class=3D"gmail-p1" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue""><span class=3D"gmail-Apple-con= verted-space">=C2=A0=C2=A0 </span>but cursor still remain in "@",= don't move to "#".</p> <p class=3D"gmail-p2" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue";min-height:15px"><br></p> <p class=3D"gmail-p1" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue"">my workaround fow now:</p> <p class=3D"gmail-p2" style=3D"margin:0px;font-variant-numeric:normal;font-= variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:no= rmal;font-family:"Helvetica Neue";min-height:15px"><br></p><p cla= ss=3D"gmail-p1" style=3D"margin:0px;font-variant-numeric:normal;font-varian= t-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;f= ont-family:"Helvetica Neue"">in function=C2=A0<a href=3D"https://= github.com/emacs-mirror/emacs/blob/149e6e03b3f860c3d78031bf3377d8a4c99a7a64= /lisp/simple.el#L3622-L3624">primitive-undo</a>=C2=A0:</p><p class=3D"gmail= -p1" style=3D"margin:0px;font-variant-numeric:normal;font-variant-east-asia= n:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:= "Helvetica Neue""><br></p><p class=3D"gmail-p1" style=3D"margin:0= px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:= normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue&q= uot;">change L3624 to : `(goto-char (+ pos (length string)))`<br></p></div> --000000000000e707b805effc3336--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: yinz Liu <liuyinz95@HIDDEN> Subject: bug#60143: Acknowledgement (29.0.60; command `undo-redo` don't restore cursor position) Message-ID: <handler.60143.B.16712480834375.ack <at> debbugs.gnu.org> References: <CA+NXa3gQxcLwT_hTjmd4AMzgnM8-UQ_+y+Dr4prnZLwL9i=PpQ@HIDDEN> X-Gnu-PR-Message: ack 60143 X-Gnu-PR-Package: emacs Reply-To: 60143 <at> debbugs.gnu.org Date: Sat, 17 Dec 2022 03:35:04 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 60143 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 60143: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D60143 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#60143: 29.0.60; command `undo-redo` don't restore cursor position Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 18 Dec 2022 11:04:01 +0000 Resent-Message-ID: <handler.60143.B60143.167136142528437 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 60143 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: yinz Liu <liuyinz95@HIDDEN>, Stefan Monnier <monnier@HIDDEN> Cc: 60143 <at> debbugs.gnu.org Received: via spool by 60143-submit <at> debbugs.gnu.org id=B60143.167136142528437 (code B ref 60143); Sun, 18 Dec 2022 11:04:01 +0000 Received: (at 60143) by debbugs.gnu.org; 18 Dec 2022 11:03:45 +0000 Received: from localhost ([127.0.0.1]:33296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1p6rSL-0007Ob-HK for submit <at> debbugs.gnu.org; Sun, 18 Dec 2022 06:03:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1p6rSK-0007OP-BJ for 60143 <at> debbugs.gnu.org; Sun, 18 Dec 2022 06:03:44 -0500 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 <eliz@HIDDEN>) id 1p6rSD-0001aS-P8; Sun, 18 Dec 2022 06:03:38 -0500 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=5RyBX1uB7+1k/qV/duFGeGilXLus2aM33lmcxUpaVlo=; b=rmCes6QiCPGK ilfTU/2bT/DDcaeJjKz4Y9HbZw2FS+XvPPX33ouBsGbtL9o2coxClk8ASZ+QbOy8FkWk3oCKKpTrI X9uQqc7iYIVQUCrN7qRRe8jbxKeIQsBYj+QRx8h5b8c07wXjWsPmXU+gvkFHLnYUQ6n7wqppOlZ9L o7gvzaNYn5IB4s6F7t/DuEJb7m+dScB/K1gjAS92Apw5W4HYCe66Nt31ogtFfdL8UcEL8Baf6tgPt +oiwJZh0fsc6OhVAwTPUCAIpUFkSeeWcwrsCSqkJ5PnGdB36dGRhdwvNlozd6WHC4f5mt8Rl3hy3O +4vHKwHKKPzLupm6yXRc6g==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1p6rSC-0005vI-F6; Sun, 18 Dec 2022 06:03:37 -0500 Date: Sun, 18 Dec 2022 13:03:43 +0200 Message-Id: <83len5ezxs.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <CA+NXa3gQxcLwT_hTjmd4AMzgnM8-UQ_+y+Dr4prnZLwL9i=PpQ@HIDDEN> (message from yinz Liu on Sat, 17 Dec 2022 09:42:28 +0800) References: <CA+NXa3gQxcLwT_hTjmd4AMzgnM8-UQ_+y+Dr4prnZLwL9i=PpQ@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: yinz Liu <liuyinz95@HIDDEN> > Date: Sat, 17 Dec 2022 09:42:28 +0800 > > aaaa ! bbbb @ cccc # > > 1. when cursor at position "#", call `undo', cursor jump to "@" > > 2. when cursor at position "@", call `undo-redo', text "cccc" restore, > but cursor still remain in "@", don't move to "#". > > my workaround fow now: > > in function primitive-undo : > > change L3624 to : `(goto-char (+ pos (length string)))` That code is there for almost 10 years, and before that the C implementation did the same. The way the code is written, viz.: (goto-char pos) (insert string) (goto-char pos)) it is clear that the second goto-char is on purpose, since if we delete it, we get the effect that you want; no need to goto anywhere else, because 'insert' leaves point after the inserted text. So I very much hesitate to change this. Stefan, any comments? do you happen to know why we return point to before the insertion?
X-Loop: help-debbugs@HIDDEN Subject: bug#60143: 29.0.60; command `undo-redo` don't restore cursor position Resent-From: Stefan Monnier <monnier@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 19 Dec 2022 01:43:01 +0000 Resent-Message-ID: <handler.60143.B60143.167141416114714 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 60143 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: yinz Liu <liuyinz95@HIDDEN>, 60143 <at> debbugs.gnu.org Received: via spool by 60143-submit <at> debbugs.gnu.org id=B60143.167141416114714 (code B ref 60143); Mon, 19 Dec 2022 01:43:01 +0000 Received: (at 60143) by debbugs.gnu.org; 19 Dec 2022 01:42:41 +0000 Received: from localhost ([127.0.0.1]:37049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1p75Av-0003pG-9T for submit <at> debbugs.gnu.org; Sun, 18 Dec 2022 20:42:41 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1p75At-0003p9-Ml for 60143 <at> debbugs.gnu.org; Sun, 18 Dec 2022 20:42:40 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 546D0100905; Sun, 18 Dec 2022 20:42:34 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id EBD491008D0; Sun, 18 Dec 2022 20:42:32 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671414153; bh=P9Kfu61H+V7tsBwxWXzp2TxJ1TEiBNFK+3kxLxo0n/o=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SzfunT0CFFQ7npB+OWP78rCeYyC9TIOXb9DaDi+dD3LI0QqN8GQ4THsVcHFFb0eQr mcPTGxGLhFt8B1sfFtYo40jThSKWBhCZb2oQUkJ9AD6+qH93Fsjm9fUsq49KmcqO5P 17/qKk+RD0rp2y8N2pCiGA9tWS+D+MCLQMURddqu0p8nAs99alMCIwv1RDgRZSjWQk ptxqX1XA3h7FOS+X8rBocra31lgbeGoehlcp9fV49OZKhOKawxF7t9o6rLcie+0Pry pJ+QjnOy/gQBfPH8FPoHYZMrQoxxZt1tr/QYjoE51+qS341+P7Gfm0w0YXJvOQoYUd tLggQd47hkrpw== Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BF7521202EE; Sun, 18 Dec 2022 20:42:32 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> In-Reply-To: <83len5ezxs.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 18 Dec 2022 13:03:43 +0200") Message-ID: <jwv7cyow5qj.fsf-monnier+emacs@HIDDEN> References: <CA+NXa3gQxcLwT_hTjmd4AMzgnM8-UQ_+y+Dr4prnZLwL9i=PpQ@HIDDEN> <83len5ezxs.fsf@HIDDEN> Date: Sun, 18 Dec 2022 20:42:31 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.398 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > So I very much hesitate to change this. Stefan, any comments? Changing that code is likely wrong, indeed. If the undo doesn't get you where you expected, it should usually be changed by adding an additional record to the undo log. That "record" is a simple integer indicating the position of point at that moment (citing `C-h o buffer-undo-list`): An entry of the form POSITION indicates that point was at the buffer location given by the integer. Undoing an entry of this form places point at POSITION. As for whether we should add such a record in the OP's scenario, and how to do that, I haven't looked at his scenario in enough detail to have much to say about it. Stefan
X-Loop: help-debbugs@HIDDEN Subject: bug#60143: 29.0.60; command `undo-redo` don't restore cursor position Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 19 Dec 2022 03:36:01 +0000 Resent-Message-ID: <handler.60143.B60143.167142095219023 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 60143 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier <monnier@HIDDEN> Cc: liuyinz95@HIDDEN, 60143 <at> debbugs.gnu.org Received: via spool by 60143-submit <at> debbugs.gnu.org id=B60143.167142095219023 (code B ref 60143); Mon, 19 Dec 2022 03:36:01 +0000 Received: (at 60143) by debbugs.gnu.org; 19 Dec 2022 03:35:52 +0000 Received: from localhost ([127.0.0.1]:37532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1p76wR-0004wl-Kh for submit <at> debbugs.gnu.org; Sun, 18 Dec 2022 22:35:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1p76wP-0004we-8g for 60143 <at> debbugs.gnu.org; Sun, 18 Dec 2022 22:35:49 -0500 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 <eliz@HIDDEN>) id 1p76wI-00059Q-Du; Sun, 18 Dec 2022 22:35:42 -0500 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=nK2VjPxFYd/mP0mx+V/4i2nz6nlpvIdeyZ18svmur7U=; b=lH1SNTkTa8/2 begV3/Es/TKPhLrrO6Jt80wq23lf5MThL4dQgB+QgArre5LAwCLLfQriWiS34y6nlt5yz1DLwwjP3 jVvwBf4+2Kxt9b1ljKfooHJdWdIvvSrqDFFSVVsCuBUuQ7/PMUf41IfzhceFlvrkNhlmFQR8hlsdT fLcSzhSBE3i133mfBk3EdfBVMeJZdY/GgvmCa1LjIwmPLhk482+cD83aKZBkamo3+QSACnB8JmSdF G9bcxR5zbWOLGSVaWtabZFH61C0C+Bhtb14ZvTl1mJoisPbaUhsZx3+f2Vjw0ppncG4O5Oz5q91Yf Ox2N2CEJNIgz11dHKkMn1Q==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1p76wF-0001hj-Rt; Sun, 18 Dec 2022 22:35:42 -0500 Date: Mon, 19 Dec 2022 05:35:49 +0200 Message-Id: <83y1r4dq0a.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <jwv7cyow5qj.fsf-monnier+emacs@HIDDEN> (message from Stefan Monnier on Sun, 18 Dec 2022 20:42:31 -0500) References: <CA+NXa3gQxcLwT_hTjmd4AMzgnM8-UQ_+y+Dr4prnZLwL9i=PpQ@HIDDEN> <83len5ezxs.fsf@HIDDEN> <jwv7cyow5qj.fsf-monnier+emacs@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Stefan Monnier <monnier@HIDDEN> > Cc: yinz Liu <liuyinz95@HIDDEN>, 60143 <at> debbugs.gnu.org > Date: Sun, 18 Dec 2022 20:42:31 -0500 > > > So I very much hesitate to change this. Stefan, any comments? > > Changing that code is likely wrong, indeed. If the undo doesn't get > you where you expected, it should usually be changed by adding an > additional record to the undo log. > > That "record" is a simple integer indicating the position of point at > that moment (citing `C-h o buffer-undo-list`): > > An entry of the form POSITION indicates that point was at the buffer > location given by the integer. Undoing an entry of this form places > point at POSITION. > > As for whether we should add such a record in the OP's scenario, and how > to do that, I haven't looked at his scenario in enough detail to have > much to say about it. I don't think we record position of point before deletion. Which is why 'undo' in that scenario also ends up with point before the recovered deletion.
X-Loop: help-debbugs@HIDDEN Subject: bug#60143: 29.0.60; command `undo-redo` don't restore cursor position Resent-From: Stefan Monnier <monnier@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 19 Dec 2022 16:10:01 +0000 Resent-Message-ID: <handler.60143.B60143.167146616316170 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 60143 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: liuyinz95@HIDDEN, 60143 <at> debbugs.gnu.org Received: via spool by 60143-submit <at> debbugs.gnu.org id=B60143.167146616316170 (code B ref 60143); Mon, 19 Dec 2022 16:10:01 +0000 Received: (at 60143) by debbugs.gnu.org; 19 Dec 2022 16:09:23 +0000 Received: from localhost ([127.0.0.1]:38958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1p7Ihf-0004Ck-64 for submit <at> debbugs.gnu.org; Mon, 19 Dec 2022 11:09:23 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1p7Ihb-0004CZ-R8 for 60143 <at> debbugs.gnu.org; Mon, 19 Dec 2022 11:09:22 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4E4944415B3; Mon, 19 Dec 2022 11:09:14 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B9E41440340; Mon, 19 Dec 2022 11:09:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671466152; bh=0QsdQhQ1CHwcgzLmqzzxtOV41/8ZxPbY970NEUQoX1g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dy29OtyGQqQaG+RUxaq+M00pl8IT+zA5gEnKkhtRrIvYIEfUVih/1yJtW/Dmq8azZ GJ4COLsDGZ7O/zgHh7r4KinwkU96piU6w8neJqeHOdnn6GGuqbrCnzxU11VpBRSk5F zuoHgSTnpVGYfNDeZgjx1O0MXVOHrRhr1/14zJUvZ944RDdEJ7yKSuHpWXbpRO1lND ES8A4wXpNJ5glHSKbbWOrNcWQeBV774lihMv7A6AoO0Sxce3LwlF8w+Q5fL9zOILFp Q7s8QZH3cEC63W5Jlw32b1qt+Xo8Axkmpcg3FzyHxuRRKkeNur73hbibZqlB3v8A/r ZeN3nS0LkK+4A== Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 94CEC12025D; Mon, 19 Dec 2022 11:09:12 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> In-Reply-To: <83y1r4dq0a.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 19 Dec 2022 05:35:49 +0200") Message-ID: <jwvk02nv0mg.fsf-monnier+emacs@HIDDEN> References: <CA+NXa3gQxcLwT_hTjmd4AMzgnM8-UQ_+y+Dr4prnZLwL9i=PpQ@HIDDEN> <83len5ezxs.fsf@HIDDEN> <jwv7cyow5qj.fsf-monnier+emacs@HIDDEN> <83y1r4dq0a.fsf@HIDDEN> Date: Mon, 19 Dec 2022 11:09:09 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.418 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Eli Zaretskii [2022-12-19 05:35:49] wrote: >> From: Stefan Monnier <monnier@HIDDEN> >> Cc: yinz Liu <liuyinz95@HIDDEN>, 60143 <at> debbugs.gnu.org >> Date: Sun, 18 Dec 2022 20:42:31 -0500 >> >> > So I very much hesitate to change this. Stefan, any comments? >> >> Changing that code is likely wrong, indeed. If the undo doesn't get >> you where you expected, it should usually be changed by adding an >> additional record to the undo log. >> >> That "record" is a simple integer indicating the position of point at >> that moment (citing `C-h o buffer-undo-list`): >> >> An entry of the form POSITION indicates that point was at the buffer >> location given by the integer. Undoing an entry of this form places >> point at POSITION. >> >> As for whether we should add such a record in the OP's scenario, and how >> to do that, I haven't looked at his scenario in enough detail to have >> much to say about it. > > I don't think we record position of point before deletion. I think we do, at least sometimes: record_delete (ptrdiff_t beg, Lisp_Object string, bool record_markers) { [...] record_point (beg); -- Stefan
Received: (at control) by debbugs.gnu.org; 4 Sep 2023 15:12:23 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 04 11:12:23 2023 Received: from localhost ([127.0.0.1]:52230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qdBFX-0008Ev-JG for submit <at> debbugs.gnu.org; Mon, 04 Sep 2023 11:12:23 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:44272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1qdBFV-0008EZ-NW for control <at> debbugs.gnu.org; Mon, 04 Sep 2023 11:12:22 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-500aed06ffcso2431339e87.0 for <control <at> debbugs.gnu.org>; Mon, 04 Sep 2023 08:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693840336; x=1694445136; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=I8SEaGqZ7ihm+3mVX7+lbGQOWmrMObB3eLUOEqGTl1g=; b=sm/vm4oOzL78Juvvq7p6Yvr9+3oDmIOR48m7cCg7FKEWTQ880JNor9CEEovySSxU6y bW48wWgosneOdX6fBp/gQoBnZB3FJslRcMqdq30yBdSsuMkkokckYit4HXGY1eOx1XqW to6tqkcGxOnuEMTQxIgufUrPcZ90UGmF/ZjPkXlPnfKSzSbMNWaJ4BFj1olcOCSp1l+1 cIqFU2h7U/WWsC0AjepwM4dkkkXIdLH4/lvT18o2eGdpRihH0g7oi3WDDRJbc1EUN068 WVAYvtWca/ubUwpsCre3hFwNAXxb7bfLb3WTMePkkOlg+qCg6FQ/wW7kkLEuwQ9XYhTH StPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693840336; x=1694445136; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=I8SEaGqZ7ihm+3mVX7+lbGQOWmrMObB3eLUOEqGTl1g=; b=YlgrMZOG0uuMQ5HE+ZDp1aaGII/wKjP7BjKe0l4MoYzbViEIcVSWhWq3FzFbtQrJnI c2+T9SaPFS9gsRrRamxxeyQRPyRrsWbz/Tw/MvbIH/tn7/ehnCadzERLhTZxzeR598zZ tPOMzVICYBZGpXxpxV3BNIReGhew8PffYi/HlTwLA9CoGp/eSo3rNnKSr/mvNFPg2N4H 3TxXcv3o6VqO0AgCqPFS0RNobfJJuGklrQ+xv9RnH2Xkc6o7I5eEgQ3clxhisZoOGg6s POp2qxEae2xlIIRPpbLgK+jND9AZ5NiiFX9e9G3PSgomKRP6a2z8obOlNJ42L1IciEyL 0AhQ== X-Gm-Message-State: AOJu0YxHcujP2b7g5dUHwlW0f79ZOUEoFKgHoAIx6XLSWqnAVuztMp+N UiSjKl5VOj5eHxbGyGZ1d0W6k8yqr+JguQ8wimCnORPS X-Google-Smtp-Source: AGHT+IG69MBqfcwX+3/pCPFL8vnqskhYKwnBPEWTEN4XUqoH6KEp9JiEk9DMFkWXFg/Y+x+Bm2RQZ9rqj0A01Re6eVU= X-Received: by 2002:a05:6512:b8c:b0:500:8725:1351 with SMTP id b12-20020a0565120b8c00b0050087251351mr9026461lfv.47.1693840335796; Mon, 04 Sep 2023 08:12:15 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Sep 2023 08:12:15 -0700 From: Stefan Kangas <stefankangas@HIDDEN> MIME-Version: 1.0 Date: Mon, 4 Sep 2023 08:12:15 -0700 Message-ID: <CADwFkmkx4wBfE2DBAFehxih20UdM7xAUyGxhxZ431LZk-TLSbg@HIDDEN> Subject: control message for bug #60143 To: control <at> debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) severity 60143 wishlist quit
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.