* mu4e-util.el: don't be _too_ picky in mu4e-read-option + improve docstring

This commit is contained in:
djcb
2012-06-15 11:46:56 +03:00
parent 79f17ab4ad
commit 4b09cce972

View File

@ -98,16 +98,19 @@ options. Cells have the following structure:
The options are provided as a list for the user to choose from; The options are provided as a list for the user to choose from;
user can then choose by typing CHAR. Example: user can then choose by typing CHAR. Example:
(mu4e-read-option \"Choose an animal: \" (mu4e-read-option \"Choose an animal: \"
'((\"Monkey\" ?m) (\"Gnu\" ?g) (\"platipus\"))) '((\"Monkey\" . monkey) (\"Gnu\" . gnu) (\"xMoose\" . moose)))
User now will be presented with a list:
\"Choose an animal: [m]Monkey, [g]Gnu, [p]latipus\"." 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)) (let* ((prompt (mu4e-format "%s" prompt))
(chosen) (chosen)
(optionsstr (optionsstr
(mapconcat (mapconcat
(lambda (option) (lambda (option)
;; try to detect old-style options... ;; 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; " (error (concat "Please use the new format for options/actions; "
"see the manual"))) "see the manual")))
(let* ((kar (substring (car option) 0 1)) (let* ((kar (substring (car option) 0 1))