Hi, read-char-spec.el provides a generalization of the `y-or-n-p' UI for when you need other possible answers. Basically, `read-char-spec' is to `read-char' as `format-spec' is to `format'. Here's how you would re-implement `y-or-n-p' with `read-char-spec':
(defun example-y-or-n-p (prompt)
"Copy of `y-or-n-p', as an example use of `read-char-spec'.
PROMPT is as for `y-or-n-p'."
(read-char-spec prompt '((?y t "Answer in the affirmative")
(?n nil "Answer in the negative"))))
In the future, the latest version should always be accessible at this
URL:
http://edward.oconnor.cx/elisp/read-char-spec.el
Share and Enjoy!
--
Edward O'Connor
[email protected]
Ense petit placidam sub libertate quietem.
read-char-spec.el
Description: read-char-spec.el -- generalized `y-or-n-p'
_______________________________________________ gnu-emacs-sources mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
