Subject: bug#50443: Fwd: Flyspell error traversal additions

From: Eli Zaretskii <[email-masked]>
Date: Tue, 07 Sep 2021 08:57:04 +0300

> From: Stefan Kangas <[email-masked]>
> Date: Tue, 7 Sep 2021 02:22:29 +0200
> Cc: roni kallio <[email-masked]>
> 
> This was sent to emacs-devel, but never followed up.  I'm forwarding
> to the bug tracker so that we don't lose track of it.

Thanks.

> Från: Roni Kallio <[email-masked]>
> Date: tors 28 jan. 2021 kl 14:59
> Subject: Flyspell error traversal additions
> To: <[email-masked]>
> 
> 
> While consolidating my spell/syntax checking setup, I noticed that
> flyspell lacks a command to jump to the nearest error that is before the
> point in a buffer.  There exists `flyspell-goto-next-error', which of
> course loops back to beginning when the end of the buffer is reached,
> but no equivalent command for going backwards.
> 
> I have attached a patch that implements backwards traversal, making sure
> it acts analogous to `flyspell-goto-next-error'.

Thanks.

> IMO the best course of action would be to modify
> `flyspell-goto-next-error' to accept a prefix argument.  The prefix
> would control the direction and number of jumps performed; negative
> arguments would jump backwards -ARG errors (by calling
> flyspell-goto-previous-error), while positive arguments would jump
> forwards ARG errors.  This would be similar to how commands like
> `forward-word' handle prefix arguments.  This would allow us to leave
> the mode-map unchanged, but still distribute the improvement to all
> users.

Yes, I agree.  Can you change the patch to work this way?

Also, the patch is long enough to require a copyright assignment from
you.  Would you be willing to start your legal paperwork at this time,
so we could accept your contribution when it is complete?

> I'd like to open a discussion on whether it would be feasible to
> have a key binding in `flyspell-mode-map' for this command.  For
> reference, the bindings currently are:
> 
> C-;   -- flyspell-auto-correct-previous-word
> C-,   -- flyspell-goto-next-error
> C-.   -- flyspell-auto-correct-word
> C-c $ -- flyspell-correct-word-before-point

I'm not sure these won't conflict with other minor modes.  And these
keys are not available on text-mode frames, which is a disadvantage.
But let's hear what others think.