Use delegate function

As suggested by Henrik I changed it to use a delegate function, which reduces
code duplication and makes things cleaner
This commit is contained in:
Steven vanZyl 2020-10-05 10:08:51 -04:00
parent 67c1e7c3f9
commit 3f28411f64
4 changed files with 15 additions and 15 deletions

View file

@ -5,8 +5,12 @@
;;;###autoload
;; Emacs 27 introduced `display-fill-column-indicator-mode' which should be
;; used instead of `hl-fill-column-mode'
(if EMACS27+
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)
#'display-fill-column-indicator-mode)
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)
#'hl-fill-column-mode))
(defun +fill-column-enable-h (&optional arg)
(interactive "p")
(if (fboundp 'display-fill-column-indicator-mode)
(display-fill-column-indicator-mode arg)
(hl-fill-column-mode arg)))
;;;###autoload
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)
#'+fill-column-enable-h)