From: Antonio Romano <n58r@pm.me>
To: emacs-orgmode@gnu.org
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 [thread overview]
Message-ID: <1b2b8c2791e628f6a41ef533e49a5ac9e3dee8a4.camel@pm.me> (raw)
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.
next reply other threads:[~2024-09-02 9:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 9:51 Antonio Romano [this message]
2024-09-04 19:43 ` Should "org-element-parse-buffer" check whether the buffer's major mode is org mode? Ihor Radchenko
2024-09-04 21:29 ` Antonio Romano
2024-09-22 16:37 ` Ihor Radchenko
2024-10-26 17:34 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b2b8c2791e628f6a41ef533e49a5ac9e3dee8a4.camel@pm.me \
--to=n58r@pm.me \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).