emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mike McLean <mike.mclean@pobox.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Org Clock Table / Subtree Export subtle bug
Date: Sun, 29 Apr 2012 07:49:08 -0400	[thread overview]
Message-ID: <0EC5228B-BB10-4B5F-B450-D06E2F374096@pobox.com> (raw)
In-Reply-To: <87aa1vwik7.fsf@gnu.org>


On Apr 28, 2012, at 7:19 PM, Bastien wrote:

> Hi Mike,
> 
> thanks very much for the detailed bug report.
> 
> Mike McLean <mike.mclean@pobox.com> 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.

Interesting, I was going to play a bit today and try things like (save-excursion (deactivate-mark) … ) 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

  reply	other threads:[~2012-04-29 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27 18:35 Org Clock Table / Subtree Export subtle bug Mike McLean
2012-04-28 23:19 ` Bastien
2012-04-29 11:49   ` Mike McLean [this message]
2012-04-29 12:25     ` Mike McLean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0EC5228B-BB10-4B5F-B450-D06E2F374096@pobox.com \
    --to=mike.mclean@pobox.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).