unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44617: 26.3; diff-mode ignores diff-switches
@ 2020-11-13 12:11 Francesco Potortì
  2020-11-13 16:11 ` Unknown
  2020-11-14 16:25 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: Francesco Potortì @ 2020-11-13 12:11 UTC (permalink / raw)
  To: 44617

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-11-13 12:11 bug#44617: 26.3; diff-mode ignores diff-switches Francesco Potortì
@ 2020-11-13 16:11 ` Unknown
  2020-11-13 16:31   ` Unknown
  2020-11-13 16:31   ` Unknown
  2020-11-14 16:25 ` Lars Ingebrigtsen
  1 sibling, 2 replies; 9+ messages in thread
From: Unknown @ 2020-11-13 16:11 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: 44617

Francesco Potortì <pot@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-11-13 16:11 ` Unknown
@ 2020-11-13 16:31   ` Unknown
  2020-11-13 16:31   ` Unknown
  1 sibling, 0 replies; 9+ messages in thread
From: Unknown @ 2020-11-13 16:31 UTC (permalink / raw)
  To: 44617; +Cc: pot

Daniel Martín via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-11-13 16:11 ` Unknown
  2020-11-13 16:31   ` Unknown
@ 2020-11-13 16:31   ` Unknown
  1 sibling, 0 replies; 9+ messages in thread
From: Unknown @ 2020-11-13 16:31 UTC (permalink / raw)
  To: 44617; +Cc: pot

Daniel Martín via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-11-13 12:11 bug#44617: 26.3; diff-mode ignores diff-switches Francesco Potortì
  2020-11-13 16:11 ` Unknown
@ 2020-11-14 16:25 ` Lars Ingebrigtsen
  2020-12-05 21:05   ` Francesco Potortì
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-14 16:25 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: 44617

Francesco Potortì <pot@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-11-14 16:25 ` Lars Ingebrigtsen
@ 2020-12-05 21:05   ` Francesco Potortì
  2020-12-06 13:51     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Francesco Potortì @ 2020-12-05 21:05 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44617

>> 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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-12-05 21:05   ` Francesco Potortì
@ 2020-12-06 13:51     ` Lars Ingebrigtsen
  2020-12-06 23:39       ` Francesco Potortì
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-06 13:51 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: 44617

Francesco Potortì <pot@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-12-06 13:51     ` Lars Ingebrigtsen
@ 2020-12-06 23:39       ` Francesco Potortì
  2020-12-06 23:41         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Francesco Potortì @ 2020-12-06 23:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44617

Lars,

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

Please close this bug.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#44617: 26.3; diff-mode ignores diff-switches
  2020-12-06 23:39       ` Francesco Potortì
@ 2020-12-06 23:41         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-06 23:41 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: 44617

Francesco Potortì <pot@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-06 23:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 12:11 bug#44617: 26.3; diff-mode ignores diff-switches Francesco Potortì
2020-11-13 16:11 ` Unknown
2020-11-13 16:31   ` Unknown
2020-11-13 16:31   ` Unknown
2020-11-14 16:25 ` Lars Ingebrigtsen
2020-12-05 21:05   ` Francesco Potortì
2020-12-06 13:51     ` Lars Ingebrigtsen
2020-12-06 23:39       ` Francesco Potortì
2020-12-06 23:41         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).