From 7ed94bcf72adfbefcf4971182f056d3f856368a0 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Sat, 26 Feb 2022 00:49:34 +0800 Subject: [PATCH] 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 d452118..2cff1f7 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)))