emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* New Exporter BUG/Change in behaviour
@ 2013-04-05 16:52 Bernt Hansen
  2013-04-05 18:36 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Bernt Hansen @ 2013-04-05 16:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hi Nicolas,

I finally updated to the latest master branch at work yesterday to move
to the new exporter and found the following change I don't know how to
deal with.

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.

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?  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 @.

So far the move to the next exporter has been very easy.

Great job!

Regards,
Bernt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New Exporter BUG/Change in behaviour
  2013-04-05 16:52 New Exporter BUG/Change in behaviour Bernt Hansen
@ 2013-04-05 18:36 ` Nicolas Goaziou
  2013-04-05 19:04   ` Bernt Hansen
  2013-04-06 21:50   ` Thorsten Jolitz
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2013-04-05 18:36 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Hello,

Bernt Hansen <bernt@norang.ca> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New Exporter BUG/Change in behaviour
  2013-04-05 18:36 ` Nicolas Goaziou
@ 2013-04-05 19:04   ` Bernt Hansen
  2013-04-06 21:50   ` Thorsten Jolitz
  1 sibling, 0 replies; 8+ messages in thread
From: Bernt Hansen @ 2013-04-05 19:04 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Bernt Hansen <bernt@norang.ca> writes:
>
>> 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.

Thanks for the clarification!  I'll give it a whirl :)

Regards,
Bernt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New Exporter BUG/Change in behaviour
  2013-04-05 18:36 ` Nicolas Goaziou
  2013-04-05 19:04   ` Bernt Hansen
@ 2013-04-06 21:50   ` Thorsten Jolitz
  2013-04-06 22:22     ` Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Thorsten Jolitz @ 2013-04-06 21:50 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

Hello,

> 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.


Shouldn't the

,---------------------
| :EXPORT_OPTIONS: d:t
`---------------------

setting in the following minimal org-file export the property-drawer for
this subtree too?

,-----------------------
| * header1
|   :PROPERTIES:
|   :EXPORT_OPTIONS: d:t
|   :END:
|
| hello world
|
| |hello| table|
|
`-----------------------

Exporting to an ASCII buffer:

,------------
| C-c C-e t A
`------------

gives

,------------------
| Thorsten Jolitz
|
|
| Table of Contents
| _________________
|
| 1 header1
|
|
| 1 header1
| =========
|
|   hello world
|
|   hello| table|
`------------------

--
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New Exporter BUG/Change in behaviour
  2013-04-06 21:50   ` Thorsten Jolitz
@ 2013-04-06 22:22     ` Nicolas Goaziou
  2013-04-06 22:47       ` Thorsten Jolitz
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-04-06 22:22 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Hello,

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Shouldn't the
>
> ,---------------------
> | :EXPORT_OPTIONS: d:t
> `---------------------
>
> setting in the following minimal org-file export the property-drawer for
> this subtree too?
>
> ,-----------------------
> | * header1
> |   :PROPERTIES:
> |   :EXPORT_OPTIONS: d:t
> |   :END:
> |
> | hello world
> |
> | |hello| table|
> |
> `-----------------------

No. The "d:" item only applies to regular drawers.

`property-drawer' elements are not among them. Back-ends handle these
beasts as they see fit (they usually ignore them, as you can tell).


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New Exporter BUG/Change in behaviour
  2013-04-06 22:22     ` Nicolas Goaziou
@ 2013-04-06 22:47       ` Thorsten Jolitz
  2013-04-06 23:07         ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Thorsten Jolitz @ 2013-04-06 22:47 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> No. The "d:" item only applies to regular drawers.
>
> `property-drawer' elements are not among them. Back-ends handle these
> beasts as they see fit (they usually ignore them, as you can tell).

I actually have a use-case where I would like to export the
property-drawer to ASCII, but that would involve writing new code - no way
to configure it, right?

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New Exporter BUG/Change in behaviour
  2013-04-06 22:47       ` Thorsten Jolitz
@ 2013-04-06 23:07         ` Nicolas Goaziou
  2013-04-06 23:27           ` Thorsten Jolitz
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-04-06 23:07 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> No. The "d:" item only applies to regular drawers.
>>
>> `property-drawer' elements are not among them. Back-ends handle these
>> beasts as they see fit (they usually ignore them, as you can tell).
>
> I actually have a use-case where I would like to export the
> property-drawer to ASCII, but that would involve writing new code - no way
> to configure it, right?

There's no direct option, if that's your question. One possibility is,
from `org-export-before-processing-hook', to copy each property drawer
into an example block below. But it involves writing a couple lines of
code, indeed.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New Exporter BUG/Change in behaviour
  2013-04-06 23:07         ` Nicolas Goaziou
@ 2013-04-06 23:27           ` Thorsten Jolitz
  0 siblings, 0 replies; 8+ messages in thread
From: Thorsten Jolitz @ 2013-04-06 23:27 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>
>>> No. The "d:" item only applies to regular drawers.
>>>
>>> `property-drawer' elements are not among them. Back-ends handle these
>>> beasts as they see fit (they usually ignore them, as you can tell).
>>
>> I actually have a use-case where I would like to export the
>> property-drawer to ASCII, but that would involve writing new code - no way
>> to configure it, right?
>
> There's no direct option, if that's your question. One possibility is,
> from `org-export-before-processing-hook', to copy each property drawer
> into an example block below. But it involves writing a couple lines of
> code, indeed.

Ok, I can do that, thanks for the hint. 

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-06 23:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-05 16:52 New Exporter BUG/Change in behaviour Bernt Hansen
2013-04-05 18:36 ` Nicolas Goaziou
2013-04-05 19:04   ` Bernt Hansen
2013-04-06 21:50   ` Thorsten Jolitz
2013-04-06 22:22     ` Nicolas Goaziou
2013-04-06 22:47       ` Thorsten Jolitz
2013-04-06 23:07         ` Nicolas Goaziou
2013-04-06 23:27           ` Thorsten Jolitz

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).