all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Enhance word-based commands?
@ 2003-01-15 19:16 Kai Großjohann
  2003-01-16  7:42 ` Kai Großjohann
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Kai Großjohann @ 2003-01-15 19:16 UTC (permalink / raw)


I find that I like to use word-based commands to move words around in
the buffer.  So when faced with the task of moving some words from one
place to another, I'll intuitively try to use word-based motion to
position point (to spot A, say), then use word-based killing to delete
(well, kill) the phrase, then use word-based motion again to reach the
target spot (B, say), then use C-y to yank.

It turns out that this only works with some restrictions:

If you have reached spot A with M-f, then you must use M-d to kill
and again use M-f to reach spot B.  OTOH, if you have reached spot A
with M-b, then you must use M-DEL to kill and again use M-b to reach
the target spot.

Does this make sense?

The kill is wont to contain whitespace at one end, which causes the
problems.

I think it might help to change the behavior of the word-based
commands, as follows: Right now, M-f positions point after the end of
the next word.  If there are non-word characters at point, those are
skipped first.  I think it might help to change M-f as follows: if
there are non-word characters at point, skip past them but no
further.  The behavior of M-b would be the same: if at a non-word
character, skip past the chunk of non-word characters but no further.

With this change, it would be easy for me to get a kill which has
whitespace on neither end, thus leading to more predictable
behavior.  (The superfluous whitespace at the source location could
be fixed up with M-SPC or M-\, and missing whitespace could be added
to the target location in a similar way.)

What do people think?

It goes without saying that I'm not suggesting to change the default
behavior of Emacs, just to add a new behavior at user option.
-- 
Ambibibentists unite!

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-01-19  2:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-15 19:16 Enhance word-based commands? Kai Großjohann
2003-01-16  7:42 ` Kai Großjohann
2003-01-16 23:54 ` Kim F. Storm
2003-01-17 11:48   ` Kai Großjohann
2003-01-17 15:31     ` Andreas Schwab
2003-01-17  2:56 ` Miles Bader
2003-01-17 11:45   ` Kai Großjohann
2003-01-17  9:22 ` Richard Stallman
2003-01-17 11:44   ` Kai Großjohann
2003-01-17 13:53     ` Kim F. Storm
2003-01-19  2:18       ` Kim F. Storm
2003-01-19  1:35     ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.