[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: backward-delete-word function (not backward-kill-word)
From: |
Ehud Karni |
Subject: |
Re: backward-delete-word function (not backward-kill-word) |
Date: |
Wed, 25 Feb 2004 11:33:09 +0200 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 24 Feb 2004 21:19:44 -0800, gg44060(at)mail.com wrote:
>
> Is there a backward-delete-word funtion in emacs? It is very annoying
> to have the words deleted during a find-file to show up on the kill
> ring [snip ]
>
> I tried defining it as a keyboard macro using delete-region, but of
> course it doesn't work in the mini-buffer.
Just copy the `kill-word' and `backward-kill-word' functions (from
simple.el) and replace the string "kill" by "delete" like this:
(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)))
Assign (globally) keys to these functions and enjoy it.
Ehud.
- --
Ehud Karni Tel: +972-3-7966-561 /"\
Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign
Insurance agencies (USA) voice mail and X Against HTML Mail
http://www.mvs.co.il FAX: 1-815-5509341 / \
GnuPG: 98EA398D <http://www.keyserver.net/> Better Safe Than Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)
iD8DBQFAPGvULFvTvpjqOY0RAjYXAJ9/5QFvX6iAqJQOqSPKC5oGP47uiQCeOo42
cPptUBIghmv4OItNr+88aKs=
=RdWh
-----END PGP SIGNATURE-----