aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2007-08-01 17:13:45 +0000
committerDan Nicolaescu2007-08-01 17:13:45 +0000
commitcb223bba1d6ce91c2da8a976898eca6bc4b36309 (patch)
tree40b43a60c95e01e82bc79c5b3f86336f96e0f052
parent373a5a1b388ee0213552c0468e026a076879da84 (diff)
downloademacs-cb223bba1d6ce91c2da8a976898eca6bc4b36309.tar.gz
emacs-cb223bba1d6ce91c2da8a976898eca6bc4b36309.zip
* 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.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/menu-bar.el14
-rw-r--r--lisp/vc-hooks.el3
-rw-r--r--lisp/vc.el13
5 files changed, 40 insertions, 3 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 09877e9518c..f56a7a0bf0c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -96,6 +96,9 @@ considered for update.
96 96
97*** The VC mode-line entry now has a tooltip. 97*** The VC mode-line entry now has a tooltip.
98 98
99*** VC backends can provide extra menu entries to be added to the "Version Control" menu.
100This can be used to add menu entries for backend specific functions.
101
99*** VC has some support for Bazaar (bzr). 102*** VC has some support for Bazaar (bzr).
100 103
101** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs. 104** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dd1f8eeb22a..123c2cdc479 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12007-08-01 Dan Nicolaescu <dann@ics.uci.edu>
2 Stefan Monnier <monnier@iro.umontreal.ca>
3
4 * vc.el: Document new VC operation `extra-menu'.
5
6 * vc-hooks.el (vc-default-extra-menu): New function.
7
8 * menu-bar.el (menu-bar-vc-filter): New function.
9 (menu-bar-tools-menu): Use it as a filter.
10
12007-08-01 Glenn Morris <rgm@gnu.org> 112007-08-01 Glenn Morris <rgm@gnu.org>
2 12
3 * progmodes/fortran.el: Remove leading `*' from all defcustom doc 13 * progmodes/fortran.el: Remove leading `*' from all defcustom doc
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"))
1165(define-key menu-bar-tools-menu [pcl-cvs] 1165(define-key menu-bar-tools-menu [pcl-cvs]
1166 '(menu-item "PCL-CVS" cvs-global-menu)) 1166 '(menu-item "PCL-CVS" cvs-global-menu))
1167(define-key menu-bar-tools-menu [vc] 1167(define-key menu-bar-tools-menu [vc]
1168 (list 'menu-item "Version Control" vc-menu-map)) 1168 (list 'menu-item "Version Control" vc-menu-map
1169 :filter 'menu-bar-vc-filter))
1170
1171(defun menu-bar-vc-filter (orig-binding)
1172 (let ((ext-binding
1173 (if vc-mode (vc-call 'extra-menu buffer-file-name))))
1174 ;; Give the VC backend a chance to add menu entries
1175 ;; specific for that backend.
1176 (if (null ext-binding)
1177 orig-binding
1178 (append orig-binding
1179 '((ext-menu-separator "---"))
1180 ext-binding))))
1169 1181
1170(define-key menu-bar-tools-menu [separator-compare] 1182(define-key menu-bar-tools-menu [separator-compare]
1171 '("--")) 1183 '("--"))
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index a8b6297caa2..18083f22e05 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -950,6 +950,9 @@ Used in `find-file-not-found-functions'."
950 (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action)) 950 (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action))
951 (define-key vc-menu-map [vc-register] '("Register" . vc-register))) 951 (define-key vc-menu-map [vc-register] '("Register" . vc-register)))
952 952
953(defun vc-default-extra-menu (backend)
954 nil)
955
953;; These are not correct and it's not currently clear how doing it 956;; These are not correct and it's not currently clear how doing it
954;; better (with more complicated expressions) might slow things down 957;; better (with more complicated expressions) might slow things down
955;; on older systems. 958;; on older systems.
diff --git a/lisp/vc.el b/lisp/vc.el
index 5030fb64471..78e098d874f 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -387,7 +387,7 @@
387;; 387;;
388;; Only required if `annotate-command' is defined for the backend, 388;; Only required if `annotate-command' is defined for the backend,
389;; AND you'd like the current time considered to be anything besides 389;; AND you'd like the current time considered to be anything besides
390;; (vs-annotate-convert-time (current-time)) -- i.e. the current 390;; (vc-annotate-convert-time (current-time)) -- i.e. the current
391;; time with hours, minutes, and seconds included. Probably safe to 391;; time with hours, minutes, and seconds included. Probably safe to
392;; ignore. Return the current-time, in units of fractional days. 392;; ignore. Return the current-time, in units of fractional days.
393;; 393;;
@@ -480,11 +480,20 @@
480;; 480;;
481;; Operation called in current buffer when opening a file. This can 481;; Operation called in current buffer when opening a file. This can
482;; be used by the backend to setup some local variables it might need. 482;; be used by the backend to setup some local variables it might need.
483; 483;;
484;; - find-file-not-found-hook () 484;; - find-file-not-found-hook ()
485;; 485;;
486;; Operation called in current buffer when opening a non-existing file. 486;; Operation called in current buffer when opening a non-existing file.
487;; By default, this asks the user if she wants to check out the file. 487;; By default, this asks the user if she wants to check out the file.
488;;
489;; - extra-menu ()
490;;
491;; Return a menu keymap, the items in the keymap will appear at the
492;; end of the Version Control menu. The goal is to allow backends
493;; to specify extra menu items that appear in the VC menu. This way
494;; you can provide menu entries for functionality that is specific
495;; to your backend and which does not map to any of the VC generic
496;; concepts.
488 497
489;;; Code: 498;;; Code:
490 499