2 Commits

Author SHA1 Message Date
  Daniel 8f4fa01304
Remove redundant save of point and mark 4 months ago
  Daniel 1916eb6736
Move point when inserting link to other Org mode item 4 months ago
1 changed files with 5 additions and 7 deletions
  1. 5
    7
      site-lisp/db-org.el

+ 5
- 7
site-lisp/db-org.el View File

@@ -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.
@@ -749,9 +748,8 @@ in an Org Mode buffer or when the clock is not active."
749 748
     (user-error "Not in Org Mode, aborting"))
750 749
   (unless org-clock-marker
751 750
     (user-error "No clocked-in task, aborting"))
752
-  (save-mark-and-excursion
753
-    (org-with-point-at org-clock-marker
754
-      (org-store-link nil t)))
751
+  (org-with-point-at org-clock-marker
752
+    (org-store-link nil t))
755 753
   (pcase-let ((`(,location ,description) (cl-first org-stored-links)))
756 754
     (org-insert-link nil location description)))
757 755
 

Loading…
Cancel
Save