summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2007-08-01 17:13:45 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2007-08-01 17:13:45 +0000
commitcb223bba1d6ce91c2da8a976898eca6bc4b36309 (patch)
tree40b43a60c95e01e82bc79c5b3f86336f96e0f052 /lisp/menu-bar.el
parent373a5a1b388ee0213552c0468e026a076879da84 (diff)
downloademacs-cb223bba1d6ce91c2da8a976898eca6bc4b36309.tar.gz
* vc.el: Document new VC operation `extra-menu'.
* vc-hooks.el (vc-default-extra-menu): New function. * menu-bar.el (menu-bar-vc-filter): New function. (menu-bar-tools-menu): Use it as a filter.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index d9f6405cf57..6b579763689 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1165,7 +1165,19 @@ mail status in mode line"))
(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]
'("--"))