From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: add a tooltip and a mouse binding to the VC mode-line entry Date: Thu, 05 Jul 2007 13:13:28 -0400 Message-ID: References: <200707031711.l63HB39F025974@oogie-boogie.ics.uci.edu> <200707051545.l65FjSgW019871@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1183655697 25152 80.91.229.12 (5 Jul 2007 17:14:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 5 Jul 2007 17:14:57 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 05 19:14:44 2007 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I6Uug-0000FQ-F2 for ged-emacs-devel@m.gmane.org; Thu, 05 Jul 2007 19:14:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I6Uuf-0004wn-Sj for ged-emacs-devel@m.gmane.org; Thu, 05 Jul 2007 13:14:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I6Utf-0004Se-1d for emacs-devel@gnu.org; Thu, 05 Jul 2007 13:13:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I6Ute-0004RB-Fr for emacs-devel@gnu.org; Thu, 05 Jul 2007 13:13:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I6Utd-0004QZ-Sj for emacs-devel@gnu.org; Thu, 05 Jul 2007 13:13:37 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I6UtZ-0004GV-Li; Thu, 05 Jul 2007 13:13:33 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 0AB762CF438; Thu, 5 Jul 2007 13:13:33 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 6080C3FE0; Thu, 5 Jul 2007 13:13:28 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 35F626C8CC; Thu, 5 Jul 2007 13:13:28 -0400 (EDT) In-Reply-To: <200707051545.l65FjSgW019871@oogie-boogie.ics.uci.edu> (Dan Nicolaescu's message of "Thu\, 05 Jul 2007 08\:45\:28 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74351 Archived-At: I believe the patch below would be pretty much equivalent, but with the advantage that C-h k can be used on it (i.e. C-h k and then mouse-1 on the VC thingy to select the entry you want). Stefan --- menu-bar.el 08 May 2007 11:55:53 -0400 1.302 +++ menu-bar.el 05 Jul 2007 13:09:04 -0400 @@ -1161,6 +1161,7 @@ '("--")) (defvar vc-menu-map (make-sparse-keymap "Version Control")) +(defalias 'vc-menu-map vc-menu-map) (define-key menu-bar-tools-menu [pcl-cvs] '(menu-item "PCL-CVS" cvs-global-menu)) (define-key menu-bar-tools-menu [vc] --- bindings.el 13 Feb 2007 17:39:39 -0500 1.178 +++ bindings.el 05 Jul 2007 13:07:56 -0400 @@ -291,7 +291,13 @@ 'mode-line-buffer-identification (propertize " " 'help-echo help-echo) 'mode-line-position - '(vc-mode vc-mode) + (list + `(:propertize ("" vc-mode) + help-echo "Version Control mouse-1: VC menu" + mouse-face mode-line-highlight + local-map ,(let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] 'vc-menu-map) + map))) (propertize " " 'help-echo help-echo) 'mode-line-modes `(which-func-mode ("" which-func-format ,dashes))