unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* backward-delete-word function (not backward-kill-word)
@ 2004-02-25  5:19 gg44060
  2004-02-25  9:33 ` Ehud Karni
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: gg44060 @ 2004-02-25  5:19 UTC (permalink / raw)


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 (even worse, replace the clipboard, so that you have to go back
to the other application and copy it again).

I tried defining it as a keyboard macro using delete-region, but of
course it doesn't work in the mini-buffer.

TIA.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: backward-delete-word function (not backward-kill-word)
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Ehud Karni @ 2004-02-25  9:33 UTC (permalink / raw)
  Cc: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: backward-delete-word function (not backward-kill-word)
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Ehud Karni @ 2004-02-25  9:38 UTC (permalink / raw)
  Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24 Feb 2004 21:19:44 -0800, gg44060(at)mail.com wrote:
>
> It is very annoying to have the words deleted during a find-file to
> show up on the kill ring (even worse, replace the clipboard, so that
> you have to go back to the other application and copy it again).

If you don't want the kill ring to interfere with the clipboard do:
  (setq interprogram-cut-function nil)

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)

iD8DBQFAPG0nLFvTvpjqOY0RAiAUAJ94tXjtcgdFRe646+RJZCM+BuEf0wCfdyrs
MYiqKmYuv5Rvsvq/pNo8b6I=
=bKvy
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: backward-delete-word function (not backward-kill-word)
  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>
       [not found] ` <mailman.450.1077701652.340.help-gnu-emacs@gnu.org>
  4 siblings, 1 reply; 7+ messages in thread
From: Johan Bockgård @ 2004-02-25 22:11 UTC (permalink / raw)


gg44060@mail.com writes:

> I tried defining it as a keyboard macro using delete-region, but of
> course it doesn't work in the mini-buffer.

Of course it does.

,----[ C-h v enable-recursive-minibuffers RET ]
| enable-recursive-minibuffers's value is t
| 
| Documentation:
| *Non-nil means to allow minibuffer commands while in the minibuffer.
| This variable makes a difference whenever the minibuffer window is
| active.
| 
| You can customize this variable.
`----

-- 
:)
Johan Bockgård

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: backward-delete-word function (not backward-kill-word)
  2004-02-25 22:11 ` Johan Bockgård
@ 2004-02-26 15:17   ` gg44060
  0 siblings, 0 replies; 7+ messages in thread
From: gg44060 @ 2004-02-26 15:17 UTC (permalink / raw)


bojohan+news@dd.chalmers.se (Johan Bockgård) wrote in message news:<yoijr7wihkrp.fsf@frealaf.dd.chalmers.se>...
> gg44060@mail.com writes:
> 
> > I tried defining it as a keyboard macro using delete-region, but of
> > course it doesn't work in the mini-buffer.
> 
> Of course it does.
> 
> ,----[ C-h v enable-recursive-minibuffers RET ]
> | enable-recursive-minibuffers's value is t
> | 
> | Documentation:
> | *Non-nil means to allow minibuffer commands while in the minibuffer.
> | This variable makes a difference whenever the minibuffer window is
> | active.
> | 
> | You can customize this variable.
> `----

Thanks!  You learn something new every day.  I had gotten around the
problem by binding delete-region to a C-c key.

Thanks again.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: backward-delete-word function (not backward-kill-word)
       [not found] ` <mailman.451.1077701989.340.help-gnu-emacs@gnu.org>
@ 2004-02-26 15:27   ` gg44060
  0 siblings, 0 replies; 7+ messages in thread
From: gg44060 @ 2004-02-26 15:27 UTC (permalink / raw)


"Ehud Karni" wrote in message news:<mailman.451.1077701989.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:
> >
> > It is very annoying to have the words deleted during a find-file to
> > show up on the kill ring (even worse, replace the clipboard, so that
> > you have to go back to the other application and copy it again).
> 
> If you don't want the kill ring to interfere with the clipboard do:
>   (setq interprogram-cut-function nil)

Well, my original problem was I found myself deleting text I wouldn't
use anywhere .  I don't want it to interfere with any kill ring.

Thanks for the help.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: backward-delete-word function (not backward-kill-word)
       [not found] ` <mailman.450.1077701652.340.help-gnu-emacs@gnu.org>
@ 2004-02-26 15:31   ` gg44060
  0 siblings, 0 replies; 7+ messages in thread
From: gg44060 @ 2004-02-26 15:31 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-02-26 15:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).