From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: delete-region - is their a way to get the deleted text? Date: Thu, 13 Jun 2013 11:11:06 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371138740 30812 80.91.229.3 (13 Jun 2013 15:52:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Jun 2013 15:52:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 13 17:52:21 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Un9oz-0000sj-CT for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Jun 2013 17:52:21 +0200 Original-Received: from localhost ([::1]:53102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un9oz-0003Qp-2X for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Jun 2013 11:52:21 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Injection-Info: mx05.eternal-september.org; posting-host="159116255ce7d0b522977afcd6e918a8"; logging-data="1551"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Km3hownRkQdOqFOXkoJls" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:qpjoGO+O6oUz7ZhXi4gJOYi1c4o= sha1:PncqrL1STnobrMiJMHP87ALaFFI= Original-Xref: usenet.stanford.edu gnu.emacs.help:199250 X-Mailman-Approved-At: Thu, 13 Jun 2013 11:49:51 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91519 Archived-At: > ,------------------------------------------------------------------ > | (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? By and large it's gone and lost. What you can do: - copy the text before calling the function (then try and figure out which part of the text was deleted). - 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). - temporarily advise delete-region so it stashes its result in some variable. - even nastier hacks can be imagined, of course. Stefan