Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Kill ring and backward-kill-word

0 views
Skip to first unread message

Shug Boabby

unread,
Dec 12, 2005, 12:23:09 PM12/12/05
to
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".

Andreas Röhler

unread,
Dec 12, 2005, 3:00:08 PM12/12/05
to
Shug Boabby wrote:

;; 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

Shug Boabby

unread,
Dec 12, 2005, 3:25:36 PM12/12/05
to
excellent! thanks Andreas, just what i needed

Stefan Reichör

unread,
Dec 12, 2005, 3:47:07 PM12/12/05
to
Hi Shug!

> 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.

Shug Boabby

unread,
Dec 13, 2005, 1:21:50 PM12/13/05
to
hi stefan, the point is that i don't want *any* of the deleted words to
enter into the kill ring. i prefer the kill ring to function the same
way as the clipboard and c&p in all other apps i use... which means
only text that i explicitly M-w (or M-c) gets added to the kill
ring/clipboard.

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.

David Kastrup

unread,
Dec 13, 2005, 5:48:47 PM12/13/05
to
"Shug Boabby" <Shug....@gmail.com> writes:

Well, you know M-y don't you?

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum

Shug Boabby

unread,
Dec 13, 2005, 10:02:49 PM12/13/05
to
> Well, you know M-y don't you?

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.

Stefan Reichör

unread,
Dec 15, 2005, 3:49:05 PM12/15/05
to
"Shug Boabby" <Shug....@gmail.com> writes:

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.

Shug Boabby

unread,
Dec 16, 2005, 8:54:19 AM12/16/05
to
hi stefan, you mean just like Andreas' first reply to this topic ;-)

http://groups.google.com/group/gnu.emacs.help/msg/1e5d97ff3a2d1bb3?dmode=source

don provan

unread,
Dec 17, 2005, 6:10:03 AM12/17/05
to
"Shug Boabby" <Shug....@gmail.com> writes:

> 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

Kevin Rodgers

unread,
Dec 14, 2005, 7:35:04 PM12/14/05
to help-gn...@gnu.org

(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

0 new messages