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.

Full log


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)]

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

Previous Next


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