From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Scary undo Date: Tue, 06 May 2008 12:15:47 +0200 Message-ID: <86abj3zqjw.fsf@lola.quinscape.zz> References: <48202D32.4020705@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210069029 10961 80.91.229.12 (6 May 2008 10:17:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 May 2008 10:17:09 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 06 12:17:44 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JtKEy-0001bh-60 for ged-emacs-devel@m.gmane.org; Tue, 06 May 2008 12:17:44 +0200 Original-Received: from localhost ([127.0.0.1]:41089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtKEF-000091-PV for ged-emacs-devel@m.gmane.org; Tue, 06 May 2008 06:16:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtKDD-0008O4-Gj for emacs-devel@gnu.org; Tue, 06 May 2008 06:15:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtKD9-0008Mm-DD for emacs-devel@gnu.org; Tue, 06 May 2008 06:15:52 -0400 Original-Received: from [199.232.76.173] (port=55819 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtKD8-0008MP-8C for emacs-devel@gnu.org; Tue, 06 May 2008 06:15:50 -0400 Original-Received: from mail.quinscape.de ([212.29.44.217]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JtKD7-00081b-JT for emacs-devel@gnu.org; Tue, 06 May 2008 06:15:49 -0400 Original-Received: (qmail-ldap/ctrl 10428 invoked from network); 6 May 2008 10:15:47 -0000 Original-Received: from unknown (HELO lola.quinscape.zz) ([10.0.3.43]) (envelope-sender ) by quinx.quinscape.de (qmail-ldap-1.03) with SMTP for ; 6 May 2008 10:15:47 -0000 Original-Received: by lola.quinscape.zz (Postfix, from userid 1001) id C7AF2E1E57; Tue, 6 May 2008 12:15:47 +0200 (CEST) In-Reply-To: <48202D32.4020705@gmail.com> (Lennart Borgman's message of "Tue, 06 May 2008 12:04:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-AntiVirus: checked by AntiVir MailGate (version: 2.1.3-2; AVE: 7.8.0.11; VDF: 7.0.4.2; host: quinx) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96579 Archived-At: "Lennart Borgman (gmail)" writes: > I would like to undo a change made by a function that I call with > funcall. I do not know exactly what the function does, but hopefully > it will only indent the current line. However the new indentation > might be wrong. > > The scenario is something like this > > (funcall the-indentation-function) > (when (= 0 (current-indentation)) > ;; undo what `the-indentation-function' did, > ;; but how? > ) > > I am a bit scared of writing this undo part so if someone could help > me I would be glad. I do not think I can use `undo-boundary' here. I'd be tempted to do something like (condition-case nil (atomic-change-group (funcall the-indentation-function) (when (=0 (current-indentation)) (signal 'barfout))) (barfout)) -- David Kastrup