From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pmlists@free.fr (Peter =?UTF-8?Q?M=C3=BCnster?=) Newsgroups: gmane.emacs.bugs Subject: bug#9205: 24.0.50; colored mark in vc mode-line Date: Fri, 29 Jul 2011 13:13:36 +0200 Message-ID: <874o25jq5b.fsf@micropit.couberia.bzh> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1312054284 10940 80.91.229.12 (30 Jul 2011 19:31:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 30 Jul 2011 19:31:24 +0000 (UTC) To: 9205@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 30 21:31:18 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QnFFh-0004eS-LG for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jul 2011 21:31:14 +0200 Original-Received: from localhost ([::1]:55741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnFFg-0000Bn-TY for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jul 2011 15:31:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnDoL-0005qP-NG for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2011 13:58:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QnDoJ-0008Cr-9U for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2011 13:58:53 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnDoJ-0008Ce-7v for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2011 13:58:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QnDoU-00064g-Ij; Sat, 30 Jul 2011 13:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: pmlists@free.fr (Peter =?UTF-8?Q?M=C3=BCnster?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Jul 2011 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9205 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.131204869723268 (code B ref -1); Sat, 30 Jul 2011 17:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Jul 2011 17:58:17 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QnDnj-00063E-SV for submit@debbugs.gnu.org; Sat, 30 Jul 2011 13:58:16 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qml0k-0004N1-R9 for submit@debbugs.gnu.org; Fri, 29 Jul 2011 07:13:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qml0f-0002MU-9P for submit@debbugs.gnu.org; Fri, 29 Jul 2011 07:13:41 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:38296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qml0f-0002MQ-7y for submit@debbugs.gnu.org; Fri, 29 Jul 2011 07:13:41 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qml0e-0001hp-9A for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2011 07:13:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qml0d-0002Ly-82 for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2011 07:13:40 -0400 Original-Received: from smtp10.smtpout.orange.fr ([80.12.242.132]:57968 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qml0d-0002Lu-2T for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2011 07:13:39 -0400 Original-Received: from micropit.couberia.bzh ([2.2.136.27]) by mwinf5d33 with ME id DnDc1h0060beR4203nDctV; Fri, 29 Jul 2011 13:13:37 +0200 X-ME-engine: default Original-Received: by micropit.couberia.bzh (Postfix, from userid 1000) id 4FED21609E6; Fri, 29 Jul 2011 13:13:36 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sat, 30 Jul 2011 13:58:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 30 Jul 2011 13:59:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Sat, 30 Jul 2011 15:31:10 -0400 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:49729 Archived-At: Hello, Here a little feature request for vc: --8<---------------cut here---------------start------------->8--- ;; Make it immediately obvious, if file is modified or not, by a red or ;; a green point in the modeline. ;; Code is from psvn.el by Stefan Reichoer (GNU GPL) (defvar vc-state-mark-modeline t) (defun vc-mark-modeline-dot (color) (propertize " " 'display `(image :type xpm :data ,(format "/* XPM */ static char * data[] = { \"18 13 3 1\", \" c None\", \"+ c #000000\", \". c %s\", \" \", \" +++++ \", \" +.....+ \", \" +.......+ \", \" +.........+ \", \" +.........+ \", \" +.........+ \", \" +.........+ \", \" +.........+ \", \" +.......+ \", \" +.....+ \", \" +++++ \", \" \"};" color) :ascent center))) (defsubst vc-state->color (stat) "Interpret vc-state symbol to mode line color" (case stat ('edited "tomato" ) ('up-to-date "GreenYellow" ) ;; what is missing here?? ;; ('unknown "gray" ) ;; ('added "blue" ) ;; ('deleted "red" ) ;; ('unmerged "purple" ) (t "red"))) (defun vc-install-state-mark-modeline (color) (push `(vc-state-mark-modeline ,(vc-mark-modeline-dot color)) mode-line-format)) (defun vc-uninstall-state-mark-modeline () (setq mode-line-format (remove-if #'(lambda (mode) (eq (car-safe mode) 'vc-state-mark-modeline)) mode-line-format))) (defadvice vc-default-mode-line-string (before my-before-vc-mode-line-string activate) (let* ((backend-name (symbol-name backend)) (state (vc-state file backend)) (color (vc-state->color state))) (vc-uninstall-state-mark-modeline) (vc-install-state-mark-modeline color))) --8<---------------cut here---------------end--------------->8--- Cheers, -- Peter