branch: externals/org commit f3e306c7375e6f9ba4dce27b8c3bdfbf9f2b78bc Author: Joris Caravati <t...@sula.io> Commit: Ihor Radchenko <yanta...@posteo.net>
lisp/org.el: Add `org-after-note-stored-hook' * lisp/org.el: Add `org-after-note-stored-hook' which is called at the end of the `org-store-log-note' function. * etc/ORG-NEWS: Document the new hook. TINYCHANGE --- etc/ORG-NEWS | 4 ++++ lisp/org.el | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index cb09b2e641..6c6fdbe2c9 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -735,6 +735,10 @@ any more. Run ~org-ctags-enable~ to setup hooks and advices: #+end_src ** New and changed options +*** New hook ~org-after-note-stored-hook~ + +This new hook runs when a note has been stored. + *** New option controlling how Org mode sorts things ~org-sort-function~ Sorting of agenda items, tables, menus, headlines, etc can now be diff --git a/lisp/org.el b/lisp/org.el index 8d921f11e7..4342ddd735 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1990,6 +1990,13 @@ Lisp variable `org-state'." :group 'org-todo :type 'hook) +(defcustom org-after-note-stored-hook nil + "Hook triggered after a note is stored. +The point is at the stored note when the hook is executed." + :group 'org-progress + :type 'hook + :package-version '(Org . "9.7")) + (defvar org-blocker-hook nil "Hook for functions that are allowed to block a state change. @@ -10846,6 +10853,7 @@ items are State notes." (unless (string-empty-p line) (indent-line-to ind) (insert-and-inherit line)))) + (run-hooks 'org-after-note-stored-hook) (message "Note stored") (org-back-to-heading t)))))) ;; Don't add undo information when called from `org-agenda-todo'.