Commit cb223bba authored by Dan Nicolaescu's avatar Dan Nicolaescu
Browse files

* 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.
parent 373a5a1b
......@@ -96,6 +96,9 @@ considered for update.
*** The VC mode-line entry now has a tooltip.
*** VC backends can provide extra menu entries to be added to the "Version Control" menu.
This can be used to add menu entries for backend specific functions.
*** VC has some support for Bazaar (bzr).
** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
......
2007-08-01 Dan Nicolaescu <dann@ics.uci.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
* 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.
2007-08-01 Glenn Morris <rgm@gnu.org>
* progmodes/fortran.el: Remove leading `*' from all defcustom doc
......
......@@ -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]
'("--"))
......
......@@ -950,6 +950,9 @@ Used in `find-file-not-found-functions'."
(define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action))
(define-key vc-menu-map [vc-register] '("Register" . vc-register)))
(defun vc-default-extra-menu (backend)
nil)
;; These are not correct and it's not currently clear how doing it
;; better (with more complicated expressions) might slow things down
;; on older systems.
......
......@@ -387,7 +387,7 @@
;;
;; Only required if `annotate-command' is defined for the backend,
;; AND you'd like the current time considered to be anything besides
;; (vs-annotate-convert-time (current-time)) -- i.e. the current
;; (vc-annotate-convert-time (current-time)) -- i.e. the current
;; time with hours, minutes, and seconds included. Probably safe to
;; ignore. Return the current-time, in units of fractional days.
;;
......@@ -480,11 +480,20 @@
;;
;; Operation called in current buffer when opening a file. This can
;; be used by the backend to setup some local variables it might need.
;
;;
;; - find-file-not-found-hook ()
;;
;; Operation called in current buffer when opening a non-existing file.
;; By default, this asks the user if she wants to check out the file.
;;
;; - extra-menu ()
;;
;; Return a menu keymap, the items in the keymap will appear at the
;; end of the Version Control menu. The goal is to allow backends
;; to specify extra menu items that appear in the VC menu. This way
;; you can provide menu entries for functionality that is specific
;; to your backend and which does not map to any of the VC generic
;; concepts.
;;; Code:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment