GNU bug report logs - #77946
master d283db57733: Fix window selection after log-edit-show-diff, again

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 20 Apr 2025 17:56:02 UTC

Severity: normal

Fixed in version 31.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77946 in the body.
You can then email your comments to 77946 AT debbugs.gnu.org in the normal way.

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, bug-gnu-emacs <at> gnu.org:
bug#77946; Package emacs. (Sun, 20 Apr 2025 17:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to spwhitton <at> spwhitton.name, bug-gnu-emacs <at> gnu.org. (Sun, 20 Apr 2025 17:56:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: master d283db57733: Fix window selection after log-edit-show-diff,
 again
Date: Sun, 20 Apr 2025 20:53:00 +0300
> diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
> index 0da0b90975c..3c3288777c8 100644
> --- a/lisp/vc/log-edit.el
> +++ b/lisp/vc/log-edit.el
> @@ -857,7 +857,8 @@ vc-log-fileset
>  (defun log-edit-diff-fileset ()
>    "Display diffs for the files to be committed."
>    (interactive)
> -  (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset)))
> +  (save-selected-window
> +    (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset))))

This change broke the command 'log-edit-show-diff' ('C-c C-d').
Previously it selected the diff window.  Now it always stays in the vc-log window.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77946; Package emacs. (Sun, 20 Apr 2025 19:24:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 77946 <at> debbugs.gnu.org, spwhitton <at> spwhitton.name
Subject: Re: bug#77946: master d283db57733: Fix window selection after
 log-edit-show-diff, again
Date: Sun, 20 Apr 2025 22:22:54 +0300
> Cc: Sean Whitton <spwhitton <at> spwhitton.name>
> From: Juri Linkov <juri <at> linkov.net>
> Date: Sun, 20 Apr 2025 20:53:00 +0300
> 
> > diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
> > index 0da0b90975c..3c3288777c8 100644
> > --- a/lisp/vc/log-edit.el
> > +++ b/lisp/vc/log-edit.el
> > @@ -857,7 +857,8 @@ vc-log-fileset
> >  (defun log-edit-diff-fileset ()
> >    "Display diffs for the files to be committed."
> >    (interactive)
> > -  (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset)))
> > +  (save-selected-window
> > +    (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset))))
> 
> This change broke the command 'log-edit-show-diff' ('C-c C-d').
> Previously it selected the diff window.  Now it always stays in the vc-log window.

Isn't it a bug in log-edit-show-diff?  Why does it assume that it will
be put in the diff window?  It should instead switch there.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77946; Package emacs. (Mon, 21 Apr 2025 01:54:09 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77946 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#77946: master d283db57733: Fix window selection after
 log-edit-show-diff, again
Date: Mon, 21 Apr 2025 09:53:10 +0800
Hello,

On Sun 20 Apr 2025 at 10:22pm +03, Eli Zaretskii wrote:

>> Cc: Sean Whitton <spwhitton <at> spwhitton.name>
>> From: Juri Linkov <juri <at> linkov.net>
>> Date: Sun, 20 Apr 2025 20:53:00 +0300
>>
>> > diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
>> > index 0da0b90975c..3c3288777c8 100644
>> > --- a/lisp/vc/log-edit.el
>> > +++ b/lisp/vc/log-edit.el
>> > @@ -857,7 +857,8 @@ vc-log-fileset
>> >  (defun log-edit-diff-fileset ()
>> >    "Display diffs for the files to be committed."
>> >    (interactive)
>> > -  (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset)))
>> > +  (save-selected-window
>> > +    (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset))))
>>
>> This change broke the command 'log-edit-show-diff' ('C-c C-d').
>> Previously it selected the diff window.  Now it always stays in the vc-log window.
>
> Isn't it a bug in log-edit-show-diff?  Why does it assume that it will
> be put in the diff window?  It should instead switch there.

Yes, I think you're basically right, but I think we should have two
things:

- a command, bound to C-c C-d, that both displays and selects the window
- a function, an option for log-edit-hook, that only displays the window

So the changes required are:

- write a new command that both dispalys and selects the window, bind it
  to C-c C-d

- add log-edit-show-diff to the customisation options for log-edit-hook.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77946; Package emacs. (Mon, 21 Apr 2025 06:54:06 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77946 <at> debbugs.gnu.org
Subject: Re: bug#77946: master d283db57733: Fix window selection after
 log-edit-show-diff, again
Date: Mon, 21 Apr 2025 09:28:11 +0300
>>> > diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
>>> > index 0da0b90975c..3c3288777c8 100644
>>> > --- a/lisp/vc/log-edit.el
>>> > +++ b/lisp/vc/log-edit.el
>>> > @@ -857,7 +857,8 @@ vc-log-fileset
>>> >  (defun log-edit-diff-fileset ()
>>> >    "Display diffs for the files to be committed."
>>> >    (interactive)
>>> > -  (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset)))
>>> > +  (save-selected-window
>>> > +    (vc-diff nil nil (list log-edit-vc-backend vc-log-fileset))))
>>>
>>> This change broke the command 'log-edit-show-diff' ('C-c C-d').
>>> Previously it selected the diff window.  Now it always stays in the vc-log window.
>>
>> Isn't it a bug in log-edit-show-diff?  Why does it assume that it will
>> be put in the diff window?  It should instead switch there.
>
> Yes, I think you're basically right, but I think we should have two
> things:
>
> - a command, bound to C-c C-d, that both displays and selects the window
> - a function, an option for log-edit-hook, that only displays the window
>
> So the changes required are:
>
> - write a new command that both dispalys and selects the window, bind it
>   to C-c C-d
>
> - add log-edit-show-diff to the customisation options for log-edit-hook.

Please note that the decision whether to select the window
can be customized by the users with 'post-command-select-window'
in 'display-buffer-alist'.  So preferably the commands should just
call the plain 'display-buffer' or 'pop-to-buffer'.  I suppose
for the required changes above you meant using 'pop-to-buffer'
for the first and 'display-buffer' for the second.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77946; Package emacs. (Tue, 22 Apr 2025 00:24:01 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77946 <at> debbugs.gnu.org
Subject: Re: bug#77946: master d283db57733: Fix window selection after
 log-edit-show-diff, again
Date: Tue, 22 Apr 2025 08:22:55 +0800
Hello,

On Mon 21 Apr 2025 at 09:28am +03, Juri Linkov wrote:

> Please note that the decision whether to select the window
> can be customized by the users with 'post-command-select-window'
> in 'display-buffer-alist'.  So preferably the commands should just
> call the plain 'display-buffer' or 'pop-to-buffer'.  I suppose
> for the required changes above you meant using 'pop-to-buffer'
> for the first and 'display-buffer' for the second.

Thanks for the pointer.  I'll try to figure out an optimal solution.

-- 
Sean Whitton




Reply sent to Sean Whitton <spwhitton <at> spwhitton.name>:
You have taken responsibility. (Tue, 29 Apr 2025 02:05:01 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Tue, 29 Apr 2025 02:05:02 GMT) Full text and rfc822 format available.

Message #22 received at 77946-done <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Juri Linkov <juri <at> linkov.net>, 77946-done <at> debbugs.gnu.org
Subject: Re: bug#77946: master d283db57733: Fix window selection after
 log-edit-show-diff, again
Date: Tue, 29 Apr 2025 10:03:50 +0800
Version: 31.1

Hello,

This should be fixed now.  Thanks again for the discussion.

-- 
Sean Whitton




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 May 2025 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 9 days ago.

Previous Next


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