branch: elpa/gptel
commit cfc8387151e73a5626da719b51024996da80fae6
Author: Karthik Chikmagalur <[email protected]>
Commit: Karthik Chikmagalur <[email protected]>
gptel: Better context and rewrite highlight faces
* gptel-rewrite.el (gptel-rewrite-highlight-face,
gptel--suffix-rewrite): Add a highlight face for rewrites.
* gptel-context.el (gptel-context-highlight-face): Change default
colors.
---
gptel-context.el | 4 +++-
gptel-rewrite.el | 11 ++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/gptel-context.el b/gptel-context.el
index 1e1bb68514..a5cc7188a1 100644
--- a/gptel-context.el
+++ b/gptel-context.el
@@ -35,7 +35,9 @@
(declare-function dired-get-marked-files "dired")
(defface gptel-context-highlight-face
- '((t :inherit header-line))
+ '((((background dark) (min-colors 88)) :background "gray4" :extend t)
+ (((background light) (min-colors 88)) :background "alice blue" :extend t)
+ (t :inherit mode-line))
"Face used to highlight gptel contexts in buffers."
:group 'gptel)
diff --git a/gptel-rewrite.el b/gptel-rewrite.el
index 607e0527af..516b2fe287 100644
--- a/gptel-rewrite.el
+++ b/gptel-rewrite.el
@@ -47,6 +47,15 @@ for a particular major-mode."
:group 'gptel
:type 'hook)
+(defface gptel-rewrite-highlight-face
+ '((((class color) (min-colors 88) (background dark))
+ :background "#041714" :extend t)
+ (((class color) (min-colors 88) (background light))
+ :background "light goldenrod yellow" :extend t)
+ (t :inherit secondary-selection))
+ "Face for highlighting regions with pending rewrites."
+ :group 'gptel)
+
;; * Variables
(defvar-keymap gptel-rewrite-actions-map
@@ -343,7 +352,7 @@ the changed regions. BUF is the (current) buffer."
" READY ✓\n"))
(add-hook 'eldoc-documentation-functions
#'gptel--rewrite-key-help nil 'local)
(overlay-put ov 'gptel-rewrite response)
- (overlay-put ov 'face 'secondary-selection)
+ (overlay-put ov 'face 'gptel-rewrite-highlight-face)
(overlay-put ov 'keymap gptel-rewrite-actions-map)
(overlay-put ov 'before-string
(concat (propertize