Adopt seagle0128/doom-modeline for :ui modeline

And remove obsolete :ui doom-modeline module.

Relevant to: #136, #921
This commit is contained in:
Henrik Lissner 2019-03-01 15:12:27 -05:00
parent 868bd15abe
commit 8832737671
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
17 changed files with 90 additions and 1944 deletions

View file

@ -0,0 +1,35 @@
;;; ui/modeline/autoload/modeline.el -*- lexical-binding: t; -*-
;;;###autodef
(defalias 'def-modeline-format! 'doom-modeline-def-segment)
;;;###autodef
(defalias 'def-modeline-segment! 'doom-modeline-def-modeline)
;;;###autodef
(defalias 'set-modeline! 'doom-modeline-set-modeline)
(defvar +modeline--old-bar-height nil)
;;;###autoload
(defun +modeline|resize-for-big-font ()
"Adjust the modeline's height when `doom-big-font-mode' is enabled. This was
made to be added to `doom-big-font-mode-hook'."
(unless +modeline--old-bar-height
(setq +modeline--old-bar-height doom-modeline-height))
(let ((default-height +modeline--old-bar-height))
(if doom-big-font-mode
(let* ((font-size (font-get doom-font :size))
(big-size (font-get doom-big-font :size))
(ratio (/ (float big-size) font-size)))
(setq doom-modeline-height (ceiling (* default-height ratio 0.75))))
(setq doom-modeline-height default-height))
;; already has a variable watcher in Emacs 26+
(unless EMACS26+ (doom-modeline-refresh-bars))))
;;;###autoload
(defun +modeline|update-env-in-all-windows (&rest _)
""
(dolist (window (window-list))
(with-selected-window window
(doom-modeline-update-env))))