浏览代码

org-attach: Tiny refactoring

* lisp/org-attach.el (org-attach): Use `org-with-point-at'.
Nicolas Goaziou 5 年之前
父节点
当前提交
0a82c8370d
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      lisp/org-attach.el

+ 1 - 4
lisp/org-attach.el

@@ -254,10 +254,7 @@ Shows a list of commands and prompts for another key to execute a command."
 		       (get-text-property (point) 'org-marker)))
 		       (get-text-property (point) 'org-marker)))
       (unless marker
       (unless marker
 	(error "No item in current line")))
 	(error "No item in current line")))
-    (save-excursion
-      (when marker
-	(set-buffer (marker-buffer marker))
-	(goto-char marker))
+    (org-with-point-at marker
       (org-back-to-heading-or-point-min t)
       (org-back-to-heading-or-point-min t)
       (save-excursion
       (save-excursion
 	(save-window-excursion
 	(save-window-excursion