[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Kill ring and backward-kill-word
From: |
Stefan Reichör |
Subject: |
Re: Kill ring and backward-kill-word |
Date: |
Thu, 15 Dec 2005 21:49:05 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
"Shug Boabby" <Shug.Boabby@gmail.com> writes:
>> 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.
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.