From 45de3307b81884aed752ce75af7e1a26ec2012a4 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 12 Sep 2010 14:16:00 +0200 Subject: Add offlineimap-mode-line-style and offlineimap-mode-line-symbol Signed-off-by: Julien Danjou --- offlineimap.el | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/offlineimap.el b/offlineimap.el index 121bfdb..9952351 100644 --- a/offlineimap.el +++ b/offlineimap.el @@ -53,6 +53,17 @@ This form is evaluated and its return value determines if the OfflineIMAP status should be displayed in the mode line." :group 'offlineimap) +(defcustom offlineimap-mode-line-style 'symbol + "Set what to display in mode-line. +If set to 'symbol, it will only display +`offlineimap-mode-line-symbol' with different colors based on +what OfflineIMAP is doing. If set to 'text, it will display the +action as a text in color instead of a single symbol.") + +(defcustom offlineimap-mode-line-symbol "✉" + "Symbol used to display OfflineIMAP status in mode-line. +This is used when `offlineimap-mode-line-style' is set to 'symbol.") + (defvar offlineimap-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "q") 'offlineimap-quit) @@ -151,10 +162,13 @@ OfflineIMAP status should be displayed in the mode line." (propertize (concat " [OfflineIMAP: " (let ((status (process-status process))) - (if (eq status 'run) - (let ((msg-type (process-get process :last-msg-type)) - (action (process-get process :last-action))) - (offlineimap-propertize-face msg-type action action)) + (if (eq status 'run) + (let ((msg-type (process-get process :last-msg-type)) + (action (process-get process :last-action))) + (offlineimap-propertize-face msg-type action + (if (eq offlineimap-mode-line-style 'text) + action + offlineimap-mode-line-symbol))) (propertize (symbol-name status) 'face 'offlineimap-error-face))) "]") 'mouse-face 'mode-line-highlight -- cgit v1.2.3