emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug (?) in new exporter (export subtree)
@ 2013-01-15 20:36 Rick Frankel
  2013-01-16 18:36 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Rick Frankel @ 2013-01-15 20:36 UTC (permalink / raw)
  To: emacs-orgmode

In the new exporter, when the option to export only the subtree is
specified, the first heading in the subtree is used as the title of
the document. This seems wrong, as it becomes the title, the first
element in the table of contents and the first (not necessarily
the top level) section in the document.

When the document is explicitly narrowed to the subtree, or the
subtree is the selected region, the #+Title: attribute is used for the
document title, which seems to be better.

Arguably, using the subtree heading for the title would be the most
logical solution when exporting a subtree -- in my case that would
usually DWIM.

rick

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

* Re: Bug (?) in new exporter (export subtree)
  2013-01-15 20:36 Bug (?) in new exporter (export subtree) Rick Frankel
@ 2013-01-16 18:36 ` Nicolas Goaziou
  2013-01-17 13:28   ` Rick Frankel
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2013-01-16 18:36 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Rick Frankel <rick@rickster.com> writes:

> In the new exporter, when the option to export only the subtree is
> specified, the first heading in the subtree is used as the title of
> the document. This seems wrong, as it becomes the title, the first
> element in the table of contents and the first (not necessarily
> the top level) section in the document.

It doesn't, AFAIU. Could you explain how you do export (in particular,
where is the point when you call the export subtree process) and what do
you expect on a simple example ?

For me:

#+begin_src org
#+TITLE: title
#+OPTIONS: toc:t
* Level 1
  Body 1 X
** Level 2
   Body 2
*** Level 3
    Body 3
#+end_src

with point at X will have "Level 1" as its title, but "Level 1" will
appear neither in the table of contents nor as the first section of the
produced document.


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug (?) in new exporter (export subtree)
  2013-01-16 18:36 ` Nicolas Goaziou
@ 2013-01-17 13:28   ` Rick Frankel
  2013-01-18 21:12     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Rick Frankel @ 2013-01-17 13:28 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Jan 16, 2013 at 07:36:10PM +0100, Nicolas Goaziou wrote:
> Rick Frankel <rick@rickster.com> writes:
> 
> > In the new exporter, when the option to export only the subtree is
> > specified, the first heading in the subtree is used as the title of
> > the document. This seems wrong, as it becomes the title, the first
> > element in the table of contents and the first (not necessarily
> > the top level) section in the document.
> 
> It doesn't, AFAIU. Could you explain how you do export (in particular,
> where is the point when you call the export subtree process) and what do
> you expect on a simple example ?
> 
> For me:
> 
> #+begin_src org
> #+TITLE: title
> #+OPTIONS: toc:t
> * Level 1
>   Body 1 X
> ** Level 2
>    Body 2
> *** Level 3
>     Body 3
> #+end_src
> 
> with point at X will have "Level 1" as its title, but "Level 1" will
> appear neither in the table of contents nor as the first section of the
> produced document.

So, it seems that as long as there is a body (or blank) line after the
parent heading and you position the cursor on that line, it works
(point at X):

#+begin_src org
* Title
  X
** heading 1
   text
** heading 2
   ...
#+end_src

But if there is no blank line after the "title", there is no way to
get the expected results with the point either on the title line or
the first asterix on heading 1:

#+begin_src org
* Title
** heading 1
   text
** heading 2
   ...
#+end_src


rick

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

* Re: Bug (?) in new exporter (export subtree)
  2013-01-17 13:28   ` Rick Frankel
@ 2013-01-18 21:12     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2013-01-18 21:12 UTC (permalink / raw)
  To: emacs-orgmode

Rick Frankel <rick@rickster.com> writes:

> So, it seems that as long as there is a body (or blank) line after the
> parent heading and you position the cursor on that line, it works
> (point at X):
>
> #+begin_src org
> * Title
>   X
> ** heading 1
>    text
> ** heading 2
>    ...
> #+end_src
>
> But if there is no blank line after the "title", there is no way to
> get the expected results with the point either on the title line or
> the first asterix on heading 1:
>
> #+begin_src org
> * Title
> ** heading 1
>    text
> ** heading 2
>    ...
> #+end_src

Indeed, you have to be within the subtree you want to export in order to
effectively export it. In your example there's no such place, so there's
no way to tell which subtree you want to be exported.

This is a reasonable behaviour in my opinion.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2013-01-18 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 20:36 Bug (?) in new exporter (export subtree) Rick Frankel
2013-01-16 18:36 ` Nicolas Goaziou
2013-01-17 13:28   ` Rick Frankel
2013-01-18 21:12     ` Nicolas Goaziou

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