refactor: Visual indentation guides

- Switch from highlight-indentation package to highlight-indent-guides.
- Activate visual indentation in a prog-mode hook, rather than doing
  within each individual major mode. It was already done within all
  major modes based on prog-mode anyway.
- Add new siren-display-indetation module and function as a central way
  to enable visual indetation guides. This makes switching the
  underlying package at some point in the future much easier.
This commit is contained in:
2020-01-26 18:53:44 +00:00
parent 702d2989dd
commit 8ed4a4e6f5
30 changed files with 54 additions and 65 deletions

View File

@@ -0,0 +1,17 @@
;;; siren-display-indentation.el --- jimeh's Emacs Siren: indent guides setup
;;; Commentary:
;; Setup for rendering indent guides.
;;; Code:
(require 'siren-highlight-indent-guides)
(defun siren-display-indentation (&optional arg)
"Activate or deactivate indentation guides.
Optional ARG is passed directly to mode toggle function."
(highlight-indent-guides-mode (or arg t)))
(provide 'siren-display-indentation)
;;; siren-display-indentation.el ends here

View File

@@ -9,7 +9,19 @@
(use-package highlight-indent-guides
:defer t
:commands highlight-indent-guides-mode
:diminish highlight-indent-guides-mode)
:diminish highlight-indent-guides-mode
:hook
(prog-mode . highlight-indent-guides-mode)
:custom
(highlight-indent-guides-auto-even-face-perc 3)
(highlight-indent-guides-auto-odd-face-perc 2.5)
(highlight-indent-guides-auto-top-even-face-perc 12)
(highlight-indent-guides-auto-top-odd-face-perc 10)
(highlight-indent-guides-character ?\u2502)
(highlight-indent-guides-method 'column)
(highlight-indent-guides-responsive 'top))
(provide 'siren-highlight-indent-guides)
;;; siren-highlight-indent-guides.el ends here

View File

@@ -9,7 +9,10 @@
(use-package highlight-indentation
:defer t
:diminish (highlight-indentation-mode
highlight-indentation-current-column-mode))
highlight-indentation-current-column-mode)
:hook
(prog-mode . highlight-indent-guides-mode))
(provide 'siren-highlight-indentation)
;;; siren-highlight-indentation.el ends here