diff options
author | stardiviner <numbchild@gmail.com> | 2021-01-25 10:04:40 +0800 |
---|---|---|
committer | stardiviner <numbchild@gmail.com> | 2021-01-25 10:04:40 +0800 |
commit | 3d80b5bff65da0697478e780697ef3affcc7da5f (patch) | |
tree | 6faa32965e319cec43716ff81ee3299510c3ae7e | |
parent | 3916a574063887f145af2e42667fb6478a065440 (diff) | |
download | org-mode-3d80b5bff65da0697478e780697ef3affcc7da5f.tar.gz |
org-contacts.el: Display contacts buffer result.
* contrib/lisp/org-contacts.el (org-contacts-link-open): Display the
searched contacts file buffer.
-rw-r--r-- | contrib/lisp/org-contacts.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 2811db6..cd10e48 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -1197,6 +1197,7 @@ are effectively trimmed). If nil, all zero-length substrings are retained." "Open contacts: link type with jumping or searching." (let ((query path)) (cond + ;; /query/ format searching ((string-match "/.*/" query) (let* ((f (car org-contacts-files)) (buf (get-buffer (file-name-nondirectory f)))) @@ -1204,12 +1205,14 @@ are effectively trimmed). If nil, all zero-length substrings are retained." (with-current-buffer buf (string-match "/\\(.*\\)/" query) (occur (match-string 1 query))))) + ;; jump to contact headline directly (t (let* ((f (car org-contacts-files)) (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))))) + (goto-char (marker-position (org-find-exact-headline-in-buffer query)))) + (display-buffer buf '(display-buffer-below-selected))) ;; FIXME ;; (let* ((contact-entry (plist-get (org-contacts--all-contacts) query)) ;; (contact-name (plist-get contact-entry :name)) |