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: Thorsten Jolitz
Subject: Re: delete-region - is their a way to get the deleted text?
Date: Fri, 14 Jun 2013 10:18:44 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> ,------------------------------------------------------------------
>> | (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?

> - make sure the function is called with undo enabled, then look for the
>   deleted string in the undo log (that's how delete-and-extract-region
>   was originally coded, back when I wrote it in Elisp).

that sounds reasonably simple
> - temporarily advise delete-region so it stashes its result in
>   some variable.

another option I like

> - even nastier hacks can be imagined, of course.

thanks for the tips!

-- 
cheers,
Thorsten




reply via email to

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