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

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

Re: Removing the last entry from the kill-ring


From: Michael Heerdegen
Subject: Re: Removing the last entry from the kill-ring
Date: Sun, 12 Jan 2014 19:07:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Cecil,

> I wrote the following function, to copy the current buffer to a
> temporary buffer:
>     (defun dcbl-buffer-to-temp ()
>       (interactive)
>       (let ((buffer-name (generate-new-buffer-name "tempory-edit")))
>         (copy-region-as-kill (point-min) (point-max))
>         (switch-to-buffer buffer-name)
>         (yank)))
>
> This works OK (I think) except for one problem: there is an entry
> added to the kill-ring. Is there a way to remove this?

Just don't use the kill-ring and its commands for that.  I.e. use
e.g. `buffer-substring[-no-properties]' for copying and `insert' for
pasting.


Regards,

Michael.




reply via email to

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