commit e716f771f95d9cb49a3525f4447d201cc26896d7 parent 149e79a18d18626f92701458a18d4f74b2dffbca Author: Oleh Krehel <ohwoeowho@gmail.com> Date: Sun, 18 Jan 2015 12:25:25 +0100 Fix for when the point is before the first heading org-download.el (org-download-get-heading): Fix. Diffstat:
| M | org-download.el | | | 11 | +++++++---- |
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/org-download.el b/org-download.el @@ -129,10 +129,13 @@ Set this to \"\" if you don't want time stamps." "Return the heading of the current entry's LVL level parent." (save-excursion (let ((cur-lvl (org-current-level))) - (unless (= cur-lvl 1) - (org-up-heading-all (- (1- (org-current-level)) lvl))) - (substring-no-properties - (org-get-heading))))) + (if cur-lvl + (progn + (unless (= cur-lvl 1) + (org-up-heading-all (- (1- (org-current-level)) lvl))) + (substring-no-properties + (org-get-heading))) + "")))) (defun org-download--dir-1 () "Return the first part of the directory path for `org-download--dir'.