branch: externals/org-contacts
commit 7ed94bcf72adfbefcf4971182f056d3f856368a0
Author: stardiviner <numbch...@gmail.com>
Commit: stardiviner <numbch...@gmail.com>

    Fix can't get-buffer when file is not opened which caused `buf` is nil.
---
 org-contacts.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-contacts.el b/org-contacts.el
index d452118f90..2cff1f7dce 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -1300,8 +1300,8 @@ Each element has the form (NAME . (FILE . POSITION))."
      ;; jump to contact headline directly
      (t
       (let* ((f (car org-contacts-files))
+             (_ (find-file f))
              (buf (get-buffer (file-name-nondirectory f))))
-        (unless (buffer-live-p buf) (find-file f))
         (with-current-buffer buf
           (goto-char (marker-position (org-find-exact-headline-in-buffer 
query))))
         (display-buffer buf '(display-buffer-below-selected)))

Reply via email to