Fix incorrectly rendered icons in modeline #773
And possibly fix bytecomp warnings about unused lexical variables.
This commit is contained in:
parent
c2d5b64790
commit
1211c2c7f7
1 changed files with 13 additions and 14 deletions
|
@ -1,7 +1,5 @@
|
||||||
;;; ui/doom-modeline/config.el -*- lexical-binding: t; -*-
|
;;; ui/doom-modeline/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Modeline library
|
;; Modeline library
|
||||||
;;
|
;;
|
||||||
|
@ -36,7 +34,7 @@
|
||||||
(push seg forms))
|
(push seg forms))
|
||||||
((symbolp seg)
|
((symbolp seg)
|
||||||
(cond ((setq it (cdr (assq seg doom--modeline-fn-alist)))
|
(cond ((setq it (cdr (assq seg doom--modeline-fn-alist)))
|
||||||
(push (list :eval (list it)) forms))
|
(push (list it) forms))
|
||||||
((setq it (cdr (assq seg doom--modeline-var-alist)))
|
((setq it (cdr (assq seg doom--modeline-var-alist)))
|
||||||
(push it forms))
|
(push it forms))
|
||||||
((error "%s is not a defined segment" seg))))
|
((error "%s is not a defined segment" seg))))
|
||||||
|
@ -58,20 +56,21 @@ Example:
|
||||||
(rhs-forms (doom--prepare-modeline-segments rhs)))
|
(rhs-forms (doom--prepare-modeline-segments rhs)))
|
||||||
(defalias sym
|
(defalias sym
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let ((rhs-str (format-mode-line rhs-forms)))
|
(let ((lhs (eval `(list ,@lhs-forms) t))
|
||||||
(list lhs-forms
|
(rhs (eval `(list ,@rhs-forms) t)))
|
||||||
(propertize
|
(let ((rhs-str (format-mode-line rhs)))
|
||||||
" " 'display
|
(list lhs
|
||||||
`((space :align-to (- (+ right right-fringe right-margin)
|
(propertize
|
||||||
,(+ 1 (string-width rhs-str))))))
|
" " 'display
|
||||||
rhs-str)))
|
`((space :align-to (- (+ right right-fringe right-margin)
|
||||||
|
,(+ 1 (string-width rhs-str))))))
|
||||||
|
rhs-str))))
|
||||||
(concat "Modeline:\n"
|
(concat "Modeline:\n"
|
||||||
(format " %s\n %s"
|
(format " %s\n %s"
|
||||||
(prin1-to-string lhs)
|
(prin1-to-string lhs)
|
||||||
(prin1-to-string rhs))))
|
(prin1-to-string rhs))))
|
||||||
(unless (bound-and-true-p byte-compile-current-file)
|
(let (byte-compile-warnings)
|
||||||
(let (byte-compile-warnings)
|
(byte-compile sym))))
|
||||||
(byte-compile sym)))))
|
|
||||||
|
|
||||||
(defun doom-modeline (key)
|
(defun doom-modeline (key)
|
||||||
"Returns a mode-line configuration associated with KEY (a symbol). Throws an
|
"Returns a mode-line configuration associated with KEY (a symbol). Throws an
|
||||||
|
@ -265,7 +264,7 @@ file-name => comint.el")
|
||||||
;; Modeline helpers
|
;; Modeline helpers
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(defsubst active ()
|
(defun active ()
|
||||||
(eq (selected-window) +doom-modeline-current-window))
|
(eq (selected-window) +doom-modeline-current-window))
|
||||||
|
|
||||||
(defun +doom-modeline--make-xpm (face width height)
|
(defun +doom-modeline--make-xpm (face width height)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue