branch: externals/org commit 9f3ee0fa5e3e8835dd34f134f05840aa28a21f5f Author: John Wiegley <jo...@gnu.org> Commit: Ihor Radchenko <yanta...@posteo.net>
org-archive-save-context-info: Allow parent ID to be saved in archived entry * lisp/org-archive.el (org-archive-save-context-info): New allowed value ini the list: `olid'. (org-archive-subtree): Save parent heading ID in the context when `olid' is in `org-archive-save-context-info'. --- etc/ORG-NEWS | 5 +++++ lisp/org-archive.el | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 61bb0d379f..43ef7fd2de 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -221,6 +221,11 @@ retail 4-4-5 calendars, etc). # adding new customizations, or changing the interpretation of the # existing customizations. +*** New context available to save in archived headings + +~org-archive-save-context-info~ can now contain ~olid~ symbol to save +parent heading id in the archived heading. + *** New hook ~org-archive-finalize-hook~ Hook run after successfully archiving a subtree in final location. diff --git a/lisp/org-archive.el b/lisp/org-archive.el index 8d3658d27d..fb386e6836 100644 --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -136,6 +136,7 @@ For each symbol present in the list, a property will be created in the archived entry, with a prefix \"ARCHIVE_\", to remember this information." :group 'org-archive + :package-version '(Org . "9.8") :type '(set :greedy t (const :tag "Time" time) (const :tag "File" file) @@ -144,6 +145,7 @@ information." (const :tag "Priority" priority) (const :tag "Inherited tags" itags) (const :tag "Outline path" olpath) + (const :tag "Outline parent id" olid) (const :tag "Local tags" ltags))) (defcustom org-archive-hook nil @@ -312,6 +314,9 @@ direct children of this heading." (olpath . ,(mapconcat #'identity (org-get-outline-path) "/")) + (olid . ,(org-with-wide-buffer + (and (org-up-heading-safe) + (org-entry-get (point) "ID")))) (time . ,time) (todo . ,(org-entry-get (point) "TODO"))))) ;; We first only copy, in case something goes wrong