unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: 31204@debbugs.gnu.org
Subject: bug#31204: 25.3; Make word motion more customizable
Date: Wed, 18 May 2022 14:03:42 +0200	[thread overview]
Message-ID: <875ym3dp41.fsf@gnus.org> (raw)
In-Reply-To: <CAP_d_8UvVdeVngKSe1A2_mB5p5wHhhhWLzTP7VnAs=jZQqOxpg@mail.gmail.com> (Yuri Khan's message of "Wed, 18 Apr 2018 15:55:16 +0700")

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





  reply	other threads:[~2022-05-18 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18  8:55 bug#31204: 25.3; Make word motion more customizable Yuri Khan
2022-05-18 12:03 ` Lars Ingebrigtsen [this message]
2022-06-15 15:03   ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=875ym3dp41.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=31204@debbugs.gnu.org \
    --cc=yuri.v.khan@gmail.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 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).