emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] A commented line breaks line numbering [9.6-pre (release_9.5.5-1058-g6ef33b @ /home/thblt/.emacs.d/lib/org/lisp/)]
@ 2022-11-14 11:51 Thibault Polge
  2022-11-15  1:51 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Thibault Polge @ 2022-11-14 11:51 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

With org 9.6-pre, a commented out line breaks list numbering (even with
`org-list-repair`), and effectively breaks a list in two distinct lists
in exporters.  Eg:

 1. Item 1
 2. Item 2
 # 3. Commented out item 3
 1. Reset counter?

At "Reset counter?", HTML export opens a new <ol> there, LaTex a new
\begin{enumerate}

This may be expected behavior --- it's present in Pandoc as well --- but
it's surprising, since I'd expect a comment line to be fully ignored
from the comment marker to the final \n, inclusive.  I'd thus expect the
above example to be perfectly equivalent to:

 1. Item 1
 2. Item 2
 3. Reset counter?  

And to export as a single <ol>/enumerate.

Regards,
Thibault


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

* Re: [BUG] A commented line breaks line numbering [9.6-pre (release_9.5.5-1058-g6ef33b @ /home/thblt/.emacs.d/lib/org/lisp/)]
  2022-11-14 11:51 [BUG] A commented line breaks line numbering [9.6-pre (release_9.5.5-1058-g6ef33b @ /home/thblt/.emacs.d/lib/org/lisp/)] Thibault Polge
@ 2022-11-15  1:51 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2022-11-15  1:51 UTC (permalink / raw)
  To: Thibault Polge; +Cc: emacs-orgmode

Thibault Polge <thibault@thb.lt> writes:

> With org 9.6-pre, a commented out line breaks list numbering (even with
> `org-list-repair`), and effectively breaks a list in two distinct lists
> in exporters.  Eg:
>
>  1. Item 1
>  2. Item 2
>  # 3. Commented out item 3
>  1. Reset counter?
>
> At "Reset counter?", HTML export opens a new <ol> there, LaTex a new
> \begin{enumerate}
>
> This may be expected behavior --- it's present in Pandoc as well

It is by design, and it was like this forever, not just in Org 9.6.
Comments are a valid structural element in Org AST. They are just not
exported.

It also means that comments can belong to a list item:

1. Item 1
2. Item 2
   # 3. Commented out item 3
3. Reset counter?

The above does not break the list into two because the comment is
considered to be a part of the "Item 2".

> --- but
> it's surprising, since I'd expect a comment line to be fully ignored
> from the comment marker to the final \n, inclusive.  I'd thus expect the
> above example to be perfectly equivalent to:
>
>  1. Item 1
>  2. Item 2
>  3. Reset counter?  
>
> And to export as a single <ol>/enumerate.

This can be done on export, but it will then create inconsistency
between Org buffer behaviour and what you see on export.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2022-11-15  1:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-14 11:51 [BUG] A commented line breaks line numbering [9.6-pre (release_9.5.5-1058-g6ef33b @ /home/thblt/.emacs.d/lib/org/lisp/)] Thibault Polge
2022-11-15  1:51 ` Ihor Radchenko

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