From 3981af462451dd7526dacfb506e77c573eaf9503 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 2 Oct 2022 07:48:58 -0400 Subject: Allow completion to draw from info --- emacsconf.el | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'emacsconf.el') diff --git a/emacsconf.el b/emacsconf.el index d95ce0d..2907632 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -134,16 +134,14 @@ :export #'emacsconf-export-slug)) -(defun emacsconf-complete-talk () - (let ((choices (with-current-buffer (find-file-noselect emacsconf-org-file) - (save-excursion - (delq nil - (org-map-entries - (lambda () - (when (org-entry-get (point) "SLUG") - (concat (org-entry-get (point) "SLUG") " - " - (org-entry-get (point) "ITEM") " - " - (org-entry-get (point) "NAME")))))))))) +(defun emacsconf-complete-talk (&optional info) + (let ((choices + (mapcar (lambda (o) + (string-join + (delq nil + (mapcar (lambda (f) (plist-get o f)) '(:slug :title :speakers :irc))) + " - ")) + (or info (emacsconf-get-talk-info))))) (completing-read "Talk: " (lambda (string predicate action) -- cgit v1.2.3