help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Skipping words with C-<right> like other editors do


From: Yuri Khan
Subject: Re: Skipping words with C-<right> like other editors do
Date: Wed, 18 Apr 2018 15:59:08 +0700

On Tue, Apr 17, 2018 at 7:09 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>> Why not use find-word-boundary-function-table?
>>
>> Invoking ‘forward-word’ here causes the function registered in
>> ‘find-word-boundary-function-table’ to be called with arguments (13
>> 16), but we wanted to stop at 8. By the time the driver asks if anyone
>> wants off the bus, we’re already way past our stop!
>
> I think this deserves a bug report, then.  You shouldn't need to
> override umpteen commands to provide you own definition of what is a word.

Filed bug#31204.

For personal use, I could probably just override ‘forward-word’ with
advice. ‘backward-word’ and ‘kill-word’ are implemented in terms of
‘forward-word’; ‘left-word’ and ‘right-word’ are implemented in terms
of ‘forward-word’ and ‘backward-word’; and ‘backward-kill-word’ is
implemented in terms of ‘kill-word’; so everything would just follow
suit.

However, I’m a bit wary about making ‘forward-word’ follow that
definition. I have literally no idea how many things will change
behavior if I redefine “word” to mean something more like “token”. For
one, ‘transpose-words’ would then behave like this:

    foo *** +++ (|bar)
    foo *** +++ bar(|)

For some people, this will make sense. For some, probably not.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]