[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Should "org-element-parse-buffer" check whether the buffer's major mode
From: |
Antonio Romano |
Subject: |
Should "org-element-parse-buffer" check whether the buffer's major mode is org mode? |
Date: |
Mon, 02 Sep 2024 09:51:24 +0000 |
Hi all,
yesterday I've sent a question on Emacs StackExchange
(https://emacs.stackexchange.com/questions/82063) where I described a
small issue I had encountered while using Org Element API.
What I did was simply parse out a buffer, change all headlines's TODO
keyword in its AST to "DONE", interpret the resulting AST and finally
print out the resulting document to a new buffer. The issue I had
encountered was that an headline like "* TODO Hello" would wrongly
become "* DONE TODO Hello" instead of "* DONE Hello".
A kind user pointed out that the issue was that I called "org-element-
parse-buffer" in a fundamental-mode buffer and, in fact, turning on
org-mode beforehand solved the issue. As the user suggested, I'm here
to ask you if this is the intended behavior or if it would be better
limiting the usage of the function to org-mode (and derived) buffers
only. Thank you in advance.
- Should "org-element-parse-buffer" check whether the buffer's major mode is org mode?,
Antonio Romano <=