GNU bug report logs - #44617
26.3; diff-mode ignores diff-switches

Previous Next

Package: emacs;

Reported by: Francesco Potortì <pot <at> gnu.org>

Date: Fri, 13 Nov 2020 12:12:01 UTC

Severity: normal

Tags: moreinfo

Found in version 26.3

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 44617 in the body.
You can then email your comments to 44617 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#44617; Package emacs. (Fri, 13 Nov 2020 12:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Francesco Potortì <pot <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 13 Nov 2020 12:12:01 GMT) Full text and rfc822 format available.

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

From: Francesco Potortì <pot <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; diff-mode ignores diff-switches
Date: Fri, 13 Nov 2020 13:11:44 +0100
In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2020-05-17, modified by Debian built on x86-csail-01

diff-mode relies on the diff-command variables defined in diff.el, but
ignores diff-switches

I think this is a bug




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Fri, 13 Nov 2020 16:12:01 GMT) Full text and rfc822 format available.

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

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Francesco Potortì <pot <at> gnu.org>
Cc: 44617 <at> debbugs.gnu.org
Subject: Re: bug#44617: 26.3; diff-mode ignores diff-switches
Date: Fri, 13 Nov 2020 17:11:29 +0100
Francesco Potortì <pot <at> gnu.org> writes:

> In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
>  of 2020-05-17, modified by Debian built on x86-csail-01
>
> diff-mode relies on the diff-command variables defined in diff.el, but
> ignores diff-switches
>
> I think this is a bug

I have checked Emacs 26.3 and Emacs 27.1 and I can't reproduce this bug.
Do you have a more detailed recipe to reproduce the problem starting
from emacs -Q?  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Fri, 13 Nov 2020 16:32:01 GMT) Full text and rfc822 format available.

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

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Daniel Mart?n via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 44617 <at> debbugs.gnu.org, Francesco Potortì <pot <at> gnu.org>
Subject: Re: bug#44617: 26.3; diff-mode ignores diff-switches
Date: Fri, 13 Nov 2020 17:31:23 +0100
Daniel Martín via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
> I have checked Emacs 26.3 and Emacs 27.1 and I can't reproduce this bug.
> Do you have a more detailed recipe to reproduce the problem starting
> from emacs -Q?  Thanks.

Never mind, I assumed you were talking about the diff command.  You are
right, diff-mode doesn't use the diff-switches variable.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Fri, 13 Nov 2020 16:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Sat, 14 Nov 2020 16:26:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Francesco Potortì <pot <at> gnu.org>
Cc: 44617 <at> debbugs.gnu.org
Subject: Re: bug#44617: 26.3; diff-mode ignores diff-switches
Date: Sat, 14 Nov 2020 17:25:17 +0100
Francesco Potortì <pot <at> gnu.org> writes:

> diff-mode relies on the diff-command variables defined in diff.el, but
> ignores diff-switches
>
> I think this is a bug

Do you mean the `diff-refresh-hunk' command?  I does indeed ignore
`diff-switches', but that's because it tries to keep the style of the
diff consistent:

(defun diff-refresh-hunk (&optional ignore-whitespace)
  "Re-diff the current hunk."
  (interactive)
  (let* ((char-offset (- (point) (diff-beginning-of-hunk t)))
	 (opt-type (pcase (char-after)
                     (?@ "-u")
                     (?* "-c")))

Which I think sounds like the correct design.  What's the use case you
have for diff-switches where you'd want this command to heed diff-switches?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Sat, 05 Dec 2020 21:06:02 GMT) Full text and rfc822 format available.

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

From: Francesco Potortì <pot <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 44617 <at> debbugs.gnu.org
Subject: Re: bug#44617: 26.3; diff-mode ignores diff-switches
Date: Sat, 05 Dec 2020 22:05:19 +0100
>> diff-mode relies on the diff-command variables defined in diff.el, but
>> ignores diff-switches
>>
>> I think this is a bug
>
>Do you mean the `diff-refresh-hunk' command?

No, it's a different issue.

>What's the use case you have for diff-switches where you'd want this
>command to heed diff-switches?

I have two use cases.

1) When using dired-diff (hit = in a dired buffer) diff-switches is not used.

2) Same is when using vc-diff (C-x v =) in a VC buffer.

Apparently case 2) is a bug, because the docs of vc-diff-switches says
that diff-switches should be used.  Case 1) could simply be unexpected
behaviour.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Sun, 06 Dec 2020 13:52:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Francesco Potortì <pot <at> gnu.org>
Cc: 44617 <at> debbugs.gnu.org
Subject: Re: bug#44617: 26.3; diff-mode ignores diff-switches
Date: Sun, 06 Dec 2020 14:51:08 +0100
Francesco Potortì <pot <at> gnu.org> writes:

>>What's the use case you have for diff-switches where you'd want this
>>command to heed diff-switches?
>
> I have two use cases.
>
> 1) When using dired-diff (hit = in a dired buffer) diff-switches is not used.
>
> 2) Same is when using vc-diff (C-x v =) in a VC buffer.
>
> Apparently case 2) is a bug, because the docs of vc-diff-switches says
> that diff-switches should be used.  Case 1) could simply be unexpected
> behaviour.

I 1), diff-switches is always used, so I can't reproduce that problem at
all -- changing diff-switches and using the `=' command reflects the
changed switches.  Do you have that command rebound, by any chance?

As for 2), `diff-switches' is indeed used, but only when `vc-diff-switches'
is nil, as the doc string says:

--
When running diff under a given BACKEND, VC uses the first
non-nil value of ‘vc-BACKEND-diff-switches’, ‘vc-diff-switches’,
and ‘diff-switches’, in that order. 
--

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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Dec 2020 13:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Sun, 06 Dec 2020 23:40:01 GMT) Full text and rfc822 format available.

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

From: Francesco Potortì <pot <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 44617 <at> debbugs.gnu.org
Subject: Re: bug#44617: 26.3; diff-mode ignores diff-switches
Date: Mon, 07 Dec 2020 00:39:48 +0100
Lars,

I rechecked everything and indeed I was wrong for both cases.  I am
sorry for the false alarm.

Please close this bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44617; Package emacs. (Sun, 06 Dec 2020 23:42:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Francesco Potortì <pot <at> gnu.org>
Cc: 44617 <at> debbugs.gnu.org
Subject: Re: bug#44617: 26.3; diff-mode ignores diff-switches
Date: Mon, 07 Dec 2020 00:41:38 +0100
Francesco Potortì <pot <at> gnu.org> writes:

> I rechecked everything and indeed I was wrong for both cases.  I am
> sorry for the false alarm.

No problem.  :-)

> Please close this bug.

Done.

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




bug closed, send any further explanations to 44617 <at> debbugs.gnu.org and Francesco Potortì <pot <at> gnu.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Dec 2020 23:43:01 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, 04 Jan 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 105 days ago.

Previous Next


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