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:
parent
67c1e7c3f9
commit
3f28411f64
4 changed files with 15 additions and 15 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue