On Mon, May 22, 2017 at 7:47 AM Nicolas Goaziou <[email protected]>
wrote:
> This shouldn't happen. "1." is defined as paragraph separator (see
> `org-element-paragraph-separate' and `org-element--set-regexps) so
> auto-fill cannot break a line before this construct.
>
That's good to know and comforting :) Thanks for the explanation.
> Per above, this should not happen. There are cases, however, that can
> happen, like the macro in your ECM. Auto-fill cannot tell this is going
> to make a numbered bullet.
>
I just tried this out and it works:
diff --git a/lisp/org-element.el b/lisp/org-element.el
index c60a56ead..4f4fc1e2c 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -181,7 +181,9 @@ specially in `org-element--object-lex'.")
(?\) ")") (?. "\\.") (_ "[.)]")))
(alpha (and org-list-allow-alphabetical "\\|[A-Za-z]")))
(concat "\\(?:[-+*]\\|\\(?:[0-9]+" alpha "\\)" term "\\)"
- "\\(?:[ \t]\\|$\\)"))
+ "\\(?:[ \t]\\|$\\)")) "\\|"
+ ;; n Macro
+ "\\(?:{{{n\\)" ;Don't allow auto-fill to put n macros at
BOL
"\\)\\)")
org-element--object-regexp
(mapconcat #'identity
With that, now the MWE auto-fills as
=====
If I wish, I can set that counter value to anything I want, like
7463: {{{n(, 7463)}}}.
=====
instead of
=====
If I wish, I can set that counter value to anything I want, like 7463:
{{{n(, 7463)}}}.
=====
and that fixes this problem.
--
Kaushal Modi