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: aitor
Subject: Re: Make <delete> save the deleted text into the killing ring
Date: Thu, 15 Dec 2022 09:40:31 +0100

On Wed, Dec 14, 2022 at 08:17:45PM +0000, 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)

This works like a charm. Thank you!



reply via email to

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