Compare commits

...

2 커밋

작성자 SHA1 메시지 날짜
Daniel - 8f4fa01304
Remove redundant save of point and mark
`org-with-point-at` will do this already (at least for point).
2021-04-01 16:51:46 +02:00
Daniel - 1916eb6736
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.
2021-04-01 16:51:03 +02:00
1개의 변경된 파일5개의 추가작업 그리고 7개의 파일을 삭제

파일 보기

@ -734,10 +734,9 @@ Use `org-store-link' to save link to `org-stored-links'."
(unless (derived-mode-p 'org-mode)
(user-error "Not in Org Mode"))
(let ((pom (db/org--get-location arg)))
(save-mark-and-excursion
(org-with-point-at pom
(org-store-link nil t))
(insert (apply #'format "[[%s][%s]]" (cl-first org-stored-links))))))
(org-with-point-at pom
(org-store-link nil t))
(insert (apply #'format "[[%s][%s]]" (cl-first org-stored-links)))))
(defun db/org-add-link-to-current-clock ()
"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."
(user-error "Not in Org Mode, aborting"))
(unless org-clock-marker
(user-error "No clocked-in task, aborting"))
(save-mark-and-excursion
(org-with-point-at org-clock-marker
(org-store-link nil t)))
(org-with-point-at org-clock-marker
(org-store-link nil t))
(pcase-let ((`(,location ,description) (cl-first org-stored-links)))
(org-insert-link nil location description)))