emacs-orgmode
[Top][All Lists]
Advanced

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

[Question] Learning to use Org Element API setters and how to ignore pro


From: Antonio Romano
Subject: [Question] Learning to use Org Element API setters and how to ignore properties
Date: Sun, 10 Mar 2024 14:21:19 +0000

Hi all, I start with the premise that I'm a novice in Elisp development
so I don't really have that much experience. Lately I've been toying
with the idea of applying Lindholm's "A three way merge for XML
documents" paper to Org mode in order to achieve a context aware
merging mechanism between two documents given their syntax tree. 

There's nothing concrete on my side, but I'd like to try and see if
org-element's AST can fit this kind of merging. However, I've had close
to no progress in trying to make the setter functions work despite all
the indications on worg and I think I would really benefit to see some
concrete usage examples somewhere.

Another concerns is about properties - given a simple Org document with
just one headline marked as TODO, this is its parse tree:

   (with-current-buffer "testorg1.org"
     (org-element-contents
      (pp (org-element-parse-buffer))))
   
   (org-data
    (:begin 1 :contents-begin 1 :contents-end 35 :end 35 :robust-begin
   3 :robust-end 33 :post-blank 0 :post-affiliated 1 :path
   "/home/antonio/testorg1.org" :mode org-data :CATEGORY "testorg1"
   :granularity nil)
    (headline
     (:raw-value "Hello" :begin 1 :end 35 :pre-blank 0 :contents-begin
   14 :contents-end 35 :robust-begin 16 :robust-end 33 :level 1
   :priority nil :tags nil :todo-keyword
              #("TODO" 0 4
                (face
                 (org-todo org-level-1)
                 fontified t))
              :todo-type todo :post-blank 0 :footnote-section-p nil
   :archivedp nil :commentedp nil :post-affiliated 1 :title
              (#("Hello" 0 5
                 (:parent #1)))
              :mode first-section :granularity nil :parent #0)
     (section
      (:begin 14 :end 35 :contents-begin 14 :contents-end 35 :robust-
   begin 14 :robust-end 33 :post-blank 0 :post-affiliated 14 :mode
   section :granularity nil :parent #1)
      (paragraph
       (:begin 14 :end 35 :contents-begin 14 :contents-end 35 :post-
   blank 0 :post-affiliated 14 :mode planning :granularity nil :parent
   #2)
       #("This is a paragraph.\n" 0 21
         (:parent #3))))))
   nil


The :todo-keyword contains data about face and properties which are
only relevant for viewing the document in the buffer and not for the
.org file content itself. How can I read its text without any property
info attached to it?


Sorry for the naive questions and thanks in advance for your
availability.




reply via email to

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