org-dblock-write:columnview: Fix when :id file:foo.org is not open

* lisp/org-colview.el (org-dblock-write:columnview): Fix generating
columnview when :id point to a file that is not yet open in Emacs.
Just open it as needed.

Reported-by: Vlastimil Vondra <vlastimil.vondra@gmail.com>
Link: https://orgmode.org/list/CACjq+cwjyi-d_jFY9oVe_kviMfLqm4t3+DVtr_Qk_kZaZt7ncA@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2024-04-09 14:04:02 +03:00
parent 22306682ff
commit 67ec699769
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -1495,7 +1495,7 @@ PARAMS is a property list of parameters:
(setq view-file filename)
(setq view-pos position))
(_ (user-error "Cannot find entry with :ID: %s" id)))
(with-current-buffer (if view-file (get-file-buffer view-file)
(with-current-buffer (if view-file (org-get-agenda-file-buffer view-file)
(current-buffer))
(org-with-wide-buffer
(when view-pos (goto-char view-pos))