Update emacs.org

This commit is contained in:
Sako 2023-12-20 22:19:13 +04:00 committed by GitHub
parent 4a04a880e1
commit d35a67f9c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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