unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: kai.grossjohann@uni-duisburg.de (Kai Großjohann)
Subject: Enhance word-based commands?
Date: Wed, 15 Jan 2003 20:16:03 +0100	[thread overview]
Message-ID: <84el7edy18.fsf@lucy.is.informatik.uni-duisburg.de> (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!

             reply	other threads:[~2003-01-15 19:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-15 19:16 Kai Großjohann [this message]
2003-01-16  7:42 ` Enhance word-based commands? 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

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=84el7edy18.fsf@lucy.is.informatik.uni-duisburg.de \
    --to=kai.grossjohann@uni-duisburg.de \
    /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).