From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike McLean Subject: Re: Org Clock Table / Subtree Export subtle bug Date: Sun, 29 Apr 2012 07:49:08 -0400 Message-ID: <0EC5228B-BB10-4B5F-B450-D06E2F374096@pobox.com> References: <87aa1vwik7.fsf@gnu.org> Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOSd1-0002wg-9K for emacs-orgmode@gnu.org; Sun, 29 Apr 2012 07:49:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOScz-0007va-HT for emacs-orgmode@gnu.org; Sun, 29 Apr 2012 07:49:22 -0400 In-Reply-To: <87aa1vwik7.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode On Apr 28, 2012, at 7:19 PM, Bastien wrote: > Hi Mike, >=20 > thanks very much for the detailed bug report. >=20 > Mike McLean writes: >=20 >> The general symptom is that if: >>=20 >> You have org-update-all-dblocks added >> to org-export-first-hook with the goal of ensuring that dynamic >> blocks are current before every export; AND >> You are exporting only a region of the file, for example >> using C-c C-e 1 b (buffer/subtree export) >>=20 >> The Mark terminating the end of the region to be exported is carried >> into the org-clocktable-write-default formatting function and the >> call of (backward-delete-char 1) on line 2352 oforg-clock.el deletes >> a region (between the Mark of the initial call and point, which is >> immediately before the #+END: construct of the clock table). Deletion >> of the #+END: construct malforms the clock table and ultimately the >> export fails leaving the Org file is a corrupt state. >=20 > The trick is to use (let ((delete-active-region nil)) ...) so that=20 > the active region is not deleted by such adjustments. Interesting, I was going to play a bit today and try things like = (save-excursion (deactivate-mark) =85 ) but didn't know if that was the = right approach or not. The delete-active-region sure seems simpler :) > I pushed a fix. Thank you