[Emacs] Remove custom functions to set highlight-indent-guides faces
This commit is contained in:
parent
70ab3c0d23
commit
2db965575f
@ -1634,63 +1634,10 @@ https://github.com/alpaker/Fill-Column-Indicator/issues/21 for more details
|
|||||||
:commands highlight-indent-guides-mode
|
:commands highlight-indent-guides-mode
|
||||||
:preface
|
:preface
|
||||||
(progn
|
(progn
|
||||||
(use-package hexrgb :demand t)
|
|
||||||
|
|
||||||
(defun imalison:change-hsv-value-by (delta)
|
|
||||||
(lambda (h s v)
|
|
||||||
(list h s (+ v delta))))
|
|
||||||
|
|
||||||
(defun imalison:build-safe-change-hsv-value (delta)
|
|
||||||
(lambda (h s v)
|
|
||||||
(imalison:safe-change-hsv-value
|
|
||||||
h s v delta)))
|
|
||||||
|
|
||||||
(defun imalison:new-hsv-value-safe (value)
|
|
||||||
(or (> value 1) (< value 0)))
|
|
||||||
|
|
||||||
(defun imalison:safe-change-hsv-value (h s v delta)
|
|
||||||
(let ((new-value (+ v delta)))
|
|
||||||
(if (imalison:new-hsv-value-safe new-value)
|
|
||||||
(let ((other-direction (+ v (* delta -2))))
|
|
||||||
(if (imalison:new-hsv-value-safe other-direction)
|
|
||||||
(user-error "delta %s is too large" delta)
|
|
||||||
(list h s other-direction)))
|
|
||||||
(list h s new-value))))
|
|
||||||
|
|
||||||
(defun imalison:modify-hsv (color fn)
|
|
||||||
(hexrgb-rgb-hex-to-rgb-hex
|
|
||||||
(apply 'hexrgb-hsv-to-hex (apply fn (hexrgb-hex-to-hsv color))) 2))
|
|
||||||
|
|
||||||
(defun imalison:modify-hsv-value-by (color delta)
|
|
||||||
(imalison:modify-hsv color (imalison:build-safe-change-hsv-value delta)))
|
|
||||||
|
|
||||||
(defvar imalison:hsv-value-delta .03)
|
|
||||||
|
|
||||||
(defun imalison:set-highlight-indent-guides-faces (&rest args)
|
|
||||||
(interactive)
|
|
||||||
(require 'highlight-indent-guides)
|
|
||||||
(let ((bg-color (face-background 'default)))
|
|
||||||
(when bg-color
|
|
||||||
(set-face-background 'highlight-indent-guides-odd-face
|
|
||||||
(imalison:modify-hsv
|
|
||||||
bg-color
|
|
||||||
(imalison:build-safe-change-hsv-value
|
|
||||||
(* -1 imalison:hsv-value-delta))))
|
|
||||||
(set-face-background 'highlight-indent-guides-even-face
|
|
||||||
(imalison:modify-hsv
|
|
||||||
bg-color
|
|
||||||
(imalison:build-safe-change-hsv-value
|
|
||||||
imalison:hsv-value-delta))))))
|
|
||||||
|
|
||||||
(advice-add 'load-theme
|
|
||||||
:after 'imalison:set-highlight-indent-guides-faces)
|
|
||||||
|
|
||||||
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode))
|
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode))
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq highlight-indent-guides-method 'fill)))
|
(setq highlight-indent-guides-method 'fill)))
|
||||||
|
|
||||||
(setq lexical-binding t)
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Keybindings
|
* Keybindings
|
||||||
** god-mode
|
** god-mode
|
||||||
|
Loading…
Reference in New Issue
Block a user