;; Here are two from simple.el adapted Funktions, which should work as desired.
(defun delete-word (arg)
"Delete characters forward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(delete-region (point) (progn (forward-word arg) (point))))
(defun backward-delete-word (arg)
"Delete characters backward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(delete-word (- arg)))
ar
PS.: If its your problem to yank former kills back, use M-y, also repeated
> could someone please tell me how to turn off adding text to the kill
> ring when i am using M-x backward-kill-word? it is a very annoying
> "feature".
Just use C-g to interrupt the appending.
Assuming backward-kill-word on M-DEL:
M-DEL M-DEL C-g M-DEL
Now only the latest deleted word is on the kill ring.
Stefan.
it is my belief that the situation when someone would want to delete a
word and then paste it elsewhere is a *lot* less frequent than when you
have some text in the clipboard/killring, delete a word and then
paste/yank.
Well, you know M-y don't you?
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
yes, but that's a pain. it's a whole extra command to do something i do
regularly.
i never *ever* want to delete a single word and then wish to yank it
somewhere else, so i want my setup to reflect this.
I just took the kill-word and the backward-kill-word functions and created
versions that call delete-region instead of kill-region.
(defun delete-word (arg)
"Kill characters forward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(delete-region (point) (progn (forward-word arg) (point))))
(defun backward-delete-word (arg)
"Kill characters backward until encountering the end of a word.
With argument, do this that many times."
(interactive "p")
(delete-word (- arg)))
With backward-delete-word you can delete the word and you don't alter the kill-ring.
Stefan.
http://groups.google.com/group/gnu.emacs.help/msg/1e5d97ff3a2d1bb3?dmode=source
> i never *ever* want to delete a single word and then wish to yank it
> somewhere else, so i want my setup to reflect this.
You know, this reminds me that many years ago when I switched from
Emacs knockoffs that didn't do this to GNU Emacs that did, I found it
astonishing and annoying. I never got around to doing anything about
it, and now I use this feature all the time without so much as
thinking about it. Yes, occasionally it means having to M-y over junk,
but much more often I've gotten a word I want to put somewhere else
into the kill ring with a single kill-word command instead of the
three step mark-move-kill.
-don provan
(defadvice backward-kill-word (around disable-cut activate)
"Temporarily bind `interprogram-cut-function' to nil."
(let ((interprogram-cut-function nil))
ad-do-it))
--
Kevin Rodgers