Merge pull request #3982 from rushsteve1/develop

Improve fill-column module for Emacs 27+
This commit is contained in:
Henrik Lissner 2020-10-05 17:29:56 -04:00 committed by GitHub
commit 2d99b2cd93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 4 deletions

View file

@ -266,6 +266,8 @@
;;; <leader> t --- toggle
(:prefix-map ("t" . "toggle")
:desc "Big mode" "b" #'doom-big-font-mode
(:when (featurep! :ui fill-column)
:desc "Fill Column Indicator" "c" #'+fill-column-enable-h)
:desc "Flymake" "f" #'flymake-mode
:desc "Frame fullscreen" "F" #'toggle-frame-fullscreen
:desc "Indent style" "I" #'doom/toggle-indent-style

View file

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

View file

@ -1,9 +1,16 @@
;;; ui/fill-column/autoload.el -*- lexical-binding: t; -*-
;; DEPRECATED Replaced by `display-fill-column-indicator-mode' in Emacs 27+
;;;###autoload (autoload 'hl-fill-column-mode "hl-fill-column" nil t)
;;;###autoload
;; Emacs 27 introduced `display-fill-column-indicator-mode' which should be
;; 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
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)
#'hl-fill-column-mode)
#'+fill-column-enable-h)

View file

@ -1,4 +1,6 @@
;; -*- no-byte-compile: t; -*-
;;; ui/fill-column/packages.el
(package! hl-fill-column :pin "5782a91ba0182c4e562fa0db6379ff9dd472856b")
;; `hl-fill-column' is only used on Emacs versions before 27
(unless (fboundp 'display-fill-column-indicator-mode)
(package! hl-fill-column :pin "5782a91ba0182c4e562fa0db6379ff9dd472856b"))