Advertisement
Guest User

Untitled

a guest
Jul 12th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.45 KB | None | 0 0
  1. (defun completing-read-alist (prompt collection &rest args)
  2.   (let* ((coll (mapc (lambda (el)
  3.                        (if (and (consp el) (cdr el))
  4.                            (setf (car el)
  5.                                  (propertize (format "%s" (car el)) :values (cdr el)))
  6.                          el))
  7.                      collection))
  8.          (input (apply 'completing-read prompt coll args)))
  9. (or (get-text-property 0 :values input) input)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement