diff options
author | Julien Danjou <julien@danjou.info> | 2010-09-12 14:16:00 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2010-09-12 14:16:00 +0200 |
commit | 45de3307b81884aed752ce75af7e1a26ec2012a4 (patch) | |
tree | ef1652770b9c5d1f95de6435df4b4984cbca67dc | |
parent | 4f1779c962fffc2bea1f341c7348203893aa178a (diff) |
Add offlineimap-mode-line-style and offlineimap-mode-line-symbol
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r-- | offlineimap.el | 22 |
1 files 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 |