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

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

Re: delete-region - is their a way to get the deleted text?


From: David Engster
Subject: Re: delete-region - is their a way to get the deleted text?
Date: Thu, 13 Jun 2013 18:16:38 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

Thorsten Jolitz writes:
> I found a function that would be useful for me as is - if only I would
> have access to the region deleted with 'delete-region' inside that
> function.
>
> ,------------------------------------------------------------------
> | (delete-region START END)
> | Delete the text between START and END.
> | This command deletes buffer text without modifying the kill ring.
> `------------------------------------------------------------------
>
> If its not in the kill ring - is there any other way to get the text
> that deleted, or is it simply gone and lost?

Well, there's always the super-hacky way:

(require 'cl)

(defadvice your-function-of-interest
  (around replace-delete-with-kill activate)
  "Replace `delete-region' with `kill-region'."
  (flet ((delete-region (x y)
                        (kill-region x y)))
    ad-do-it))

And then just yank...

-David




reply via email to

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