[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31204: 25.3; Make word motion more customizable
From: |
Lars Ingebrigtsen |
Subject: |
bug#31204: 25.3; Make word motion more customizable |
Date: |
Wed, 18 May 2022 14:03:42 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Yuri Khan <yuri.v.khan@gmail.com> writes:
> While trying to make word motion commands (Ctrl+left/right, M-f/b) more
> similar to that implemented in other editors:
>
> http://lists.gnu.org/archive/html/help-gnu-emacs/2018-04/msg00230.html
>
> I encountered a difficulty.
[...]
> Step 1, on the other hand, is not customizable at all.
>
> The specific behavior that I was trying to implement was to find the
> nearest transition:
>
> * from a word character to a non-word character, OR
> * from a non-word non-whitespace character to a word character, OR
> * from a non-word non-whitespace character to a whitespace character.
>
> As an illustration (where ‘|’ specifies word motion stops when going
> left to right):
>
> foo| ***| +++| (|bar|)|
> ^
[...]
> Perhaps it would be nice to have an optional hook for step 1 of
> ‘forward-word’, a function that would take two arguments POS and LIMIT,
> and returning the starting word boundary position from which step 2 would
> then work.
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
I think this sounds like it could be useful. If we added such a hook to
`forward-word', what would the rest of the code look like to make
`C-<right>' work this way?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#31204: 25.3; Make word motion more customizable,
Lars Ingebrigtsen <=