From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#17808: 24.4.50; vc-annotate colors Date: Thu, 19 Jun 2014 09:54:44 +0300 Organization: JURTA Message-ID: <87bntpl77v.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403161957 22753 80.91.229.3 (19 Jun 2014 07:12:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Jun 2014 07:12:37 +0000 (UTC) To: 17808@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 19 09:12:30 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WxWWK-0000Wr-P7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Jun 2014 09:12:29 +0200 Original-Received: from localhost ([::1]:33983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxWWK-0003b3-8n for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Jun 2014 03:12:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxWW6-0003Un-IA for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 03:12:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxWVu-0002rt-NR for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 03:12:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxWVu-0002rp-JP for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 03:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WxWVu-0004rD-97 for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 03:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jun 2014 07:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17808 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.140316190118625 (code B ref -1); Thu, 19 Jun 2014 07:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jun 2014 07:11:41 +0000 Original-Received: from localhost ([127.0.0.1]:52412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxWVZ-0004qL-20 for submit@debbugs.gnu.org; Thu, 19 Jun 2014 03:11:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46221) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxWVX-0004py-5h for submit@debbugs.gnu.org; Thu, 19 Jun 2014 03:11:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxWVI-0002l6-0J for submit@debbugs.gnu.org; Thu, 19 Jun 2014 03:11:33 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxWVH-0002kx-TI for submit@debbugs.gnu.org; Thu, 19 Jun 2014 03:11:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxWVA-0003Dz-BW for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 03:11:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxWV2-0002jM-Fp for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 03:11:16 -0400 Original-Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:57239 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxWV2-0002jH-9q for bug-gnu-emacs@gnu.org; Thu, 19 Jun 2014 03:11:08 -0400 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D14C7375AE06ED for ; Thu, 19 Jun 2014 00:11:03 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90540 Archived-At: 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.