emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Antonio Romano <n58r@pm.me>
To: emacs-orgmode@gnu.org
Subject: [Question] Learning to use Org Element API setters and how to ignore properties
Date: Sun, 10 Mar 2024 14:21:19 +0000	[thread overview]
Message-ID: <99b3973e68eb96804b7c085fadeb47cd585178d1.camel@pm.me> (raw)

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	other threads:[~2024-03-10 14:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-10 14:21 Antonio Romano [this message]
2024-03-11 10:24 ` [Question] Learning to use Org Element API setters and how to ignore properties Bruno Barbier
2024-03-13 13:41 ` 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=99b3973e68eb96804b7c085fadeb47cd585178d1.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).