From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: New Exporter BUG/Change in behaviour Date: Fri, 05 Apr 2013 20:36:52 +0200 Message-ID: <87hajkx1rv.fsf@gmail.com> References: <87ppy8yl60.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOBVc-0006bV-TV for emacs-orgmode@gnu.org; Fri, 05 Apr 2013 14:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOBVT-0008SD-22 for emacs-orgmode@gnu.org; Fri, 05 Apr 2013 14:37:08 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:43326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOBVS-0008Ru-RF for emacs-orgmode@gnu.org; Fri, 05 Apr 2013 14:36:58 -0400 Received: by mail-we0-f179.google.com with SMTP id p43so3012757wea.38 for ; Fri, 05 Apr 2013 11:36:57 -0700 (PDT) In-Reply-To: <87ppy8yl60.fsf@norang.ca> (Bernt Hansen's message of "Fri, 05 Apr 2013 12:52:39 -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: Bernt Hansen Cc: emacs-orgmode@gnu.org Hello, Bernt Hansen writes: > My org file has > > #+OPTIONS: tasks:todo > > This globally skips DONE tasks in my exports when I export the entire > file in both the old and new exporter. > > If I select a task with C-c @ that is DONE (or any done state) and try > to export that in the new exporter I get nothing (except an empty table > of contents) -- even if the Org buffer is narrowed to only that task. > > The old exporter would export this anyway but it seems the new exporter > is honouring the global #+OPTIONS: task:todo even when it is outside the > currently narrowed buffer range. Indeed. OPTIONS is a buffer-wide keyword. > There is no local property that I am aware of to say export all todo > states. I have to list them individually which isn't user-friendly so I > can't reverse the global setting with a local property in my > task/subtree. Having to add a property for my exports for email just to > get it to override global options really isn't user-friendly since the > options per file are different and the user has to know exactly what to > undo (and future changes to the global options makes this a moving target) > Is this a bug? No, it isn't. > My current workaround is to delete the global #+OPTIONS > line (but that doesn't feel right since I have to add it back to export > what is left to do for the entire file when sharing it with others). I > regularly export small subtrees (with C-c @) to copy ASCII / HTML export > results to emails so the old exporter behaviour was much more > predictable in the results I would get when using C-c @. The new exporter distinguishes between subtree export (toggled with C-s key within the dispatcher) and region export. In the old exporter, C-c @ + export command would give you a subtree export. This is not the case in the new exporter. You have to explicitly mention you want a subtree export. On the other hand, you don't need to select a region beforehand. In other words, you don't trigger a subtree export anymore with C-c @ (but it triggers a region export). If you export a subtree in the new exporter jargon, you can override locally #+options: line by setting top headline's :EXPORT_OPTIONS: property to an appropriate value, e. g. :EXPORT_OPTIONS: tasks:t. There is no such mechanism for a region export. But you can implement a function that will remove the OPTIONS line when buffer is narrowed: (when (buffer-narrowed-p) (org-with-wide-buffer (goto-char (point-min)) (let ((case-fold-search t)) (while (re-search-forward "^[ \t]*#\\+options:" nil t) (when (eq (org-element-type (org-element-at-point)) 'keyword) (delete-region (line-beginning-position) (progn (forward-line) (point)))))))) Then add it to `org-export-before-parsing-hook'. Regards, -- Nicolas Goaziou