Add original value as default when changing Org item headlines

This allows to make simple changes to the original headline of an item.
master
Daniel Borchmann 11 months ago
parent d23a8dc817
commit efb7500202
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
  1. 10
      site-lisp/db-org.el

@ -691,7 +691,15 @@ Interactively query for HEADLINE when not provided."
(user-error "Neither in an Org mode nor Org agenda buffer, aborting"))
(unless new-headline
(setq new-headline (read-string "New Headline: ")))
(let ((default-value (cond
((derived-mode-p 'org-mode)
(org-entry-get (point) "ITEM"))
((derived-mode-p 'org-agenda-mode)
(org-agenda-with-point-at-orig-entry
nil (org-entry-get (point) "ITEM"))))))
(setq new-headline (read-string "New Headline: "
nil nil
default-value))))
(unless (stringp new-headline)
(user-error "New headline must be string"))

Loading…
Cancel
Save