emacs-devel
[Top][All Lists]
Advanced

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

kill-ring-max or other var to convert killing to deleting?


From: Drew Adams
Subject: kill-ring-max or other var to convert killing to deleting?
Date: Wed, 1 Mar 2006 13:18:42 -0800

Suppose you want to delete some text, and not add it to the kill ring. For
example, suppose you want to delete a word backward. In this case, there is
no `backward-delete-word' function to correspond to `backward-kill-word'.
You could do this, which is essentially the definition of
`backward-kill-word' with "delete" substituted for "kill":

 (delete-region (point) (progn (forward-word (- arg)) (point)))

But wouldn't it be handy, generally, to be able to just convert an existing
`kill-*' function to a `delete-*' function? That is, bind some flag to
indicate that the deleted text is not to be added to the kill ring:

 (let ((kill-p nil)) (backward-kill-word arg))

At first sight, I thought perhaps binding `kill-ring-max' to 0 might do the
trick, but it seems that the killed text is always added to the kill ring.
It is only the cdr of the kill-ring that is affected by `kill-ring-max'.

How about making `kill-ring-max' = 0 have the effect of plain deletion?





reply via email to

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