emacs-orgmode
[Top][All Lists]
Advanced

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

(org-element-parse-buffer) and (org-with-wide-buffer)


From: Michael Dauer
Subject: (org-element-parse-buffer) and (org-with-wide-buffer)
Date: Wed, 11 Jan 2023 10:47:48 +0100

I see a potential bug here: (org-element-parse-buffer) with VISIBLE-ONLY does not include regions made visible with (org-with-wide-buffer).

Test (Have h2.2.1 collapsed before running it.):
>>>
* h1
** h2
*** h2.1
*** h2.2
#+begin_src elisp
(org-with-wide-buffer
 (org-narrow-to-subtree)
 (goto-char (point-min))
 (list
  (--map (cadr it)
         (s-match-strings-all "^\\*+ \\(.*\\)$"
                              (buffer-substring-no-properties
                               (point-min) (point-max))))
  (org-element-map (caddr (org-element-parse-buffer 'object t)) 'headline
    (lambda (it) (org-element-property :raw-value it))))
)
#+end_src

#+RESULTS:
| h2.2 | h2.2.1 | h2.2.1.1 |
| h2.2 | h2.2.1 |          |

**** h2.2.1
***** h2.2.1.1
aaaaa
*** h2.3
* h3
<<<

I would expect both output rows to be identical. But it seems that (org-with-wide-buffer) has no effect on (org-element-parse-buffer) with VISIBLE-ONLY argument.

While I believe this is a bug, I would also appreciate hearing about possible work-arounds.

thx

reply via email to

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