emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Should "org-element-parse-buffer" check whether the buffer's major mode is org mode?
@ 2024-09-02  9:51 Antonio Romano
  2024-09-04 19:43 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Antonio Romano @ 2024-09-02  9:51 UTC (permalink / raw)
  To: emacs-orgmode

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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-26 17:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02  9:51 Should "org-element-parse-buffer" check whether the buffer's major mode is org mode? Antonio Romano
2024-09-04 19:43 ` Ihor Radchenko
2024-09-04 21:29   ` Antonio Romano
2024-09-22 16:37     ` Ihor Radchenko
2024-10-26 17:34       ` Ihor Radchenko

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).