New note not included in org-element-parse-buffer result

2023-05-09 Thread bvchgvbt
Hi all, I'm attempting my first non-trivial elisp and seem to be falling at the first hurdle. Specifically, I am using (org-trigger-hook) to inspect a TODO->DONE state change, and am finding that the note that I insert when the state change is logged is not present in the result of a call to (org

Re: New note not included in org-element-parse-buffer result

2023-05-15 Thread bvchgvbt
> "Ihor Radchenko" wrote: > bvchg...@mail.com writes: > > > am finding that the note that I insert when the state change > > is logged is not present in the result of a call to > > (org-element-parse-buffer). > > The note might indeed not yet be inside the Org buffer. > `org-add-log-setup' arranges

org-element tutorial?

2023-05-15 Thread bvchgvbt
Hi, Does anyone know of a good tutorial on using org-element? I'm finding the documentation hard to grok. Alternatively, given a doc like * TODO No ** Uninteresting - item 1 - item 2 * NEXT My thing SCHEDULED: <2023-05-16 Tue .+1d> :PROPERTIES: :STYLE: habit :LAST_REPEAT: [2023-05

Modifying the parse tree

2023-05-25 Thread bvchgvbt
After calling, say, org-element-adopt-elements, do I (or rather my code) have to do anything to make the modified tree apply to the Org document/ buffer that the tree came from? I can see that the tree is modified but it isn't reflected in the buffer it came from, and furthermore calling org-eleme

Re: Modifying the parse tree

2023-05-25 Thread bvchgvbt
"Ihor Radchenko" wrote: > bvchg...@mail.com writes: > Parse tree is not kept in sync with the original buffer when you > retrieve it by `org-element-parse-buffer'. Okay, thanks. I thought that might be the case, but couldn't be sure. > We generally do not currently > have a way to modify Org buf

Re: Modifying the parse tree

2023-05-26 Thread bvchgvbt
> "Ihor Radchenko" wrote: > >> Which implies that you added invalid headline element to the tree. > > > > Hmm. Does > > headline (:title hello :todo-keyword TODO :todo-type todo) > > look valid to you as a minimal TODO-type headline? Created via: > > > > (let ((todo (org-element-create 'headline

Getting the components of an item in a plain-list

2023-06-05 Thread bvchgvbt
If I have a plain-list element that looks something like (plain-list (:type unordered :begin 260 :end 571 :contents-begin 260 :contents-end 571 :structure ((260 2 "- " nil nil nil 338) (338 2 "- " nil nil nil 413) (413 2 "- " nil nil nil 489) (489 2 "- " nil nil nil 571)) :post