Move point when inserting link to other Org mode item

This is the natural flow, as usually one continues writing after the link, not
before it.
This commit is contained in:
Daniel - 2021-04-01 16:49:45 +02:00
parent 6a590da9cb
commit 1916eb6736
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 3 additions and 4 deletions

View File

@ -734,10 +734,9 @@ Use `org-store-link' to save link to `org-stored-links'."
(unless (derived-mode-p 'org-mode) (unless (derived-mode-p 'org-mode)
(user-error "Not in Org Mode")) (user-error "Not in Org Mode"))
(let ((pom (db/org--get-location arg))) (let ((pom (db/org--get-location arg)))
(save-mark-and-excursion (org-with-point-at pom
(org-with-point-at pom (org-store-link nil t))
(org-store-link nil t)) (insert (apply #'format "[[%s][%s]]" (cl-first org-stored-links)))))
(insert (apply #'format "[[%s][%s]]" (cl-first org-stored-links))))))
(defun db/org-add-link-to-current-clock () (defun db/org-add-link-to-current-clock ()
"Insert link to currently clocked-in item at point. "Insert link to currently clocked-in item at point.