emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org ef891067a2 1/2: * doc/org-manual.org (Expor


From: ELPA Syncer
Subject: [elpa] externals-release/org ef891067a2 1/2: * doc/org-manual.org (Export hooks): Fix example hook
Date: Wed, 7 Jun 2023 15:59:08 -0400 (EDT)

branch: externals-release/org
commit ef891067a2732da5c1c9fc9855af472efc44892c
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    * doc/org-manual.org (Export hooks): Fix example hook
    
    Set `org-map-continue-from' in the hook as otherwise the example won't
    work if user try the example on buffer with headings not separated by
    contents or empty lines.
    
    Reported-by: Victor A. Stoichita <victor@svictor.net>
    Link: https://orgmode.org/list/877csf6yva.fsf@svictor.net
---
 doc/org-manual.org | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 295140e616..ea519ea3e1 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -16034,7 +16034,12 @@ can remove every headline in the buffer during export 
like this:
   "Remove all headlines in the current buffer.
 BACKEND is the export back-end being used, as a symbol."
   (org-map-entries
-   (lambda () (delete-region (point) (line-beginning-position 2)))))
+   (lambda ()
+     (delete-region (point) (line-beginning-position 2))
+     ;; We need to tell `org-map-entries' to not skip over heading at
+     ;; point. Otherwise, it would continue from _next_ heading. See
+     ;; the docstring of `org-map-entries' for details.
+     (setq org-map-continue-from (point)))))
 
 (add-hook 'org-export-before-parsing-hook #'my-headline-removal)
 #+end_src



reply via email to

[Prev in Thread] Current Thread [Next in Thread]