unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Ehud Karni" <ehud@unix.mvs.co.il>
Cc: help-gnu-emacs@gnu.org
Subject: Re: backward-delete-word function (not backward-kill-word)
Date: Wed, 25 Feb 2004 11:33:09 +0200	[thread overview]
Message-ID: <200402250933.i1P9X9VQ014784@beta.mvs.co.il> (raw)
In-Reply-To: <f461b4c0.0402242119.1a44079@posting.google.com> (gg44060@mail.com)

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

  reply	other threads:[~2004-02-25  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-25  5:19 backward-delete-word function (not backward-kill-word) gg44060
2004-02-25  9:33 ` Ehud Karni [this message]
2004-02-25  9:38 ` Ehud Karni
2004-02-25 22:11 ` Johan Bockgård
2004-02-26 15:17   ` gg44060
     [not found] ` <mailman.451.1077701989.340.help-gnu-emacs@gnu.org>
2004-02-26 15:27   ` gg44060
     [not found] ` <mailman.450.1077701652.340.help-gnu-emacs@gnu.org>
2004-02-26 15:31   ` gg44060

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200402250933.i1P9X9VQ014784@beta.mvs.co.il \
    --to=ehud@unix.mvs.co.il \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).