all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "J.P." <jp@neverwas.me>
To: Alcor <alcor@tilde.club>
Cc: emacs-erc@gnu.org, 74518@debbugs.gnu.org
Subject: bug#74518: 29.4; ERC 5.6: `undo' regression on Erc 5.6
Date: Sun, 24 Nov 2024 15:43:41 -0800	[thread overview]
Message-ID: <87o724jiz6.fsf__38890.2462714881$1732491867$gmane$org@neverwas.me> (raw)
In-Reply-To: <87iksc46cq.fsf@tilde.club> (Alcor via General discussion about's message of "Sun, 24 Nov 2024 23:25:25 +0100")

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Alcor via General discussion about ERC <emacs-erc@gnu.org> writes:

> 1. Start from a clean Emacs installation (-Q or default config).
> 2. Install the latest stable version of Erc via C-u M-x package-install
> erc RET (At the time of writing, this is Erc 5.6).
> 3. Connect to Libera.Chat under any nick.
> 4. Once connected, type /QUERY fsbot and hit RET.
> 5. Interact with the bot in any way that forces a reply (e.g. type
> ,greet RET).
> 6. Wait for the bot to reply.
> 7. Trigger the undo function via M-x undo or C-x u.
> 8. Observe as the undo affects the reply text inserted by the bot.
>
> This is a regression from Erc 5.5, where `undo' only affected the text
> typed by the user within the input prompt.

Thanks for reporting this.

Hoping this patch will address the issue.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Clear-buffer-undo-list-after-sending-input-in-ERC.patch --]
[-- Type: text/x-patch, Size: 1449 bytes --]

From 45180df71fc636d086ff87d70d377263688a133f Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@neverwas.me>
Date: Sun, 24 Nov 2024 15:30:02 -0800
Subject: [PATCH] Clear buffer-undo-list after sending input in ERC

* lisp/erc/erc.el (erc-send-current-line): Set `buffer-undo-list' to nil
because it should only record editing changes in the prompt area, which
has just been cleared.  ERC did this via `erc-display-prompt' prior to
5.6, but it now leaves the prompt alone by default.  (Bug#74518)
---
 lisp/erc/erc.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 7028d0a68cc..c6978728dd6 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -8200,10 +8200,9 @@ erc-send-current-line
                   ;; Fix the buffer if the command didn't kill it
                   (when (buffer-live-p old-buf)
                     (with-current-buffer old-buf
-                      (save-restriction
-                        (widen)
-                        (let ((buffer-modified (buffer-modified-p)))
-                          (set-buffer-modified-p buffer-modified))))))
+                      (setq buffer-undo-list nil)
+                      ;; `set-buffer-modified-p' used to do this here.
+                      (force-mode-line-update))))
 
                 ;; Only when last hook has been run...
                 (run-hook-with-args 'erc-send-completed-hook str)))
-- 
2.47.0


       reply	other threads:[~2024-11-24 23:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87iksc46cq.fsf@tilde.club>
2024-11-24 23:43 ` J.P. [this message]
     [not found] ` <87o724jiz6.fsf@neverwas.me>
2024-11-25  7:19   ` bug#74518: 29.4; ERC 5.6: `undo' regression on Erc 5.6 Alcor via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-02  3:52     ` J.P.
2024-11-24 22:25 Alcor via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='87o724jiz6.fsf__38890.2462714881$1732491867$gmane$org@neverwas.me' \
    --to=jp@neverwas.me \
    --cc=74518@debbugs.gnu.org \
    --cc=alcor@tilde.club \
    --cc=emacs-erc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.