emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/focus bf5fcff0d0 69/82: Allow setting a color for dimmed t


From: ELPA Syncer
Subject: [nongnu] elpa/focus bf5fcff0d0 69/82: Allow setting a color for dimmed text. Fixes #21
Date: Tue, 6 Sep 2022 04:58:58 -0400 (EDT)

branch: elpa/focus
commit bf5fcff0d03502218b559a202f1410b4f65a1dcf
Author: Lars Tveito <larstvei@ifi.uio.no>
Commit: Lars Tveito <larstvei@ifi.uio.no>

    Allow setting a color for dimmed text. Fixes #21
---
 focus.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/focus.el b/focus.el
index 82be9c9035..58b6a9e508 100644
--- a/focus.el
+++ b/focus.el
@@ -73,6 +73,9 @@ Things that are defined include `symbol', `list', `sexp',
 (defvar focus-cursor-type cursor-type
   "Used to restore the users `cursor-type'")
 
+(defvar focus-dim-color nil
+  "Overrides the color used for dimmed text.")
+
 (defvar-local focus-current-thing nil
   "Overrides the choice of thing dictated by `focus-mode-to-thing' if set.")
 
@@ -149,7 +152,7 @@ adds `focus-move-focus' to `post-command-hook'."
     (setq focus-pre-overlay  (make-overlay (point-min) (point-min))
           focus-post-overlay (make-overlay (point-max) (point-max))
           focus-buffer (current-buffer))
-    (let ((color (focus-make-dim-color)))
+    (let ((color (or focus-dim-color (focus-make-dim-color))))
       (mapc (lambda (o) (overlay-put o 'face (cons 'foreground-color color)))
             (list focus-pre-overlay focus-post-overlay)))
     (add-hook 'post-command-hook 'focus-move-focus nil t)
@@ -273,9 +276,10 @@ It cleans up the `focus-read-only-blink-timer' and hooks."
   :keymap (let ((map (make-sparse-keymap)))
             (define-key map (kbd "C-c C-q") 'focus-read-only-mode)
             map)
-  (unless (and (color-defined-p (face-attribute 'default :background))
-               (color-defined-p (face-attribute 'default :foreground)))
-    (message "Can't enable focus mode when no theme is loaded.")
+  (unless (or (and (color-defined-p (face-attribute 'default :background))
+                   (color-defined-p (face-attribute 'default :foreground)))
+              focus-dim-color)
+    (message "Can't enable focus mode when no theme is loaded. Try setting 
focus-dim-color!")
     (setq focus-mode nil))
   (if focus-mode (focus-init) (focus-terminate)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]