unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38370: 26.2; Confusing message 'Hunk already applied' in diff-mode
@ 2019-11-25 13:11 ndame
  2020-08-20 14:54 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: ndame @ 2019-11-25 13:11 UTC (permalink / raw)
  To: 38370

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]


Recently I turned on next-error-follow-minor-mode in diff buffers, so
the source context is shown automatically as I move around in the diff
buffer.

It works well, but after a while I noticed there is always a 'Hunk
already applied' message in the echo area.

I investigated and turns out the message comes from here:

    next-error
    next-error-function
    diff-next-error
    diff-goto-source
    diff-hunk-status-msg


So goto source prints this message every time, even if one just
presses RET in a diff buffer.

I found it confusing, because I was just moving around, I didn't try
to apply anything, so this message wasn't really informative, it
stopped my flow with its unwanted appearance and reference to an other
operation.

Shouldn't this 'Hunk already applied' message appear only if the user
actually tries to apply something?

[-- Attachment #2: Type: text/html, Size: 1078 bytes --]

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

* bug#38370: 26.2; Confusing message 'Hunk already applied' in diff-mode
  2019-11-25 13:11 bug#38370: 26.2; Confusing message 'Hunk already applied' in diff-mode ndame
@ 2020-08-20 14:54 ` Lars Ingebrigtsen
  2020-08-20 15:29   ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-20 14:54 UTC (permalink / raw)
  To: ndame; +Cc: 38370

ndame <emacsuser@freemail.hu> writes:

> Recently I turned on next-error-follow-minor-mode in diff buffers, so
> the source context is shown automatically as I move around in the diff
> buffer.
>
> It works well, but after a while I noticed there is always a 'Hunk
> already applied' message in the echo area.

[...]

> I found it confusing, because I was just moving around, I didn't try
> to apply anything, so this message wasn't really informative, it
> stopped my flow with its unwanted appearance and reference to an other
> operation.
>
> Shouldn't this 'Hunk already applied' message appear only if the user
> actually tries to apply something?

Yeah, I've always found that messaging to be confusing and worrisome, as
if I had entered a command to change the source code instead of just
moving around in it.

I've now removed it.

Looking at the code in diff-mode, as far as I can see, the actual
"apply" functions will still output the hunk status.

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





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

* bug#38370: 26.2; Confusing message 'Hunk already applied' in diff-mode
  2020-08-20 14:54 ` Lars Ingebrigtsen
@ 2020-08-20 15:29   ` Stefan Monnier
  2020-08-20 15:43     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2020-08-20 15:29 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 38370, ndame

> Yeah, I've always found that messaging to be confusing and worrisome, as
> if I had entered a command to change the source code instead of just
> moving around in it.

Hmm... I liked having that information without having to remember how to
run `diff-test-hunk`.  I agree it was more harmful than useful when moving
around as in the OP's case, but it was handy when using RET.


        Stefan






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

* bug#38370: 26.2; Confusing message 'Hunk already applied' in diff-mode
  2020-08-20 15:29   ` Stefan Monnier
@ 2020-08-20 15:43     ` Lars Ingebrigtsen
  2020-08-20 23:32       ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-20 15:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 38370, ndame

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Yeah, I've always found that messaging to be confusing and worrisome, as
>> if I had entered a command to change the source code instead of just
>> moving around in it.
>
> Hmm... I liked having that information without having to remember how to
> run `diff-test-hunk`.  I agree it was more harmful than useful when moving
> around as in the OP's case, but it was handy when using RET.

Hm...  perhaps we should just change the message instead so it doesn't
sound so much like a warning?  For instance...  Uhm...  No, I can't
think of anything short that can't be interpreted as warning right
now...

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





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

* bug#38370: 26.2; Confusing message 'Hunk already applied' in diff-mode
  2020-08-20 15:43     ` Lars Ingebrigtsen
@ 2020-08-20 23:32       ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2020-08-20 23:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 38370, ndame, Stefan Monnier

>>> Yeah, I've always found that messaging to be confusing and worrisome, as
>>> if I had entered a command to change the source code instead of just
>>> moving around in it.
>>
>> Hmm... I liked having that information without having to remember how to
>> run `diff-test-hunk`.  I agree it was more harmful than useful when moving
>> around as in the OP's case, but it was handy when using RET.
>
> Hm...  perhaps we should just change the message instead so it doesn't
> sound so much like a warning?  For instance...  Uhm...  No, I can't
> think of anything short that can't be interpreted as warning right
> now...

Maybe add this message to the default value of 'ignored-messages'
from bug#42865.  Then it could be easily removed with

  (delete-from-list 'ignored-messages "^Hunk already applied")





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

end of thread, other threads:[~2020-08-20 23:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 13:11 bug#38370: 26.2; Confusing message 'Hunk already applied' in diff-mode ndame
2020-08-20 14:54 ` Lars Ingebrigtsen
2020-08-20 15:29   ` Stefan Monnier
2020-08-20 15:43     ` Lars Ingebrigtsen
2020-08-20 23:32       ` Juri Linkov

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