[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)))
- [nongnu] elpa/focus 704db49988 82/82: Merge pull request #24 from phikal/master, (continued)
- [nongnu] elpa/focus 704db49988 82/82: Merge pull request #24 from phikal/master, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus c89d08f510 24/82: Applied purcell's recommendations, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 94ed8ab68b 36/82: Defined variables to help hide the cursor, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus e8c1eb5ce2 16/82: Added short commentary, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 75202c9445 58/82: Version bump, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 8028fc088f 04/82: Improved average color function, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus e9ab37b865 81/82: Improved user option types, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus aa5ea31118 65/82: Fixed package lint warnings., ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus a80b7b6eba 71/82: Add possibility of customizing the face of the focused region, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 1c664fb992 17/82: Added installation section, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus bf5fcff0d0 69/82: Allow setting a color for dimmed text. Fixes #21,
ELPA Syncer <=
- [nongnu] elpa/focus f310fa1c31 52/82: Split up `focus-move-focus', ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 5e483363ac 75/82: New README, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 6b9620a73d 44/82: Added section on `focus-read-only-mode' in README, ELPA Syncer, 2022/09/06