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

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

Re: Make <delete> save the deleted text into the killing ring


From: Emanuel Berg
Subject: Re: Make <delete> save the deleted text into the killing ring
Date: Wed, 14 Dec 2022 21:43:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Gregory Heytings wrote:

>> <delete> char is bound to `delete-forward-char` which does
>> not save the deleted text into the kill ring by default.
>> How can I change this behavior and make <delete> actually
>> save the killed text into the ring?
>
> (defun kill-forward-char (n)
>   (interactive "p")
>   (let ((delete-active-region 'kill))
>     (delete-forward-char n t)))
>
> (global-set-key [delete] #'kill-forward-char)

Yes, correct method 100% ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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