mirror of
https://github.com/ryuslash/mode-icons.git
synced 2024-11-24 10:30:30 +01:00
Display ergoemacs-mode icon.
Take out the undo redo madness
This commit is contained in:
parent
98d03def53
commit
34dc1e8851
1 changed files with 10 additions and 11 deletions
|
@ -648,22 +648,24 @@ When DONT-UPDATE is non-nil, don't call `force-mode-line-update'."
|
||||||
(defun mode-icons-set-minor-mode-icon (&optional dont-update)
|
(defun mode-icons-set-minor-mode-icon (&optional dont-update)
|
||||||
"Set the icon for the minor modes.
|
"Set the icon for the minor modes.
|
||||||
When DONT-UPDATE is non-nil, don't call `force-mode-line-update'"
|
When DONT-UPDATE is non-nil, don't call `force-mode-line-update'"
|
||||||
(let (icon-spec mode-name minor)
|
(let (icon-spec mode-name minor cur-mode)
|
||||||
(dolist (mode minor-mode-alist)
|
(dolist (mode minor-mode-alist)
|
||||||
(unless (assq (car mode) mode-icons-set-minor-mode-icon-alist)
|
(setq cur-mode
|
||||||
(setq mode-name (format-mode-line mode)
|
|
||||||
icon-spec (mode-icons-get-icon-spec mode-name))
|
|
||||||
(when icon-spec
|
|
||||||
(setq minor (assq (car mode) minor-mode-alist))
|
|
||||||
(when minor
|
|
||||||
(or (assq (car mode) mode-icons-set-minor-mode-icon-alist)
|
(or (assq (car mode) mode-icons-set-minor-mode-icon-alist)
|
||||||
|
mode))
|
||||||
|
(setq mode-name (format-mode-line cur-mode)
|
||||||
|
icon-spec (mode-icons-get-icon-spec mode-name))
|
||||||
|
(when icon-spec
|
||||||
|
(setq minor (assq (car cur-mode) minor-mode-alist))
|
||||||
|
(when minor
|
||||||
|
(or (assq (car cur-mode) mode-icons-set-minor-mode-icon-alist)
|
||||||
(push (copy-sequence minor) mode-icons-set-minor-mode-icon-alist))
|
(push (copy-sequence minor) mode-icons-set-minor-mode-icon-alist))
|
||||||
(setq mode-name (replace-regexp-in-string "^ " "" mode-name)
|
(setq mode-name (replace-regexp-in-string "^ " "" mode-name)
|
||||||
mode-name (mode-icons-propertize-mode mode-name icon-spec))
|
mode-name (mode-icons-propertize-mode mode-name icon-spec))
|
||||||
(if (string= "" mode-name)
|
(if (string= "" mode-name)
|
||||||
(setcdr minor (list ""))
|
(setcdr minor (list ""))
|
||||||
(setcdr minor (list (concat (or (and mode-icons-separate-images-with-spaces " ") "")
|
(setcdr minor (list (concat (or (and mode-icons-separate-images-with-spaces " ") "")
|
||||||
mode-name)))))))))
|
mode-name))))))))
|
||||||
(unless dont-update
|
(unless dont-update
|
||||||
(force-mode-line-update)))
|
(force-mode-line-update)))
|
||||||
|
|
||||||
|
@ -989,9 +991,6 @@ When ENABLE is non-nil, enable the changes to the mode line."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (and mode-icons-mode (not (minibufferp)))
|
(when (and mode-icons-mode (not (minibufferp)))
|
||||||
(mode-icons-set-current-mode-icon)
|
(mode-icons-set-current-mode-icon)
|
||||||
;; FIXME -- undo to allow `ergoemacs-mode' and color changing
|
|
||||||
;; XPMs. Seems a bit heavy handed.
|
|
||||||
(mode-icons-set-minor-mode-icon-undo t)
|
|
||||||
(mode-icons-set-minor-mode-icon)))
|
(mode-icons-set-minor-mode-icon)))
|
||||||
|
|
||||||
(defun mode-icons-reset ()
|
(defun mode-icons-reset ()
|
||||||
|
|
Loading…
Reference in a new issue