* add compatibilty wrapper for emacs24's read-char-choice

This commit is contained in:
djcb
2012-05-07 21:59:06 +03:00
parent a55f577009
commit 6378288287
2 changed files with 60 additions and 61 deletions

View File

@ -182,6 +182,7 @@ The server output is as follows:
(mu4e-log 'misc "* Received %d byte(s)" (length str)) (mu4e-log 'misc "* Received %d byte(s)" (length str))
(setq mu4e~proc-buf (concat mu4e~proc-buf str)) ;; update our buffer (setq mu4e~proc-buf (concat mu4e~proc-buf str)) ;; update our buffer
(let ((sexp (mu4e~proc-eat-sexp-from-buf))) (let ((sexp (mu4e~proc-eat-sexp-from-buf)))
(with-local-quit
(while sexp (while sexp
(mu4e-log 'from-server "%S" sexp) (mu4e-log 'from-server "%S" sexp)
(cond (cond
@ -247,7 +248,7 @@ The server output is as follows:
(t (mu4e-message "Unexpected data from server [%S]" sexp))) (t (mu4e-message "Unexpected data from server [%S]" sexp)))
(setq sexp (mu4e~proc-eat-sexp-from-buf))))) (setq sexp (mu4e~proc-eat-sexp-from-buf))))))
;; error codes are defined in src/mu-util.h ;; error codes are defined in src/mu-util.h

View File

@ -91,14 +91,12 @@ dir already existed, or has been created, nil otherwise."
(defun mu4e~read-char-choice (prompt choices) (defun mu4e~read-char-choice (prompt choices)
"Compatiblity wrapper for `read-char-choice', which is emacs-24 "Compatiblity wrapper for `read-char-choice', which is emacs-24
only." only."
(if (fboundp 'read-char-choice) (let ((choice) (ok) (inhibit-quit nil))
(read-char-choice prompt choices)
(let ((choice) (ok))
(while (not ok) (while (not ok)
(message nil);; this seems needed... (message nil);; this seems needed...
(setq choice (read-char prompt)) (setq choice (read-char-exclusive prompt))
(setq ok (member choice choices))) (setq ok (member choice choices)))
choice))) choice))
(defun mu4e-read-option (prompt options) (defun mu4e-read-option (prompt options)
"Ask user for an option from a list on the input area. PROMPT "Ask user for an option from a list on the input area. PROMPT