From 051087d7167fb78cdc0911e3bbaba8b87fa69b42 Mon Sep 17 00:00:00 2001 From: Lucas Viana Date: Tue, 8 Feb 2022 12:38:19 -0300 Subject: [PATCH] fix(org): don't error org-download at top level Org-attach (and thus org-download) can work before the first headline if the user sets `org-attach-auto-tag` to `nil`. But when inserting files in this situation, this advice will display an error message due to using `org-back-to-heading`. So I think it makes more sense to use `org-back-to-heading-or-point-min`. --- modules/lang/org/contrib/dragndrop.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/org/contrib/dragndrop.el b/modules/lang/org/contrib/dragndrop.el index a410cb2f9..afbeeba25 100644 --- a/modules/lang/org/contrib/dragndrop.el +++ b/modules/lang/org/contrib/dragndrop.el @@ -62,7 +62,7 @@ (save-excursion (org-display-inline-images t t - (progn (org-back-to-heading t) (point)) + (progn (org-back-to-heading-or-point-min t) (point)) (progn (org-end-of-subtree t t) (when (and (org-at-heading-p) (not (eobp))) (backward-char 1)) (point)))))))