;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/string-minibuffer.el (require 'cl-lib) (defun select-list-item (lst) (let ((ps "")) (cl-loop for i from 0 to (1- (length lst)) for l in lst do (setq ps (concat ps (format "[%d] %s " i l))) ) (nth (read-number (concat ps "index: ")) lst) )) ;; (select-list-item '("test" "string" "three")) (provide 'string-minibuffer)