git-blame.el: improve color handling
Signed-off-by: David Kågedal <davidk@lysator.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
David Kågedal committed
Feb 9, 2007 at 09:21 UTC
fa882116006e0403bb1b74973bb5f3f34f1cf523
1 file changed
+10
-14
contrib/emacs/git-blame.el
+10
-14
@@ -95,16 +95,10 @@
95
colors))
96
97
(defvar git-blame-dark-colors
98
- (color-scale '("00" "04" "08" "0c"
99
- "10" "14" "18" "1c"
100
- "20" "24" "28" "2c"
101
- "30" "34" "38" "3c")))
98
+ (color-scale '("0c" "04" "24" "1c" "2c" "34" "14" "3c")))
99
100
(defvar git-blame-light-colors
104
- (color-scale '("c0" "c4" "c8" "cc"
105
- "d0" "d4" "d8" "dc"
106
- "e0" "e4" "e8" "ec"
107
- "f0" "f4" "f8" "fc")))
101
+ (color-scale '("c4" "d4" "cc" "dc" "f4" "e4" "fc" "ec")))
102
103
(defvar git-blame-ancient-color "dark green")
104
@@ -127,13 +121,15 @@
121
(make-local-variable 'git-blame-overlays)
122
(make-local-variable 'git-blame-colors)
123
(make-local-variable 'git-blame-cache)
130
- (let ((bgmode (cdr (assoc 'background-mode (frame-parameters)))))
131
- (if (eq bgmode 'dark)
132
- (setq git-blame-colors git-blame-dark-colors)
133
- (setq git-blame-colors git-blame-light-colors)))
124
+ (git-blame-cleanup)
125
(if git-blame-mode
135
- (git-blame-run)
136
- (git-blame-cleanup)))
126
+ (progn
127
+ (let ((bgmode (cdr (assoc 'background-mode (frame-parameters)))))
128
+ (if (eq bgmode 'dark)
129
+ (setq git-blame-colors git-blame-dark-colors)
130
+ (setq git-blame-colors git-blame-light-colors)))
131
+ (setq git-blame-cache (make-hash-table :test 'equal))
132
+ (git-blame-run))))
133
134
(defun git-blame-run ()
135
(let* ((display-buf (current-buffer))