[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 Thread Thibault Polge
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  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 /enumerate.

Regards,
Thibault



Re: Different exporters behave differently re exporter-specific lines

2019-10-29 Thread Thibault Polge
> I doubt it. There are 3 paragraphs, even for LaTeX, since there are
> empty lines.

I believe there may have been a communication issue somewhere, since you
cite my message with extra \n --- there are no empty lines in my
original message.  For reference, here's the exact input I've used:
.

The PDF output is at https://paste.thb.lt/test.pdf, the HTML output
here https://paste.thb.lt/test.html

As you can see, the LaTeX PDFs have everything in a single line, the
HTML output displays four separate paragraphs.

Best regards,
Thibault



Re: Discrepancy between documentation and implementation regarding comments

2019-10-29 Thread Thibault Polge
Robert Pluim writes:

> end of line *is* a whitespace character, but Iʼm not going to argue
> that. Iʼm going to argue that this doesnʼt cover the case of a '#' at
> EOB without a newline, hence saying 'zero or more' would be better.

But zero-or-more would mean that this line:

#Alpha

Is a comment, along with:

#+TITLE: My Org document

And virtually of all Org meta-lines. I've thought about the \n#
issue, but I haven't tested how the current implementation behaves in
this regard.  I think the recent changes in Pandoc would parse it as a
comment.

Regards,
Thibault


signature.asc
Description: PGP signature


Different exporters behave differently re exporter-specific lines

2019-10-29 Thread Thibault Polge
I'm not sure how this feature is called, but in Org you can restrict a line
to a given exporter by prepending it with, eg, #+latex:

There's a bug with some exporters f treat these lines as paragraph breaks,
some don't.  For example, the following input:

Hello
#+latex: \TeX{}
World
#+html: Wide Web
!

Is exported to LaTeX as a single line, "Hello TeX World !", but to HTML
as separate paragraphs:


Hello


World

Wide Web

!


I wouldn't except these lines to introduce any paragraphs break.

This is with Emacs built from Git, using Org 9.2.6.

Best regards,
Thibault


signature.asc
Description: PGP signature


Re: Discrepancy between documentation and implementation regarding comments

2019-10-28 Thread Thibault Polge
Nicolas Goaziou writes:
> See  (with a nice
> typo...)

Thanks Nicolas, just a small detail though: unless this is a planned
(breaking) change, I believe the description you linked should read:

A “comment line” starts with *zero or more whitespace characters,
followed by* a hash sign, followed by a whitespace character or an end
of line.

Another detail: it could be nice to have a small appendix somewhere
mapping character names to codepoints, since Unicode has no less than
three “number signs” (from Wikipedia):

 - U+0023 # NUMBER SIGN (HTML #). Other attested names in Unicode are: 
pound sign, hash, crosshatch, octothorpe.
 - U+FF03 # FULLWIDTH NUMBER SIGN (HTML #)
 - U+FE5F ﹟ SMALL NUMBER SIGN (HTML ﹟)

Regards,
Thibault


signature.asc
Description: PGP signature


Discrepancy between documentation and implementation regarding comments

2019-10-27 Thread Thibault Polge
Hello,

According to Org-Mode documentation[1],

> Lines starting with zero or more whitespace characters followed by one
> ‘#’ and a whitespace are treated as comments and, as such, are not
> exported.

The actual implementation differs on a subtle detail: Org-Mode will
treat a line where the pound sign is immediatly followed by \n as a
comment.  I believe this is expected behavior, since it allows to
comment out multiple paragraphs, and behaves as expected even when using
`delete-trailing-whitespace`.

I'm asking this because Pandoc follows strictly the org documentation,
and treats a line containing only a pound sign as text.  I opened a bug
about this[2], where I've been asked –reasonably– to first make sure the
bug isn't actually in Org Mode.

[1] https://orgmode.org/manual/Comment-lines.html

[2] https://github.com/jgm/pandoc/issues/5856

All the best,

--
Thibault


signature.asc
Description: PGP signature


Re: [O] org-crypt broken on Ubuntu 18.04

2018-06-13 Thread Thibault Polge
> What's an ECM?

French for Exemple complet minimal = Minimal Working Example (MWE)[1]

[1]: https://en.wikipedia.org/wiki/Minimal_Working_Example

--
Thibault



[O] Bug: imenu fails with non-continuous structure [9.1.13 (release_9.1.13 @ /home/thblt/.emacs.d/lib/org/lisp/)]

2018-06-09 Thread Thibault Polge
Steps to reproduce, from emacs -q:

 1. (setq org-imenu-depth 10)

 2. Create the following document:

#+begin_src org
#+TITLE: Test

* Level 1
** Level 2
*** Level 3
 Level 4
 Level 8
#+end_src

Notice the break on the structure: levels 5, 6 and 7 are missing.

 3. M-x imenu, select each Level n entry

 4. imenu will crash after you've selected Level 4

I can reproduce this from emacs -q using org-mode from git master
(842002f9f7e3246cc285cc9bca1adb715120438d).  I'm running 26.1 on NixOS.

(I didn't include the detailed system report since I've tested on
multiple setups, including -q.  Please ask if you need any extra
information)

Thanks
Thibault



Re: [O] Bug: org-indent-mode with visual-line-mode breaks C-a and C-e

2017-04-01 Thread Thibault Polge
I can confirm the issue appears with those two commands. I forwarded
this report to the Emacs bug tracker.

Regards,

Nicolas Goaziou writes:

> Hello,
>
> Thibault Polge  writes:
>
>> With visual-line-mode and org-indent-mode activated, C-a and C-e
>> misbehaves on indented text blocks.  C-a and C-e sometimes start jumping
>> over lines (ie, go backwards or forward one extra line) and sometimes
>> even reverses direction (C-e goes backward). I can reproduce this from
>> emacs -Q with builtin Org 8.2.10. The issue can also be reproduced
>> without enabling org-indent-mode, although it is much less severe
>> without it.
>
> C-a, aka `org-beginning-of-line', merely calls
> `beginning-of-visual-line' when Visual Line mode is active. Would it be
> possible that the bug lies in that function? I.e., could you try
> reproducing the bug just calling `beginning-of-visual-line'?
>
> If my assumption is true, you could report the problem to Emacs devs
> instead.
>
> Regards,



[O] Bug: org-indent-mode with visual-line-mode breaks C-a and C-e

2017-03-30 Thread Thibault Polge

* Summary

With visual-line-mode and org-indent-mode activated, C-a and C-e
misbehaves on indented text blocks.  C-a and C-e sometimes start jumping
over lines (ie, go backwards or forward one extra line) and sometimes
even reverses direction (C-e goes backward). I can reproduce this from
emacs -Q with builtin Org 8.2.10. The issue can also be reproduced
without enabling org-indent-mode, although it is much less severe
without it.

* Steps to reproduce

>From emacs -Q:

 1. Open the attached document, or create a new org-mode file with an
heading and a (preferably long) paragraph or text under it.
 2. Enable visual-line-mode and org-indent-mode
 3. Reduce Emacs frame width.
 4. With text-scale-mode or (set-frame-parameter), seriously increase
the font size (if it can't display more than two or three words per
line, that's perfect).
 5. Go to the last character of the huge paragraph.
 6. Start playing with C-a and C-e.  The cursor will wander erratically
within the paragraph, often in the wrong direction.

Notice: setting the frame width, the font size and going to the end of
the document is not strictly required, as the bug will appear sooner or
later, but in my tests it made it appear much faster, in a matter of
seconds.]

I'm using Emacs 25.2rc2 with org 9.0.5 from ELPA, but have been
experiencing this since Emacs 24.5 and the built-in Org (8.x I believe).
I can reproduce under the same conditions with the built-in org of Emacs
25.2rc2 as well.

Thanks a lot for your help,
Thibault

* This will break

On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.


[O] Bug: save-some-buffers saves org-edit-special buffers to separate files [9.0.4 (9.0.4-elpa @ /home/thblt/.emacs.d/elpa25/org-20170124/)]

2017-02-17 Thread Thibault Polge
When calling (save-some-buffers t) while a code block is being edited
with org-edit-special, the org-edit-special buffer is saved to the disk
to a new, separate file with a name like:

dotemacs.org[*Org Src dotemacs.org[ emacs-lisp ]*]

I can reproduce this from emacs -Q with org 9.0.4 from org ELPA, but not
with builtin org in Emacs 25.1.

I would expect these buffers not to be saved at all, or at least to just
be synchronized back to the .org file which in turn gets saved.

Emacs  : GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.5)
 of 2017-01-01, modified by Debian
Package: Org mode version 9.0.4 (9.0.4-elpa @ 
/home/thblt/.emacs.d/elpa25/org-20170124/)

current state:
==
(setq
 org-hide-leading-stars t
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-imenu-depth 6
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-translation-function 'toc-org-unhrefify
 org-default-notes-file "~/Documents/LOG.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-from-is-user-regexp "\\"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(toc-org-enable (lambda nil (org-indent-mode t) 
(visual-line-mode t))
 er/add-org-mode-expansions
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append 
local] 5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all 
append
local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-download-annotate-function 'org-download-annotate-default
 org-hide-emphasis-markers t
 org-catch-invisible-edits t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store 
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export 
:store
org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export 
org-docview-export
:store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store 
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export 
:complete
org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys") 
("file+emacs")
   ("doi" :follow org--open-doi-link)
   ("elisp" :follow org--open-elisp-link)
   ("file" :complete org-file-complete-link)
   ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" 
path
   ("help" :follow org--open-help-link)
   ("http" :follow
(lambda (path) (browse-url (concat "http:" path
   ("https" :follow
(lambda (path) (browse-url (concat "https:" path
   ("mailto" :follow
(lambda (path) (browse-url (concat "mailto:"; path
   ("message" :follow
(lambda (path) (browse-url (concat "message:" path
   ("news" :follow
(lambda (path) (browse-url (concat "news:"; path
   ("shell" :follow org--open-shell-link))
 org-agenda-files '("~/Documents/LOG.org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )