ui/fci -> fill-column: replace fci w/ hl-fill-column

fci was buggy, slow and presented numerous incompatibilities with other
modes. It is also unmaintained.

Relevant to #1045
This commit is contained in:
Henrik Lissner 2019-04-01 13:44:20 -04:00
parent 5bcab488a7
commit 390edee702
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
7 changed files with 11 additions and 56 deletions

View file

@ -18,7 +18,8 @@
(:tools (rotate-text (:editor rotate-text)))
(:emacs (electric-indent (:emacs electric))
(hideshow (:editor fold)))
(:ui (doom-modeline (:ui modeline))))
(:ui (doom-modeline (:ui modeline)))
(:ui (fci (:ui fill-column))))
"An alist of deprecated modules, mapping deprecated modules to an optional new
location (which will create an alias). Each CAR and CDR is a (CATEGORY .
MODULES). E.g.

View file

@ -23,7 +23,7 @@
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
evil-goggles ; display visual hints when editing in evil
;;fci ; a `fill-column' indicator
;;fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE tags
;;indent-guides ; highlighted indent columns
modeline ; snazzy, Atom-inspired modeline, plus API

View file

@ -1,15 +0,0 @@
;;; ui/fci/autoload.el -*- lexical-binding: t; -*-
(defvar-local +fci-last-state nil)
;;;###autoload
(defun +fci|disable-when-company-activates (&rest ignore)
"TODO"
(when (setq +fci-last-state (bound-and-true-p fci-mode))
(fci-mode -1)))
;;;###autoload
(defun +fci|enable-when-company-deactivates (&rest ignore)
"TODO"
(when +fci-last-state
(fci-mode 1)))

View file

@ -1,35 +0,0 @@
;;; ui/fci/config.el -*- lexical-binding: t; -*-
(defvar +fci-rule-color-function
(if EMACS26+
(lambda () (face-foreground 'line-number))
(lambda () (face-foreground 'font-lock-comment-face)))
"Color used to draw the fill-column rule.
Accepts a color string or a function that returns a color.
Changes to this variable do not take effect until `fci-mode' is restarted.")
;;
;; Packages
(def-package! fill-column-indicator
:hook ((text-mode prog-mode conf-mode) . turn-on-fci-mode)
:config
;; fci is broken in `org-mode' when `org-indent-mode' is active. org-indent is
;; more important to me, so...
(add-hook 'org-mode-hook #'turn-off-fci-mode)
(defun +fci|set-color ()
"Automatically change `fci-rule-color' based on `+fci-rule-color-function's
return value. To disable this, either set `+fci-rule-color-function' to nil or
remove `+fci|set-color' from `fci-mode-hook'."
(when (functionp +fci-rule-color-function)
(setq fci-rule-color (funcall +fci-rule-color-function))))
(add-hook 'fci-mode-hook #'+fci|set-color)
(when (featurep! :completion company)
(add-hook 'company-completion-started-hook #'+fci|disable-when-company-activates)
(add-hook! '(company-completion-finished-hook company-completion-cancelled-hook)
#'+fci|enable-when-company-deactivates)))

View file

@ -1,4 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; ui/fci/packages.el
(package! fill-column-indicator)

View file

@ -0,0 +1,4 @@
;;; ui/fill-column/config.el -*- lexical-binding: t; -*-
(def-package! hl-fill-column
:hook ((text-mode prog-mode conf-mode) . hl-fill-column-mode))

View file

@ -0,0 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; ui/fill-column/packages.el
(package! hl-fill-column)