GNU bug report logs - #10181
24.0.92; [wishlist] split `diff-refine-change' in several faces

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 1 Dec 2011 15:57:01 UTC

Severity: wishlist

Found in version 24.0.92

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10181 <at> debbugs.gnu.org
Subject: bug#10181: split `diff-refine-change' in several faces
Date: Wed, 18 Jun 2014 11:57:14 +0300
There is a related problem: currently vc-annotate uses dark background
even when the default background is light.  Would be nicer to have
another option similar to the existing `vc-annotate-background', that
will define the default foreground (instead of the default background) and
to put colors from color-map on the background instead of the foreground:

=== modified file 'lisp/vc/vc-annotate.el'
--- lisp/vc/vc-annotate.el	2014-02-10 01:34:22 +0000
+++ lisp/vc/vc-annotate.el	2014-06-18 08:55:39 +0000
@@ -109,6 +109,14 @@ (defcustom vc-annotate-background "black
   :type '(choice (const :tag "Default background" nil) (color))
   :group 'vc)
 
+(defcustom vc-annotate-foreground "black"
+  "Foreground color for \\[vc-annotate].
+Default color is used if nil.
+It it applied only when `vc-annotate-background' is nil."
+  :type '(choice (const :tag "Default foreground" nil) (color))
+  :version "24.4"
+  :group 'vc)
+
 (defcustom vc-annotate-menu-elements '(2 0.5 0.1 0.01)
   "Menu elements for the mode-specific menu of VC-Annotate mode.
 List of factors, used to expand/compress the time scale.  See `vc-annotate'."
@@ -347,7 +355,9 @@ (defun vc-annotate (file rev &optional d
 `vc-annotate-menu-elements' customizes the menu elements of the
 mode-specific menu.  `vc-annotate-color-map' and
 `vc-annotate-very-old-color' define the mapping of time to colors.
-`vc-annotate-background' specifies the background color."
+`vc-annotate-background' specifies the background color.
+`vc-annotate-foreground' specifies the foreground color
+when `vc-annotate-background' is nil."
   (interactive
    (save-current-buffer
      (vc-ensure-vc-buffer)
@@ -666,10 +676,15 @@ (defun vc-annotate-lines (limit)
                ;; Make the face if not done.
                (face (or (intern-soft face-name)
                          (let ((tmp-face (make-face (intern face-name))))
-                           (set-face-foreground tmp-face (cdr color))
-                           (when vc-annotate-background
-			     (set-face-background tmp-face
-						  vc-annotate-background))
+                           (cond
+                            (vc-annotate-background
+                             (set-face-foreground tmp-face (cdr color))
+                             (set-face-background tmp-face vc-annotate-background))
+                            (vc-annotate-foreground
+                             (set-face-foreground tmp-face vc-annotate-foreground)
+                             (set-face-background tmp-face (cdr color)))
+                            (t
+                             (set-face-foreground tmp-face (cdr color))))
                            tmp-face))))	; Return the face
           (put-text-property start end 'face face)))))
   ;; Pretend to font-lock there were no matches.





This bug report was last modified 10 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.