GNU bug report logs - #25400
M-p in diff-mode jumps too far

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Date: Sun, 8 Jan 2017 21:22:01 UTC

Severity: normal

Tags: patch

Merged with 25105

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: 25400 <at> debbugs.gnu.org
Subject: bug#25400: M-p in diff-mode jumps too far
Date: Sun, 08 Jan 2017 23:34:52 -0500
>> In a buffer with more than one hunk, if I'm in the middle of hunk number
>> N, diff-hunk-prev (usually bound to M-p) jumps to the header of hunk
>> number N-1 rather than to the header of hunk N.
>> 
>> This is contrary to the usual behavior of Emacs's navigation commands.

> Implemented in 2c8a7e5 (bug#17544). Apparently it was intended.

> https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00222.html

> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25105

Maybe it's OK to change the behavior of `diff-hunk-prev` this way when
called from Elisp (I still find it odd, but it might work better for
the callers), but it's clearly not a good idea for M-p to behave
this way.

As pointed out elsewhere, it's particularly obnoxious from EOB (in which
case, you're not really "within N" but you're virtually on "the header
of the non-existent hunk N+1", so going to the header of N-1 is really
wrong).

I also dislike the fact that M-n doesn't let me get to EOB.


        Stefan




This bug report was last modified 8 years and 172 days ago.

Previous Next


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