Fix #202: Be compatible with delight.

This commit is contained in:
Vincent Zhang 2019-08-03 14:38:10 +08:00
parent ada38ab4d8
commit cf9bfe34a5

View file

@ -479,14 +479,16 @@ directory, the file name, and its state (modified, read-only or non-existent)."
(propertize (propertize
(concat (concat
(doom-modeline-spc) (doom-modeline-spc)
(format-mode-line (propertize (format-mode-line
`(:propertize ("" mode-name) (or (and (boundp 'delighted-modes)
help-echo "Major mode\n\ (cadr (assq major-mode delighted-modes)))
mode-name))
'help-echo "Major mode\n\
mouse-1: Display major mode menu\n\ mouse-1: Display major mode menu\n\
mouse-2: Show help for major mode\n\ mouse-2: Show help for major mode\n\
mouse-3: Toggle minor modes" mouse-3: Toggle minor modes"
mouse-face mode-line-highlight 'mouse-face 'mode-line-highlight
local-map ,mode-line-major-mode-keymap)) 'local-map mode-line-major-mode-keymap)
(when (and doom-modeline-env-version doom-modeline-env--version) (when (and doom-modeline-env-version doom-modeline-env--version)
(format " %s" doom-modeline-env--version)) (format " %s" doom-modeline-env--version))
(and (boundp 'text-scale-mode-amount) (and (boundp 'text-scale-mode-amount)
@ -521,14 +523,14 @@ mouse-3: Toggle minor modes"
(doom-modeline-def-segment minor-modes (doom-modeline-def-segment minor-modes
(when doom-modeline-minor-modes (when doom-modeline-minor-modes
(let ((active (doom-modeline--active))) (let ((face (if (doom-modeline--active)
'doom-modeline-buffer-minor-mode
'mode-line-inactive)))
(if (bound-and-true-p minions-mode) (if (bound-and-true-p minions-mode)
(concat (concat
(doom-modeline-spc) (doom-modeline-spc)
(propertize minions-mode-line-lighter (propertize minions-mode-line-lighter
'face (if active 'face face
'doom-modeline-buffer-minor-mode
'mode-line-inactive)
'help-echo "Minions 'help-echo "Minions
mouse-1: Display minor modes menu" mouse-1: Display minor modes menu"
'mouse-face 'mode-line-highlight 'mouse-face 'mode-line-highlight
@ -536,12 +538,12 @@ mouse-1: Display minor modes menu"
'mouse-1 #'minions-minor-modes-menu)) 'mouse-1 #'minions-minor-modes-menu))
(doom-modeline-spc)) (doom-modeline-spc))
(concat (concat
(format-mode-line (propertize (replace-regexp-in-string
`(:propertize ("" minor-mode-alist) (regexp-quote "%") "%%%%"
face ,(if active (format-mode-line minor-mode-alist)
'doom-modeline-buffer-minor-mode t t)
'mode-line-inactive))) 'face face)
(doom-modeline-vspc)))))) (doom-modeline-spc))))))
;; ;;