help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to avoid filling KILL RING with junk


From: Joe Casadonte
Subject: Re: how to avoid filling KILL RING with junk
Date: 30 Sep 2002 11:04:04 -0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2

On Fri, 20 Sep 2002, stray_searcher@hotmail.com wrote:

> On 18 Sep 2002, ignoramus6776@NOSPAM.6776.invalid wrote:
>> When I delete words and regions in my xemacs 21.4, it puts theninto
>> the kill ring.
>
> You did not 'delete' but 'killed' ;-)
>
> See delete-region vs kill-region.
>
> But I'm afraid that there's no built in delete-word in Emacs.

It's not built-in, but this should do the trick:

(defun my-delete-word (arg)
  "Delete characters forward until encountering the end of a word.

With prefix argument ARG, do this that many times."
  (interactive "p")
  (delete-region (point) (progn (forward-word arg) (point))))


(defun my-backwards-delete-word (arg)
  "Delete characters backward until encountering the end of a word.

With prefix argument ARG, do this that many times."
  (interactive "p")
  (my-delete-word (- arg)))

Bind to keys of your choice and have a blast.

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]