From: Juri Linkov <juri@jurta.org>
To: 17808@debbugs.gnu.org
Subject: bug#17808: 24.4.50; vc-annotate colors
Date: Thu, 19 Jun 2014 09:54:44 +0300 [thread overview]
Message-ID: <87bntpl77v.fsf@mail.jurta.org> (raw)
Severity: wishlist
Tags: patch
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 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-19 06:52:59 +0000
@@ -109,6 +109,16 @@ (defcustom vc-annotate-background "black
:type '(choice (const :tag "Default background" nil) (color))
:group 'vc)
+(defcustom vc-annotate-foreground nil
+ "Foreground color for \\[vc-annotate].
+When non-nil, the color range from `vc-annotate-color-map'
+is applied to background, and the color from this definition
+is applied to foreground.
+This option is in effect only when `vc-annotate-background' is nil."
+ :type '(choice (const :tag "Default foreground" nil) (color))
+ :version "24.5"
+ :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 +357,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 +678,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.
next reply other threads:[~2014-06-19 6:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 6:54 Juri Linkov [this message]
2014-07-01 23:18 ` bug#17808: 24.4.50; vc-annotate colors Juri Linkov
2014-07-02 2:47 ` Eli Zaretskii
2014-07-02 23:31 ` Juri Linkov
2014-07-04 23:48 ` Juri Linkov
2014-07-08 8:51 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bntpl77v.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=17808@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).