* undo by word
@ 2002-10-22 14:23 Michael J Downes
0 siblings, 0 replies; only message in thread
From: Michael J Downes @ 2002-10-22 14:23 UTC (permalink / raw)
When typing plain text it would be in some sense more natural for undo
to undo a word at a time instead of twenty characters at a time.
Defining SPC to run something other than self-insert-command has the
side effect of putting in an undo boundary, but unfortunately the
results seems to be too many undo boundaries. After defining
(defun space (arg)
"*Insert a space in a way that creates an undo boundary."
(interactive "*p")
(self-insert-command arg))
(global-set-key " " 'space)
and typing some words, one finds that repeated undo steps stop after
each space *and* after each word. (I was shooting for a way to undo a
word together with its preceding space(s) in a single undo step.)
I also tried using after-change-functions, with pretty good results,
but that approach seemed to end up being rather complicated.
Is there anyone else besides me who thinks it might be a good idea to
add an option for word-by-word undo in a future version of Emacs? I
didn't find
any previous discussion on this in Google (searching for
"undo-boundary", "word by word", "wordwise", etc.)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-10-22 14:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-22 14:23 undo by word Michael J Downes
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.