GNU bug report logs - #49774
27.1; if diff commands finds no differences then do not pop up a window

Previous Next

Package: emacs;

Reported by: ndame <laszlomail <at> protonmail.com>

Date: Thu, 29 Jul 2021 17:01:02 UTC

Severity: normal

Tags: wontfix

Found in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 49774 in the body.
You can then email your comments to 49774 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 bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Thu, 29 Jul 2021 17:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ndame <laszlomail <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 29 Jul 2021 17:01:02 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: "scame via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Thu, 29 Jul 2021 16:59:18 +0000
[Message part 1 (text/plain, inline)]
When diff exit code is zero and there are no differences then a window pops up showing output like "Diff finished (no differences)" and the user has to dismiss this useless window.

If there are no differences then emacs should just show this in a message instead of popping up a window with not useful content.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 01:19:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: ndame <laszlomail <at> protonmail.com>, 49774 <at> debbugs.gnu.org
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Fri, 30 Jul 2021 04:18:21 +0300
On 29.07.2021 19:59, ndame via Bug reports for GNU Emacs, the Swiss army 
knife of text editors wrote:
> When diff exit code is zero and there are no differences then a window 
> pops up showing output like "Diff finished (no differences)" and the 
> user has to dismiss this useless window.
> 
> If there are no differences then emacs should just show this in a 
> message instead of popping up a window with not useful content.

That would require it to wait until Diff has finished running before 
showing the window. Currently 'M-x diff' works asynchronously, which has 
its benefits.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 04:20:02 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 49774 <at> debbugs.gnu.org
Subject: Re: bug#49774: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Fri, 30 Jul 2021 04:18:51 +0000
>
> That would require it to wait until Diff has finished running before
> showing the window. Currently 'M-x diff' works asynchronously, which has
> its benefits.

If exit status is zero then diff should restore  the previous window config
automatically and show the message.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 10:04:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ndame <laszlomail <at> protonmail.com>
Cc: 49774 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Fri, 30 Jul 2021 12:03:29 +0200
ndame <laszlomail <at> protonmail.com> writes:

>> That would require it to wait until Diff has finished running before
>> showing the window. Currently 'M-x diff' works asynchronously, which has
>> its benefits.
>
> If exit status is zero then diff should restore  the previous window config
> automatically and show the message.

This is what `M-x man' does (when it turns out that the manual page
doesn't exist), and people really dislike that, too (the "flickering"
has been reported as a bug multiple times).

So I don't think we want to extend that user experience in Emacs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 11:20:02 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 49774 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#49774: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Fri, 30 Jul 2021 11:19:02 +0000
>
> This is what `M-x man' does (when it turns out that the manual page
> doesn't exist), and people really dislike that, too (the "flickering"
> has been reported as a bug multiple times).
>
> So I don't think we want to extend that user experience in Emacs.
>

The other possibility is not popping up the diff window instantly, but
waiting for the first output to arrive. If there is no difference
then no output is coming and exit status 0 tells us we can print the
message.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 11:25:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ndame <laszlomail <at> protonmail.com>
Cc: 49774 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Fri, 30 Jul 2021 13:24:29 +0200
ndame <laszlomail <at> protonmail.com> writes:

> The other possibility is not popping up the diff window instantly, but
> waiting for the first output to arrive.

That's also been discussed extensively during the M-x man wars, and it's
a horrible UX -- having windows popping up asynchronously at some later
point is disruptive and confusing, so we don't do that.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 11:48:01 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 49774 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#49774: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Fri, 30 Jul 2021 11:47:13 +0000
>
> That's also been discussed extensively during the M-x man wars, and it's
> a horrible UX -- having windows popping up asynchronously at some later
> point is disruptive and confusing, so we don't do that.
>

Diff output arrives pretty much instantly, the user does not even lift his
fingers from executing the diff key binding when the beginning of the output is
already there.

And the user expects something to happen when invoking diff, either seeing the
diff or getting the message there is no diff, so waiting for a fraction of a second
before popping up a window is not a real problem, because the user is waiting for the
result anyway.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 11:49:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ndame <laszlomail <at> protonmail.com>
Cc: 49774 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Fri, 30 Jul 2021 13:48:42 +0200
ndame <laszlomail <at> protonmail.com> writes:

> Diff output arrives pretty much instantly

Depends on many things -- the files may be on remote systems, for
instance.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 11:59:01 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 49774 <at> debbugs.gnu.org
Subject: Re: bug#49774: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Fri, 30 Jul 2021 11:58:08 +0000
>
> > Diff output arrives pretty much instantly
>
> Depends on many things -- the files may be on remote systems, for
> instance.

Okay, then how about adding a configurable delay before popping up the diff window?
E.g. if no results arrive within, say, 1 second then a timer pops up the
window, so the user knows the diff is in progress, but slow.

This takes care of the slow remote system problem and the timer would practically
never  fire on a local machine where the filesystem response is quick.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 12:45:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: ndame <laszlomail <at> protonmail.com>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 49774 <at> debbugs.gnu.org
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Fri, 30 Jul 2021 15:44:49 +0300
On 30.07.2021 14:58, ndame via Bug reports for GNU Emacs, the Swiss army 
knife of text editors wrote:
> Okay, then how about adding a configurable delay before popping up the diff window?
> E.g. if no results arrive within, say, 1 second then a timer pops up the
> window, so the user knows the diff is in progress, but slow.

I was going to suggest a user option that switches to the synchronous 
mode of operation, but the above sounds probably even better.

As long as there is someone willing to implement this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 13:20:02 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 49774 <at> debbugs.gnu.org
Subject: Re: bug#49774: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Fri, 30 Jul 2021 13:19:29 +0000
>
> I was going to suggest a user option that switches to the synchronous
> mode of operation, but the above sounds probably even better.

Or there can be an option like  diff-show-window-only-if-difference-exists
which can be nil for the current behavior and t if the user wants to see
no window if there is no difference, just a message.

This may be the simplest solution, because then the user can simply set
it according his working conditions. If he works with remote files he
sets it to nil, if he works with files on his local machine then it can
be set to t.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 18:29:01 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: Re: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Fri, 30 Jul 2021 18:28:11 +0000
[Message part 1 (text/plain, inline)]
> If there are no differences then emacs should just show this in a message instead of popping up a window with not useful content.

Just a simple implementation with advices for the time being for those who prefer this:

(advice-add 'diff :around 'my-diff)

(defun my-diff (orig-fun &rest args)
(flet ((display-buffer (buf) buf))
(apply orig-fun args)))

(advice-add 'diff-sentinel :after 'my-diff-sentinel)

(defun my-diff-sentinel (code &rest args)
(if (equal code 0)
(message "No differences.")
(display-buffer (current-buffer))))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Fri, 30 Jul 2021 18:49:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: ndame <laszlomail <at> protonmail.com>, 49774 <at> debbugs.gnu.org
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Fri, 30 Jul 2021 20:47:59 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> I was going to suggest a user option that switches to the synchronous
> mode of operation, but the above sounds probably even better.

A general thing for popping up asynchronous buffers that users can
control?  Yeah, that could be nice.  We could have a user option that
says whether to pop up immediately, later but only on success, always,
run the command synchronously...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Sat, 31 Jul 2021 22:11:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: ndame <laszlomail <at> protonmail.com>, 49774 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Sun, 01 Aug 2021 00:06:52 +0300
>> I was going to suggest a user option that switches to the synchronous
>> mode of operation, but the above sounds probably even better.
>
> A general thing for popping up asynchronous buffers that users can
> control?  Yeah, that could be nice.  We could have a user option that
> says whether to pop up immediately, later but only on success, always,
> run the command synchronously...

Like async-shell-command-display-buffer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Sat, 31 Jul 2021 22:12:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: ndame <laszlomail <at> protonmail.com>, 49774 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Sun, 01 Aug 2021 00:11:26 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> A general thing for popping up asynchronous buffers that users can
>> control?  Yeah, that could be nice.  We could have a user option that
>> says whether to pop up immediately, later but only on success, always,
>> run the command synchronously...
>
> Like async-shell-command-display-buffer.

Right.  Only...  more.  :-)  (And more general.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Mon, 02 Aug 2021 01:08:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: laszlomail <at> protonmail.com, 49774 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#49774: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Sun, 01 Aug 2021 21:07:11 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > A general thing for popping up asynchronous buffers that users can
  > control?  Yeah, that could be nice.  We could have a user option that
  > says whether to pop up immediately, later but only on success, always,
  > run the command synchronously...

New options like this provide an unending opportunity for increased
featurism, and can make some operations more convenient for some users.
But they won't extend the actual jobs that Emacs can handle.

Those changes are the substantial improvements, so I ask people to
focus their efforts on changes of that kind.


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Mon, 16 Aug 2021 18:30:01 GMT) Full text and rfc822 format available.

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

From: ndame <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: Re: 27.1;
 if diff commands finds no differences then do not pop up a window
Date: Mon, 16 Aug 2021 18:29:07 +0000
[Message part 1 (text/plain, inline)]
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, July 30th, 2021 at 8:28 PM, ndame <laszlomail <at> protonmail.com> wrote:

>> If there are no differences then emacs should just show this in a message instead of popping up a window with not useful content.
>
> Just a simple implementation with advices for the time being for those who prefer this:
>
> (advice-add 'diff :around 'my-diff)
>
> (defun my-diff (orig-fun &rest args)
> (flet ((display-buffer (buf) buf))
> (apply orig-fun args)))
>
> (advice-add 'diff-sentinel :after 'my-diff-sentinel)
>
> (defun my-diff-sentinel (code &rest args)
> (if (equal code 0)
> (message "No differences.")
> (display-buffer (current-buffer))))

The permanent sentinel advice affects non-interactive diffs too (diff-no-select), so a better solution is to add and remove that advice on demand:

(advice-add 'diff :around 'my-diff)

(defun my-diff (orig-fun &rest args)
(advice-add 'diff-sentinel :after 'my-diff-sentinel)
(flet ((display-buffer (buf) buf))
(apply orig-fun args)))

(defun my-diff-sentinel (code &rest args)
(advice-remove 'diff-sentinel 'my-diff-sentinel)
(if (equal code 0)
(message "No differences.")
(display-buffer (current-buffer))))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49774; Package emacs. (Mon, 22 Aug 2022 10:31:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: laszlomail <at> protonmail.com, 49774 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#49774: 27.1; if diff commands finds no differences then do
 not pop up a window
Date: Mon, 22 Aug 2022 12:30:36 +0200
Richard Stallman <rms <at> gnu.org> writes:

> New options like this provide an unending opportunity for increased
> featurism, and can make some operations more convenient for some users.
> But they won't extend the actual jobs that Emacs can handle.

I agree.  This is working as we intend this to work, and people that
prefer Emacs to do something else here can do that with an advice.

So I'm closing this bug report.




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 22 Aug 2022 10:31:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 49774 <at> debbugs.gnu.org and ndame <laszlomail <at> protonmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 22 Aug 2022 10:31:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 19 Sep 2022 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 273 days ago.

Previous Next


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