From 0af32e0c525e2ec498c118df10fa0226e28117e2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 31 Oct 2018 16:07:22 -0400 Subject: [PATCH] ui/fci: conform to conventions; minor refactor --- modules/ui/fci/config.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/ui/fci/config.el b/modules/ui/fci/config.el index 1d268c207..c423d2f3c 100644 --- a/modules/ui/fci/config.el +++ b/modules/ui/fci/config.el @@ -22,9 +22,9 @@ Changes to this variable do not take effect until `fci-mode' is restarted.") (add-hook 'org-mode-hook #'turn-off-fci-mode) ;; turn off fci if the window is narrow than fill column - (defun fci-conditional (window) + (defun +fci-toggle-maybe (window) (let ((fci-enabled (symbol-value 'fci-mode)) - (fci-column (if fci-rule-column fci-rule-column fill-column))) + (fci-column (or fci-rule-column fill-column))) (with-selected-window window (if (and (eq fci-enabled nil) (< fci-column @@ -32,11 +32,11 @@ Changes to this variable do not take effect until `fci-mode' is restarted.") (turn-on-fci-mode) (turn-off-fci-mode))))) - (defun fci-width-workaround (&rest _) - (walk-windows #'fci-conditional 'no-minibuf)) + (defun +fci|width-workaround (&rest _) + (walk-windows #'+fci-toggle-maybe 'no-minibuf)) - (add-hook 'window-size-change-functions 'fci-width-workaround) - (add-hook 'window-configuration-change-hook 'fci-width-workaround) + (add-hook 'window-size-change-functions #'+fci|width-workaround) + (add-hook 'window-configuration-change-hook #'+fci|width-workaround) (defun +fci|set-color () "Automatically change `fci-rule-color' based on `+fci-rule-color-function's