Fix #4035: fill-column toggle

This commit is contained in:
Henrik Lissner 2020-10-06 13:30:06 -04:00
parent 2f57386aa0
commit 729e8d8f39
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 8 additions and 9 deletions

View file

@ -651,7 +651,7 @@
(:prefix-map ("t" . "toggle") (:prefix-map ("t" . "toggle")
:desc "Big mode" "b" #'doom-big-font-mode :desc "Big mode" "b" #'doom-big-font-mode
(:when (featurep! :ui fill-column) (:when (featurep! :ui fill-column)
:desc "Fill Column Indicator" "c" #'+fill-column-enable-h) :desc "Fill Column Indicator" "c" #'+fill-column/toggle)
:desc "Flymake" "f" #'flymake-mode :desc "Flymake" "f" #'flymake-mode
(:when (featurep! :checkers syntax) (:when (featurep! :checkers syntax)
:desc "Flycheck" "f" #'flycheck-mode) :desc "Flycheck" "f" #'flycheck-mode)

View file

@ -1,15 +1,14 @@
;;; ui/fill-column/autoload.el -*- lexical-binding: t; -*- ;;; ui/fill-column/autoload.el -*- lexical-binding: t; -*-
;;;###autoload (autoload 'hl-fill-column-mode "hl-fill-column" nil t) ;;;###autoload
(defalias '+fill-column/toggle
(if (fboundp 'display-fill-column-indicator-mode)
#'display-fill-column-indicator-mode ; Emacs 27 only
(autoload 'hl-fill-column-mode "hl-fill-column" nil t)
#'hl-fill-column-mode))
;;;###autoload ;;;###autoload
;; Emacs 27 introduced `display-fill-column-indicator-mode' which should be (defalias '+fill-column-enable-h #'+fill-column/toggle)
;; used instead of `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 ;;;###autoload
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook) (add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)