From 4b09cce972f1ce7b60babd31e30cf4fce8220dd8 Mon Sep 17 00:00:00 2001 From: djcb Date: Fri, 15 Jun 2012 11:46:56 +0300 Subject: [PATCH] * mu4e-util.el: don't be _too_ picky in mu4e-read-option + improve docstring --- emacs/mu4e-utils.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/emacs/mu4e-utils.el b/emacs/mu4e-utils.el index 7b1f70ac..fea1d660 100644 --- a/emacs/mu4e-utils.el +++ b/emacs/mu4e-utils.el @@ -98,16 +98,19 @@ options. Cells have the following structure: The options are provided as a list for the user to choose from; user can then choose by typing CHAR. Example: (mu4e-read-option \"Choose an animal: \" - '((\"Monkey\" ?m) (\"Gnu\" ?g) (\"platipus\"))) -User now will be presented with a list: - \"Choose an animal: [m]Monkey, [g]Gnu, [p]latipus\"." + '((\"Monkey\" . monkey) (\"Gnu\" . gnu) (\"xMoose\" . moose))) + +User now will be presented with a list: \"Choose an animal: + [M]onkey, [G]nu, [x]Moose\". + +Function will return the cdr of the list element." (let* ((prompt (mu4e-format "%s" prompt)) (chosen) (optionsstr (mapconcat (lambda (option) ;; try to detect old-style options... - (when (or (characterp (cdr option)) (null (cdr option))) + (when (characterp (cdr option)) (error (concat "Please use the new format for options/actions; " "see the manual"))) (let* ((kar (substring (car option) 0 1))