Improve fill-column module for 27
Emacs 27 introduced `display-fill-column-indicator-mode` which replaces `hl-fill-column`. This commit adds some conditionals to use `display-fill-column-indicator-mode` on Emacs 27+, or falls back to `hl-fill-column-mode` on older versions.
This commit is contained in:
parent
01faa96992
commit
7daa3aaae9
2 changed files with 10 additions and 5 deletions
|
@ -1,9 +1,12 @@
|
||||||
;;; ui/fill-column/autoload.el -*- lexical-binding: t; -*-
|
;;; 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 (autoload 'hl-fill-column-mode "hl-fill-column" nil t)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)
|
;; Emacs 27 introduced `display-fill-column-indicator-mode' which should be
|
||||||
#'hl-fill-column-mode)
|
;; used instead of `hl-fill-column-mode'
|
||||||
|
(if (>= emacs-major-version 27)
|
||||||
|
(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))
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; ui/fill-column/packages.el
|
;;; ui/fill-column/packages.el
|
||||||
|
|
||||||
(package! hl-fill-column :pin "5782a91ba0182c4e562fa0db6379ff9dd472856b")
|
;; `hl-fill-column' is only used on Emacs versions before 27
|
||||||
|
(when (< emacs-major-version 27)
|
||||||
|
(package! hl-fill-column :pin "5782a91ba0182c4e562fa0db6379ff9dd472856b"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue