Sorry if this has been discussed before.

Readline "transpose-word" in Bash acts just like Emacs', which means
this is not really a bug, but I have always been annoyed by this
behavior on the command line:

     $ git -b checkout a b
                ^ cursor here; hit M-t (transpose-word), you get:
     $ git -checkout b a b
 
Of course, that's not really DWIM'ing, even though it's acting the same
way Emacs does.

I presume a change in this behavior would annoy people who are used to
it, and plus vary us from Emacs.

I notice the reason it works this way is that rl_transpose_words() calls
rl_forward_word() which uses rl_alphabetic() to find begin/end of word.
This would be easily changed, but I am not proposing a patch because it
would clearly break backward compatibility.

Would an rl_transpose_words_by_whitespace() be a preferred solution?
Folks like me could then just remap M-t to that instead.
 
-- 
   -- bkuhn

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to