Pārlūkot izejas kodu

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.
master
Daniel 2 mēnešus atpakaļ
vecāks
revīzija
1916eb6736
Šim parakstam datu bāzē netika atrasta zināma atslēga
1 mainītis faili ar 3 papildinājumiem un 4 dzēšanām
  1. 3
    4
      site-lisp/db-org.el

+ 3
- 4
site-lisp/db-org.el Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt