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`.
This commit is contained in:
Lucas Viana 2022-02-08 12:38:19 -03:00 committed by Henrik Lissner
parent 7e6baca99d
commit 051087d716

View file

@ -62,7 +62,7 @@
(save-excursion (save-excursion
(org-display-inline-images (org-display-inline-images
t t 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) (progn (org-end-of-subtree t t)
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1)) (when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
(point))))))) (point)))))))