Make storing note upon headline change more robust
Let's not wait until our code turns out to be broken, but fix it now.
This commit is contained in:
parent
fb60b22c5e
commit
c5f1e98bf8
@ -1058,17 +1058,14 @@ cache if that's in use."
|
|||||||
;; Update headline
|
;; Update headline
|
||||||
(org-edit-headline new-headline)
|
(org-edit-headline new-headline)
|
||||||
|
|
||||||
;; Store note manually (I tried using `org-add-log-note', but did not
|
;; Code to add note interactively taken from
|
||||||
;; succeed …); maybe use the logging function from
|
|
||||||
;; https://sachachua.com/blog/2022/11/logging-sent-messages-to-org-mode-with-message-sent-hook/
|
;; https://sachachua.com/blog/2022/11/logging-sent-messages-to-org-mode-with-message-sent-hook/
|
||||||
;; instead?
|
(move-marker org-log-note-return-to (point))
|
||||||
(goto-char (org-log-beginning 'create))
|
(move-marker org-log-note-marker (point))
|
||||||
(indent-according-to-mode)
|
(with-temp-buffer
|
||||||
(insert "- Note taken on ")
|
(insert (format "Changed headline from: %s\n" old-headline))
|
||||||
(org-insert-time-stamp (current-time) t t)
|
(let ((org-log-note-purpose 'note))
|
||||||
(insert " \\\\\n")
|
(org-store-log-note))))))
|
||||||
(indent-according-to-mode)
|
|
||||||
(insert (format " Changed headline from: %s\n" old-headline)))))
|
|
||||||
|
|
||||||
(when org-refile-use-cache
|
(when org-refile-use-cache
|
||||||
(org-refile-cache-clear))
|
(org-refile-cache-clear))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user