(interactive "d\nMCUSTOM_ID: ")
(org-entry-put point "CUSTOM_ID" value))
+ (defun esy/org-maybe-prompt-custom-id ()
+ "Prompt for CUSTOM_ID if not set for the entry at POINT."
+ (unless (org-entry-get (point) "CUSTOM_ID")
+ (beacon-blink)
+ (org-cycle)
+ (call-interactively #'esy/org-fill-custom-id)
+ (org-global-cycle 1)))
+
(defun esy/org-fill-custom-ids-in-buffer ()
"Visit headers in the current buffer and set CUSTOM_ID for each."
(interactive)
(require 'beacon)
(org-global-cycle 1)
- (org-map-entries (lambda ()
- (unless (org-entry-get (point) "CUSTOM_ID")
- (beacon-blink)
- (org-cycle)
- (call-interactively #'esy/org-fill-custom-id)
- (org-global-cycle 1)))))
+ (message "Filled %d CUSTOM_ID properties."
+ (length (remove nil
+ (org-map-entries
+ #'esy/org-maybe-prompt-custom-id)))))
#+end_src
** Export and publish
:PROPERTIES: