From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id i51FJuffGWHSggEAgWs5BA (envelope-from ) for ; Mon, 16 Aug 2021 05:47:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GMN7IeffGWFsAQAA1q6Kng (envelope-from ) for ; Mon, 16 Aug 2021 03:47:51 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 82951129A7 for ; Mon, 16 Aug 2021 05:47:50 +0200 (CEST) Received: from localhost ([::1]:36246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFTbJ-0007BM-2W for larch@yhetil.org; Sun, 15 Aug 2021 23:47:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFTaw-0007BE-B5 for emacs-orgmode@gnu.org; Sun, 15 Aug 2021 23:47:26 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:35590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFTau-0006F7-Kg for emacs-orgmode@gnu.org; Sun, 15 Aug 2021 23:47:26 -0400 Received: by mail-io1-xd2d.google.com with SMTP id a15so2640009iot.2 for ; Sun, 15 Aug 2021 20:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=X6V90nDofvg91RNLV6pjWps1Xf0AfCKbzoYLKQSM9lI=; b=ru0gRdUeTlxzy8wEAmgws8Veq8ENkdM+AH3bFSAJWMaoSUoRzrnzNR1Qh16mF9e+fR 9SV+bRT2uf7J5nZdsSmz/XFCvH5W/SlIMlhTUSrvQfvre4QHinUQbcYpPJJ/srcWVRce BIQ887jZsz79uPqs+JU8YkpF+LBVkXhrEg5G7DT7HX8o+JjEyBnDoxyO9wvjYdg982lC TzeVihmHfCUosDAZk164qERyHrEOWKzHGFoai6b46/+3iFeaaHpUhlunpjRVI8KC0BRp Lt2TWif2tkQ43e+WbDcTCxyVe+9vJh/UsLm/dKprcXsAsKDTQgX78eh3uxVmEv/bokXs H4FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=X6V90nDofvg91RNLV6pjWps1Xf0AfCKbzoYLKQSM9lI=; b=iOzHrHy2UL3sTkdpFhFK6u/Hoh4324Crw+9aQ3Q9FPoS1MfEuctCohQttpvtm7+NjZ blElrYbe9UURdd2KYVuyTWqudTGz7EAxzmS0cFRqlKha6U6eY++06HJddMVNYxTAj/Lm 6KGf4CBxE9N7JYVIpzGhI8HL93Iu2KoftSLjB+8lEHAtdbS7DZbk0kK/y/Q6OKfuG0Ga 7TjGvOeAzNBiXIlZJT86i3JceyIZzlKY8X0jDeTNQcgzHvsX7PTWbyppUwDWAE1tNLq3 3UcplXn9Ps9/bSUldOSw57XV9D5ybKmpH0qSjr/e88mqLiFrSYHl14fTlm6lu0ZLVmHT keGA== X-Gm-Message-State: AOAM530fDnVoq6Q6vzrwEmkQMxiESEb41d12kEdLvNe7WwIkkbFENj/u WreVa1MDpR+ycrpGX+Myeqeh5htZeda8w8dzIlYSKzUbzNx+uQ== X-Google-Smtp-Source: ABdhPJyIL0uTdp/vPWoXrB2p8KJqxVxbANHBu4MptZ2e24s20sET33mv7oebC2P7Td8XN9qTLV0QiuVJ/ZHrBYS55Ss= X-Received: by 2002:a6b:6319:: with SMTP id p25mr11385306iog.100.1629085642751; Sun, 15 Aug 2021 20:47:22 -0700 (PDT) MIME-Version: 1.0 From: Rodrigo Morales Date: Sun, 15 Aug 2021 22:46:15 -0500 Message-ID: Subject: [Q] How to get all the properties of the current subtree? To: org-mode-email Content-Type: multipart/alternative; boundary="0000000000000b812c05c9a50fb5" Received-SPF: pass client-ip=2607:f8b0:4864:20::d2d; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-io1-xd2d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629085671; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=X6V90nDofvg91RNLV6pjWps1Xf0AfCKbzoYLKQSM9lI=; b=j+TdASb+ZPsEq4EQ39kiCiZMwG/BW0ffrGiEPRwBUMRZsW09bxAPl7L5G7jTltHsvlRztY zeJt2LhQ0dXeivC8atERfQKoF5xVu6X6h5f5Uonk1VdoUnBDRfsCNi5+141wXStrydVyMk zFOdcEugOrwjMgYdeHvxlAvfo/abD0y+jnlmD2Ig7CBomCeQ+/ZRDyyobnkUb3bHlgds7A u3dM4ajpA2iGpOLFUY1OH2aceHKoyZw0GB32CnVHSrOfUE/E6uQ6H1TWs1U99u2pjcU/am lBprzjre3+0VV7GDJSOGvsfcMqYXHjxByeaqGpQEJkEHYo9yzJm5aCrU/WWEfg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629085671; a=rsa-sha256; cv=none; b=D1/GfvAklQkSCx14LG/sFWge+WSTZC0bhtBJ4Do27mG7M2xLVC3bBBiZgh3ew3P8nhpQlc umazPVClBdOEs8x++5urCPAFX6RGY3ZoMBtrX2fuNDC7wwhVrBX8sQ/DrqXJ4nHFRYDGnB s0HRPF+DRuWz/LPogEYE6ujFHCt/7zXXryKCLx3PRwGpqafAOsgpK4dzd1yBNc11+dsxTe 0aeAfLrW03MEQ0xJ094tXYBKcf5+lZMiePAVNkhNIn49GQBzBBJgzXGrHcGC2iq0IWMbwB mwhxmDFvf9O+VJgK45lIuouaYJhLz0gOm04vxVndQQcYNR/W0AkixshT+iW6cg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ru0gRdUe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ru0gRdUe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 82951129A7 X-Spam-Score: -2.11 X-Migadu-Scanner: scn1.migadu.com X-TUID: fpzQwGJbSJpN --0000000000000b812c05c9a50fb5 Content-Type: text/plain; charset="UTF-8" * Epilogue Consider the following Org Mode file #+CAPTION: The main.org file #+BEGIN_SRC org ,* The first heading :PROPERTIES: :FOO: foo-value :END: ,** The first subheading :PROPERTIES: :BAR: bar-value :END: #+END_SRC I know that I can use the function =org-entry-properties= to get some properties of the current subtree. Apparently, =org-entry-properties= is only able to get the direct properties (i.e. it doesn't consider the inherited properties) #+BEGIN_SRC elisp (with-current-buffer "main.org" (end-of-buffer) (pp-to-string (org-entry-properties))) #+END_SRC #+RESULTS: #+begin_example (("CATEGORY" . "main") ("BAR" . "bar-value") ("BLOCKED" . "") ("FILE" . "/home/beep1560/e/main.org") ("PRIORITY" . "B") ("ITEM" . "The first subheading")) #+end_example Note that even though =foo= is an inherited property of "The first subheading", it is not obtained by =org-entry-properties=. Because =foo= is an inherited property of "The first subheading", it can be obtained by =org-entry-get= (see below). #+BEGIN_SRC elisp (with-current-buffer "main.org" (end-of-buffer) (org-entry-get nil "FOO" t)) #+END_SRC #+RESULTS: #+begin_example foo-value #+end_example * The question My question is: How to get all the properties (inherited properties included) of the current subtree? In the example shown below, I would expect the following result #+BEGIN_EXAMPLE (("CATEGORY" . "main") ("FOO" . "foo-value") ("BAR" . "bar-value") ("BLOCKED" . "") ("FILE" . "/home/beep1560/e/main.org") ("PRIORITY" . "B") ("ITEM" . "The first subheading")) #+END_EXAMPLE As I explained above, the function =org-entry-properties= doesn't accomplish this. --0000000000000b812c05c9a50fb5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
* Epilogue

Consider the following Org Mode file
=
#+CAPTION: The main.org file
#+BEGIN= _SRC org
,* The first heading
:PROPERTIES:
:FOO: foo-value
:END= :

,** The first subheading
:PROPERTIES:
:BAR: bar-value
:EN= D:
#+END_SRC

I know that I can use the function =3Dorg-entry-prop= erties=3D to get some
properties of the current subtree. Apparently, =3D= org-entry-properties=3D
is only able to get the direct properties (i.e. = it doesn't consider
the inherited properties)

#+BEGIN_SRC eli= sp
(with-current-buffer "main.org&q= uot;
=C2=A0 (end-of-buffer)
=C2=A0 (pp-to-string (org-entry-propertie= s)))
#+END_SRC

#+RESULTS:
#+begin_example
(("CATEGORY&= quot; . "main")
=C2=A0("BAR" . "bar-value"= )
=C2=A0("BLOCKED" . "")
=C2=A0("FILE" = . "/home/beep1560/e/main.org")=C2=A0("PRIORITY" . "B")
=C2=A0("ITEM" . = "The first subheading"))
#+end_example

Note that even t= hough =3Dfoo=3D is an inherited property of "The first
subheading&q= uot;, it is not obtained by =3Dorg-entry-properties=3D. Because
=3Dfoo= =3D is an inherited property of "The first subheading", it can be=
obtained by =3Dorg-entry-get=3D (see below).

#+BEGIN_SRC elisp(with-current-buffer "main.org"=
=C2=A0 (end-of-buffer)
=C2=A0 (org-entry-get nil "FOO" t))=
#+END_SRC

#+RESULTS:
#+begin_example
foo-value
#+end_ex= ample

* The question

My question is: How to get all the prope= rties (inherited properties
included) of the current subtree? In the exa= mple shown below, I would
expect the following result

#+BEGIN_EXA= MPLE
(("CATEGORY" . "main")
=C2=A0("FOO"= ; . "foo-value")
=C2=A0("BAR" . "bar-value"= ;)
=C2=A0("BLOCKED" . "")
=C2=A0("FILE"= . "/home/beep1560/e/main.org")=C2=A0("PRIORITY" . "B")
=C2=A0("ITEM" .= "The first subheading"))
#+END_EXAMPLE

As I explained = above, the function =3Dorg-entry-properties=3D doesn't
accomplish th= is.
--0000000000000b812c05c9a50fb5--