summaryrefslogtreecommitdiff
path: root/lisp/org-attach.el
diff options
context:
space:
mode:
authorSébastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:35 +0200
committerSébastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:35 +0200
commit361fd4da7cfa870165cb1ec175cdbea55ca40e7e (patch)
treea36bfd91d9e14c354b6eaebb20f5d5d64ec438db /lisp/org-attach.el
parent77ddd382df838e38504b822e729250b2a6dd9b63 (diff)
Imported Upstream version 8.2.7a
Diffstat (limited to 'lisp/org-attach.el')
-rw-r--r--lisp/org-attach.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 07307e6..bcf7ba7 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -208,7 +208,9 @@ the directory and (if necessary) the corresponding ID will be created."
(save-excursion
(save-restriction
(widen)
- (goto-char org-entry-property-inherited-from)
+ (if (marker-position org-entry-property-inherited-from)
+ (goto-char org-entry-property-inherited-from)
+ (org-back-to-heading t))
(let (org-attach-allow-inheritance)
(org-attach-dir create-if-not-exists-p)))))
(org-attach-check-absolute-path attach-dir)