all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Spencer Baugh <sbaugh@janestreet.com>, 73172@debbugs.gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#73172: [PATCH] Move to start of current header in diff-{file, hunk}-prev
Date: Fri, 13 Sep 2024 03:28:43 +0300	[thread overview]
Message-ID: <4dbaac34-a1cc-4d4c-839c-bda74001e4b5@gutov.dev> (raw)
In-Reply-To: <ierh6anpd2z.fsf@janestreet.com>

Hi Spencer and Stefan,

On 10/09/2024 21:40, Spencer Baugh via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:

> (The following change is split across two patches; the first one, "move
> easy-mmode", fixes an unrelated FIXME, which makes the diff in the
> second patch simpler)
> 
> If point was after a file or hunk header, the diff-file-prev and
> diff-hunk-prev commands would move to the start of that header.
> But if point was *within* the header, they would not move, and
> would report "No previous file" or "No previous hunk".  This
> differs from the behavior of most other movement commands,
> e.g. backward-sexp or backward-sentence.
> 
> This commit fixes diff-file-prev and diff-hunk-prev, as well as
> other easy-mmode-define-navigation BASE-prev commands.  Now
> these commands move to the start of the containing "thing" just
> like other movement commands.
> 
> * lisp/emacs-lisp/easy-mmode.el (easy-mmode--prev): Move to
> start of current match first.
> 
> Also discussed here:
> https://lists.gnu.org/archive/html/help-gnu-emacs/2024-08/msg00367.html

Patch#1 seems unequivocally a good thing (easier code iteration) and 
patch#2 seems good on balance.

It does introduce some backward incompatibility in rare cases where I 
have probably internalized the current behavior already -- for example 
in the vc-print-root-log output pressing 'p' while on the first line 
somewhere between the initial '*' and the end of the date dings with "No 
previous log message", and how will move to bol.

But it might be more consistent anyway, given that the there is no ding 
already if you start out inside the summary text.

There aren't many in-tree callers of easy-mmode-define-navigation 
(diff-mode, log-view, smerge and, uh, cvs-status), and few 3rd party 
callers, so this seems low-impact. diff-hl-mode is not affected either 
because it only uses diff-hunk-next, not diff-hunk-prev.





  reply	other threads:[~2024-09-13  0:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 18:40 bug#73172: [PATCH] Move to start of current header in diff-{file, hunk}-prev Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-13  0:28 ` Dmitry Gutov [this message]
2024-09-19 18:41   ` Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4dbaac34-a1cc-4d4c-839c-bda74001e4b5@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=73172@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.