GNU bug report logs - #80049
30.1.90; diff-undo is not affected by remapping undo to undo-only

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Sun, 21 Dec 2025 16:13:03 UTC

Severity: normal

Found in version 30.1.90

To reply to this bug, email your comments to 80049 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to spwhitton <at> spwhitton.name, juri <at> linkov.net, bug-gnu-emacs <at> gnu.org:
bug#80049; Package emacs. (Sun, 21 Dec 2025 16:13:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Spencer Baugh <sbaugh <at> janestreet.com>:
New bug report received and forwarded. Copy sent to spwhitton <at> spwhitton.name, juri <at> linkov.net, bug-gnu-emacs <at> gnu.org. (Sun, 21 Dec 2025 16:13:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1.90; diff-undo is not affected by remapping undo to undo-only
Date: Sun, 21 Dec 2025 11:12:09 -0500
I have (global-set-key [remap undo] 'undo-only) in my config, because I
like C-/ and other undo bindings to run undo-only.

But this doesn't affect diff-undo, which is a separate command.

There's not even a diff-undo-only available to separately rebind.


In GNU Emacs 30.1.90 (build 90, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2025-12-04 built on
 igm-qws-u22796a
Repository revision: 88878f209ee0f1699952b1ba5fb829c502f5959f
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Rocky Linux 8.10 (Green Obsidian)

Configured using:
 'configure --with-x-toolkit=lucid --without-gpm --without-gconf
 --without-selinux --without-imagemagick --with-modules --with-gif=no
 --with-cairo --with-rsvg --without-compress-install --with-tree-sitter
 --with-native-compilation=aot
 PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSYSTEMD
LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM
XINPUT2 XPM LUCID ZLIB




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80049; Package emacs. (Sun, 21 Dec 2025 17:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 80049 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: 80049 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#80049: 30.1.90; diff-undo is not affected by remapping undo
 to undo-only
Date: Sun, 21 Dec 2025 19:16:42 +0200
> I have (global-set-key [remap undo] 'undo-only) in my config, because I
> like C-/ and other undo bindings to run undo-only.
>
> But this doesn't affect diff-undo, which is a separate command.
>
> There's not even a diff-undo-only available to separately rebind.

I didn't know that 'undo-no-redo' is a user option.
It looks like you could just customize it to t
instead of remapping commands.

If this works, then we could remove/deprecate the command
'diff-undo' and replace it with another option similar
to 'undo-no-redo', e.g. 'undo-read-only'.  Then diff-mode
could set it buffer-local in diff buffers.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80049; Package emacs. (Sun, 21 Dec 2025 17:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 80049 <at> debbugs.gnu.org (full text, mbox):

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 80049 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#80049: 30.1.90; diff-undo is not affected by remapping undo
 to undo-only
Date: Sun, 21 Dec 2025 12:35:00 -0500
Juri Linkov <juri <at> linkov.net> writes:

>> I have (global-set-key [remap undo] 'undo-only) in my config, because I
>> like C-/ and other undo bindings to run undo-only.
>>
>> But this doesn't affect diff-undo, which is a separate command.
>>
>> There's not even a diff-undo-only available to separately rebind.
>
> I didn't know that 'undo-no-redo' is a user option.
> It looks like you could just customize it to t
> instead of remapping commands.

Oh, perfect!  I'll just set that, indeed.  IMO that resolves this bug.

> If this works, then we could remove/deprecate the command
> 'diff-undo' and replace it with another option similar
> to 'undo-no-redo', e.g. 'undo-read-only'.  Then diff-mode
> could set it buffer-local in diff buffers.

Hmm, I think it makes sense to have a separate "undo-ignore-read-only"
command, no need to have a separate variable to control that.  Setting
undo-no-redo would affect that just fine.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80049; Package emacs. (Sun, 21 Dec 2025 17:49:01 GMT) Full text and rfc822 format available.

Message #14 received at 80049 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Juri Linkov <juri <at> linkov.net>, Spencer Baugh <sbaugh <at> janestreet.com>,
 80049 <at> debbugs.gnu.org
Subject: Re: bug#80049: 30.1.90; diff-undo is not affected by remapping undo
 to undo-only
Date: Sun, 21 Dec 2025 17:48:09 +0000
Hello,

On Sun 21 Dec 2025 at 12:35pm -05, Spencer Baugh wrote:

> Juri Linkov <juri <at> linkov.net> writes:
>
>>> I have (global-set-key [remap undo] 'undo-only) in my config, because I
>>> like C-/ and other undo bindings to run undo-only.
>>>
>>> But this doesn't affect diff-undo, which is a separate command.
>>>
>>> There's not even a diff-undo-only available to separately rebind.
>>
>> I didn't know that 'undo-no-redo' is a user option.
>> It looks like you could just customize it to t
>> instead of remapping commands.
>
> Oh, perfect!  I'll just set that, indeed.  IMO that resolves this bug.

Yes, that seems like the solution to this.

>> If this works, then we could remove/deprecate the command
>> 'diff-undo' and replace it with another option similar
>> to 'undo-no-redo', e.g. 'undo-read-only'.  Then diff-mode
>> could set it buffer-local in diff buffers.
>
> Hmm, I think it makes sense to have a separate "undo-ignore-read-only"
> command, no need to have a separate variable to control that.  Setting
> undo-no-redo would affect that just fine.

Yes, that would be much cleaner.

There is a pattern to dired-undo and proced-undo which is that they want
to do the same as diff-undo, and then run something else.
Maybe it would be cleaner to have a undo-hook or undo-read-only-hook ?

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80049; Package emacs. (Sun, 21 Dec 2025 18:31:01 GMT) Full text and rfc822 format available.

Message #17 received at 80049 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Spencer Baugh <sbaugh <at> janestreet.com>, 80049 <at> debbugs.gnu.org
Subject: Re: bug#80049: 30.1.90; diff-undo is not affected by remapping undo
 to undo-only
Date: Sun, 21 Dec 2025 20:27:32 +0200
>>> If this works, then we could remove/deprecate the command
>>> 'diff-undo' and replace it with another option similar
>>> to 'undo-no-redo', e.g. 'undo-read-only'.  Then diff-mode
>>> could set it buffer-local in diff buffers.
>>
>> Hmm, I think it makes sense to have a separate "undo-ignore-read-only"
>> command, no need to have a separate variable to control that.  Setting
>> undo-no-redo would affect that just fine.
>
> Yes, that would be much cleaner.

Agreed.

> There is a pattern to dired-undo and proced-undo which is that they want
> to do the same as diff-undo, and then run something else.
> Maybe it would be cleaner to have a undo-hook or undo-read-only-hook ?

Good idea.  Then maybe when the hook is defined, it should be run
instead of displaying the default message at the end.  Currently
dired-undo and proced-undo first display the default undo message
that is immediately overwritten by their own message.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80049; Package emacs. (Sun, 21 Dec 2025 18:51:01 GMT) Full text and rfc822 format available.

Message #20 received at 80049 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Juri Linkov <juri <at> linkov.net>
Cc: Spencer Baugh <sbaugh <at> janestreet.com>, 80049 <at> debbugs.gnu.org
Subject: Re: bug#80049: 30.1.90; diff-undo is not affected by remapping undo
 to undo-only
Date: Sun, 21 Dec 2025 18:50:40 +0000
Hello,

On Sun 21 Dec 2025 at 08:27pm +02, Juri Linkov wrote:

>> There is a pattern to dired-undo and proced-undo which is that they want
>> to do the same as diff-undo, and then run something else.
>> Maybe it would be cleaner to have a undo-hook or undo-read-only-hook ?
>
> Good idea.  Then maybe when the hook is defined, it should be run
> instead of displaying the default message at the end.  Currently
> dired-undo and proced-undo first display the default undo message
> that is immediately overwritten by their own message.

Well, except that another mode might not care about sending any
'message', and might just do something else.

-- 
Sean Whitton




This bug report was last modified 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.