diff lisp/menu-bar.el @ 83649:b210fca2fe6e

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 839-842) - Update from CVS - Change capitalization of VC backend names for new backends Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-29
author Miles Bader <miles@gnu.org>
date Fri, 03 Aug 2007 05:27:43 +0000
parents 65663fcd2caa 58ac5a791dfa
children 984b1dfd7601
line wrap: on
line diff
--- a/lisp/menu-bar.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/menu-bar.el	Fri Aug 03 05:27:43 2007 +0000
@@ -1165,7 +1165,19 @@
 (define-key menu-bar-tools-menu [pcl-cvs]
   '(menu-item "PCL-CVS" cvs-global-menu))
 (define-key menu-bar-tools-menu [vc]
-  (list 'menu-item "Version Control" vc-menu-map))
+  (list 'menu-item "Version Control" vc-menu-map
+  :filter 'menu-bar-vc-filter))
+
+(defun menu-bar-vc-filter (orig-binding)
+  (let ((ext-binding
+   (if vc-mode (vc-call 'extra-menu buffer-file-name))))
+    ;; Give the VC backend a chance to add menu entries
+    ;; specific for that backend.
+    (if (null ext-binding)
+    orig-binding
+      (append orig-binding
+	      '((ext-menu-separator "---"))
+	            ext-binding))))
 
 (define-key menu-bar-tools-menu [separator-compare]
   '("--"))