unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: gg44060@mail.com
Subject: Re: backward-delete-word function (not backward-kill-word)
Date: 26 Feb 2004 07:31:10 -0800	[thread overview]
Message-ID: <f461b4c0.0402260731.be5fc80@posting.google.com> (raw)
In-Reply-To: mailman.450.1077701652.340.help-gnu-emacs@gnu.org

"Ehud Karni" wrote in message news:<mailman.450.1077701652.340.help-gnu-emacs@gnu.org>...
> -----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.

Thanks! This is exactly what I was looking for and it works like a
charm!  I hope to get the full sources installed for emacs once the
download site starts working again.

      parent reply	other threads:[~2004-02-26 15:31 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
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 [this message]

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=f461b4c0.0402260731.be5fc80@posting.google.com \
    --to=gg44060@mail.com \
    /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).