From 2df81a94b718544b8c621d59ce84bdca35d18ae6 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 22 May 2015 21:15:57 -0400 Subject: Pass alists directly to completing-read Doh, I didn't know you could do that. Also, use assoc-string instead of assoc. --- bog.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bog.el b/bog.el index 483f5d6..9d61c23 100644 --- a/bog.el +++ b/bog.el @@ -558,9 +558,8 @@ If the citekey prompt is slow to appear, consider enabling the (mapcar (lambda (path) (cons (file-name-nondirectory path) path)) citekey-files)) - (fname (org-icompleting-read "Select file: " - (mapcar #'car fname-paths)))) - (setq citekey-file (cdr (assoc fname fname-paths)))))) + (fname (org-icompleting-read "Select file: " fname-paths))) + (setq citekey-file (cdr (assoc-string fname fname-paths)))))) (org-open-file citekey-file))) (defun bog-citekey-files (citekey) @@ -1035,9 +1034,8 @@ level `bog-refile-maxlevel' are considered." (let ((note-paths (mapcar (lambda (path) (cons (file-name-nondirectory path) path)) (bog-notes)))) - (cdr (assoc (org-icompleting-read "File: " - (mapcar #'car note-paths)) - note-paths)))) + (cdr (assoc-string (org-icompleting-read "File: " note-paths) + note-paths)))) (defmacro bog--with-search-lprops (&rest body) "Execute BODY with Bog-related agenda values. -- cgit v1.2.3