branch: externals/denote commit 4dda46835ec7c826dac6baac5bdeb917036a1fa1 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Re-indent section in the manual --- README.org | 58 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/README.org b/README.org index 2674a7e0ce..96f033a48a 100644 --- a/README.org +++ b/README.org @@ -2304,35 +2304,35 @@ file. The contents of the subtree become the contents of the new note and are removed from the old one. #+begin_src emacs-lisp - (defun my-denote-org-extract-subtree () - "Create new Denote note using current Org subtree. - Make the new note use the Org file type, regardless of the value - of `denote-file-type'. - - Use the subtree title as the note's title. If available, use the - tags of the heading are used as note keywords. - - Delete the original subtree." - (interactive) - (if-let ((text (org-get-entry)) - (heading (org-get-heading :no-tags :no-todo :no-priority :no-comment))) - (let ((element (org-element-at-point)) - (tags (org-get-tags))) - (delete-region (org-entry-beginning-position) - (save-excursion (org-end-of-subtree t) (point))) - (denote heading - tags - 'org - nil - (or - ;; Check PROPERTIES drawer for :created: or :date: - (org-element-property :CREATED element) - (org-element-property :DATE element) - ;; Check the subtree for CLOSED - (org-element-property :raw-value - (org-element-property :closed element)))) - (insert text)) - (user-error "No subtree to extract; aborting"))) +(defun my-denote-org-extract-subtree () + "Create new Denote note using current Org subtree. +Make the new note use the Org file type, regardless of the value +of `denote-file-type'. + +Use the subtree title as the note's title. If available, use the +tags of the heading are used as note keywords. + +Delete the original subtree." + (interactive) + (if-let ((text (org-get-entry)) + (heading (org-get-heading :no-tags :no-todo :no-priority :no-comment))) + (let ((element (org-element-at-point)) + (tags (org-get-tags))) + (delete-region (org-entry-beginning-position) + (save-excursion (org-end-of-subtree t) (point))) + (denote heading + tags + 'org + nil + (or + ;; Check PROPERTIES drawer for :created: or :date: + (org-element-property :CREATED element) + (org-element-property :DATE element) + ;; Check the subtree for CLOSED + (org-element-property :raw-value + (org-element-property :closed element)))) + (insert text)) + (user-error "No subtree to extract; aborting"))) #+end_src Have a different workflow? Feel welcome to discuss it in any of our