summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-12-15 19:08:07 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-12-15 19:08:07 +0100
commit0a82c8370d4543971524592bbab5ab2535356630 (patch)
tree6116d838603beb9512ebe875a1cb79d34574ee32
parent1d38233b83f97c18150ed065b4bad7717f11b424 (diff)
downloadorg-mode-0a82c8370d4543971524592bbab5ab2535356630.tar.gz
org-attach: Tiny refactoring
* lisp/org-attach.el (org-attach): Use `org-with-point-at'.
-rw-r--r--lisp/org-attach.el5
1 files changed, 1 insertions, 4 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 2c5558b..4fd9cd9 100644
--- a/lisp/org-attach.el
+++ b/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)))
(unless marker
(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)
(save-excursion
(save-window-excursion