refactor(look-and-feel): Replace SML with telephone-line
Telephone line has a slightly easier to configure segment system. This commit also uses the commit introduced in the previous function to conditionally display miscellaneous modeline information in the last window of a frame. More configuration for this will come over time.
This commit is contained in:
parent
75749b68b0
commit
221c60e448
1 changed files with 26 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
;;; -*- lexical-binding: t; -*-
|
||||
|
||||
(require 'telephone-line)
|
||||
|
||||
;; Hide those ugly tool bars:
|
||||
(tool-bar-mode 0)
|
||||
(scroll-bar-mode 0)
|
||||
|
@ -34,8 +36,30 @@
|
|||
;; If this file is evaluating there may also be a new (initial) frame:
|
||||
(configure-new-frame (selected-frame))
|
||||
|
||||
;; Configure smart mode line
|
||||
(sml/setup)
|
||||
;; Configure telephone-line
|
||||
(defun telephone-misc-if-last-window ()
|
||||
"Renders the mode-line-misc-info string for display in the
|
||||
mode-line if the currently active window is the last one in the
|
||||
frame.
|
||||
|
||||
The idea is to not display information like the current time,
|
||||
load, battery levels in all buffers."
|
||||
|
||||
(if (bottom-right-window-p)
|
||||
(telephone-line-raw mode-line-misc-info t)
|
||||
""))
|
||||
|
||||
(telephone-line-defsegment telephone-line-last-window-segment ()
|
||||
(telephone-misc-if-last-window))
|
||||
|
||||
(setq telephone-line-lhs
|
||||
'((nil . (telephone-line-position-segment))
|
||||
(accent . (telephone-line-buffer-segment))))
|
||||
|
||||
(setq telephone-line-rhs
|
||||
'((accent . (telephone-line-major-mode-segment))
|
||||
(nil . (telephone-line-last-window-segment))))
|
||||
(telephone-line-mode 1)
|
||||
|
||||
;; Auto refresh buffers
|
||||
(global-auto-revert-mode 1)
|
||||
|
|
Loading…
Reference in a new issue