From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Org Clock Table / Subtree Export subtle bug Date: Sun, 29 Apr 2012 01:19:36 +0200 Message-ID: <87aa1vwik7.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOGuW-0003rh-RR for emacs-orgmode@gnu.org; Sat, 28 Apr 2012 19:18:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOGuV-0000uG-1Z for emacs-orgmode@gnu.org; Sat, 28 Apr 2012 19:18:40 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:52493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOGuU-0000u7-Ou for emacs-orgmode@gnu.org; Sat, 28 Apr 2012 19:18:38 -0400 Received: by werj55 with SMTP id j55so1506817wer.0 for ; Sat, 28 Apr 2012 16:18:36 -0700 (PDT) In-Reply-To: (Mike McLean's message of "Fri, 27 Apr 2012 14:35:53 -0400") 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: Mike McLean Cc: emacs-orgmode Hi Mike, thanks very much for the detailed bug report. Mike McLean writes: > The general symptom is that if: > > 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) > > 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. The trick is to use (let ((delete-active-region nil)) ...) so that the active region is not deleted by such adjustments. I pushed a fix. Thanks! -- Bastien