diff options
author | Bastien Guerry <bzg@altern.org> | 2014-05-21 19:47:13 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2014-05-21 19:47:13 +0200 |
commit | 241286865cb30dd36afc343209a9b5c418863939 (patch) | |
tree | 848299506a8c58e2b7b69283f9a23c148a9f565c | |
parent | 844a6494c37b474b738cdd857b3f6b9bdabc038e (diff) | |
download | org-mode-241286865cb30dd36afc343209a9b5c418863939.tar.gz |
org-attach.el (org-attach-dir): Fix bug
* org-attach.el (org-attach-dir): When the property is
"inherited" from a variable outside of the file, do not use
`org-entry-property-inherited-from' to find the attachment
position, assume we need to go back to the current headline.
-rw-r--r-- | lisp/org-attach.el | 4 |
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) |