* use the same action char face everywhere

This commit is contained in:
djcb
2012-04-25 08:40:06 +03:00
parent 284ec577f4
commit ed8bc7fb3b
2 changed files with 10 additions and 7 deletions

View File

@ -71,7 +71,8 @@ clicked."
"\\[\\(\\w+\\)\\]" "\\[\\(\\w+\\)\\]"
(lambda(m) (lambda(m)
(format "[%s]" (format "[%s]"
(propertize (match-string 1 str) 'face 'mu4e-highlight-face))) str)) (propertize (match-string 1 str) 'face 'mu4e-highlight-face)))
str))
(map (make-sparse-keymap)) (map (make-sparse-keymap))
(func (if (functionp func-or-shortcut) (func (if (functionp func-or-shortcut)
func-or-shortcut func-or-shortcut

View File

@ -63,7 +63,8 @@ Function returns the CHAR typed."
(optionsstr (optionsstr
(mapconcat (mapconcat
(lambda (option) (lambda (option)
(let* ((descr (car option)) (kar (and (cdr option) (cadr option)))) (let* ((descr (car option))
(kar (and (cdr option) (cadr option))))
;; handle the empty kar case ;; handle the empty kar case
(unless kar (unless kar
(setq ;; eat first kar from descr; use it as kar (setq ;; eat first kar from descr; use it as kar
@ -72,9 +73,10 @@ Function returns the CHAR typed."
(add-to-list 'optionkars kar) (add-to-list 'optionkars kar)
(concat (concat
"[" (propertize (make-string 1 kar) "[" (propertize (make-string 1 kar)
'face 'mu4e-view-link-face) "]" 'face 'mu4e-highlight-face) "]"
descr))) options ", ")) descr))) options ", "))
(inhibit-quit nil) ;; allow C-g from read-char, not sure why this is needed ;; allow C-g from read-char, not sure why this is needed
(inhibit-quit nil)
(okchar) (okchar)
(response)) (response))
(while (not okchar) (while (not okchar)
@ -82,7 +84,7 @@ Function returns the CHAR typed."
(setq response (setq response
(read-char-exclusive (read-char-exclusive
(concat prompt optionsstr (concat prompt optionsstr
" [" (propertize "C-g" 'face 'highlight) " to quit]"))) " [" (propertize "C-g" 'face 'mu4e-highlight-face) " to quit]")))
(setq okchar (member response optionkars))) (setq okchar (member response optionkars)))
response)) response))
@ -139,7 +141,7 @@ maildirs under `mu4e-maildir."
(concat (concat
"[" "["
(propertize (make-string 1 (cdr item)) (propertize (make-string 1 (cdr item))
'face 'mu4e-view-link-face) 'face 'mu4e-highlight-face)
"]" "]"
(car item))) (car item)))
mlist ", ")) mlist ", "))
@ -194,7 +196,7 @@ provided, function asks for it."
(let ((query (nth 0 bm)) (title (nth 1 bm)) (key (nth 2 bm))) (let ((query (nth 0 bm)) (title (nth 1 bm)) (key (nth 2 bm)))
(concat (concat
"[" (propertize (make-string 1 key) "[" (propertize (make-string 1 key)
'face 'mu4e-view-link-face) 'face 'mu4e-highlight-face)
"]" "]"
title))) mu4e-bookmarks ", ")) title))) mu4e-bookmarks ", "))
(kar (read-char (concat prompt bmarks)))) (kar (read-char (concat prompt bmarks))))