Update emacs.org
This commit is contained in:
parent
4a04a880e1
commit
d35a67f9c6
1 changed files with 95 additions and 82 deletions
|
@ -187,24 +187,47 @@ Should make startup faster, taken from doom-emacs
|
||||||
|
|
||||||
(force-mode-line-update)
|
(force-mode-line-update)
|
||||||
|
|
||||||
|
;; (setq-default mode-line-format
|
||||||
|
;; `("%e"
|
||||||
|
;; sakoline-evil-mode
|
||||||
|
|
||||||
|
;; ;; begin BUFFER name
|
||||||
|
;; " "
|
||||||
|
|
||||||
|
;; sakoline-buffer-name
|
||||||
|
|
||||||
|
;; " "
|
||||||
|
;; sakoline-buffer-state
|
||||||
|
;; " "
|
||||||
|
;; ;; everything under here goes to the right
|
||||||
|
;; sakoline-major-mode
|
||||||
|
|
||||||
|
;; ))
|
||||||
|
|
||||||
(setq-default mode-line-format
|
(setq-default mode-line-format
|
||||||
`("%e"
|
'((:eval (sakoline-render
|
||||||
|
;; left
|
||||||
|
(quote ("%e"
|
||||||
sakoline-evil-mode
|
sakoline-evil-mode
|
||||||
|
|
||||||
;; begin BUFFER name
|
|
||||||
" "
|
" "
|
||||||
|
|
||||||
sakoline-buffer-name
|
sakoline-buffer-name
|
||||||
|
|
||||||
" "
|
" "
|
||||||
sakoline-buffer-state
|
sakoline-buffer-state))
|
||||||
" "
|
;; right
|
||||||
;; everything under here goes to the right
|
(quote (sakoline-major-mode
|
||||||
;; make sure to change the padding to make it look good
|
)
|
||||||
(:eval (sakoline-padding-right 'mode-line 20))
|
)))))
|
||||||
sakoline-major-mode
|
|
||||||
|
|
||||||
))
|
(defun sakoline-render (left right)
|
||||||
|
"Return a string of `window-width' length.
|
||||||
|
Containing LEFT, and RIGHT aligned respectively."
|
||||||
|
(let ((available-width
|
||||||
|
(- (window-total-width)
|
||||||
|
(+ (length (format-mode-line left))
|
||||||
|
(length (format-mode-line right))))))
|
||||||
|
(append left
|
||||||
|
(list (format (format "%%%ds" available-width) ""))
|
||||||
|
right)))
|
||||||
|
|
||||||
(defvar-local sakoline-buffer-name
|
(defvar-local sakoline-buffer-name
|
||||||
'(:eval
|
'(:eval
|
||||||
|
@ -278,16 +301,6 @@ Should make startup faster, taken from doom-emacs
|
||||||
|
|
||||||
(put 'sakoline-buffer-state 'risky-local-variable t)
|
(put 'sakoline-buffer-state 'risky-local-variable t)
|
||||||
|
|
||||||
(defun sakoline-padding-right (face reserve)
|
|
||||||
"Return empty space using FACE and leaving RESERVE space on the right."
|
|
||||||
(unless reserve
|
|
||||||
(setq reserve 20))
|
|
||||||
(when (and window-system (eq 'right (get-scroll-bar-mode)))
|
|
||||||
(setq reserve (- reserve 3)))
|
|
||||||
(propertize " "
|
|
||||||
'display `((space :align-to (- (+ right right-fringe right-margin) ,reserve)))
|
|
||||||
'face face))
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
* Packages
|
* Packages
|
||||||
** Log state
|
** Log state
|
||||||
|
|
Loading…
Reference in a new issue