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

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

Re: No copy when killing


From: Xah
Subject: Re: No copy when killing
Date: Sat, 14 Jun 2008 07:01:06 -0700 (PDT)
User-agent: G2/1.0

Here's a kill-word command that does not push text into kill-ring.

(defun my-kill-word (arg)
  "Kill characters forward until encountering the end of a word.
With argument, do this that many times.
Do not push killed text to kill-ring"
  (interactive "p")
  (delete-region (point) (progn (forward-word arg) (point))))

it's basically copy-paste of the same code of kill-word, execpt that
kill-region is replaced by delete-region.

here's a simple kill-line that doesn't push to kill-ring.

(defun delete-point-to-line-end ()
  "Delete text from current position to end of line char."
  (interactive)
  (delete-region
   (point)
   (save-excursion (move-end-of-line 1) (point))
   ))

> Thanks again so much :)

you are very welcome. :) I got lots help here too.

  Xah
∑ http://xahlee.org/

☄

On Jun 14, 3:18 am, rock69 <address@hidden> wrote:

> Thank youXahfor the detailed explanation. I would indeed like to see
> the code if it's not too much trouble. Although, as a matter of fact,
> I most likely am going to follow your suggestion, and use another
> register when I'm in one of the situations I mentioned.
>
> Thanks again so much :)



reply via email to

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