aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-07-11 22:05:01 +0000
committerStefan Monnier2001-07-11 22:05:01 +0000
commit14fef9dea4427b637a9593fe510a689c721732bf (patch)
tree0eb46f8c63242068c6e54b5877effbc04050cac7
parentfe5a01629a482b507c2f481687b96c2ecb46a9c3 (diff)
downloademacs-14fef9dea4427b637a9593fe510a689c721732bf.tar.gz
emacs-14fef9dea4427b637a9593fe510a689c721732bf.zip
(vc-mode): Dummy function for doc purposes.
(vc-prefix-map): Moved back from vc.el.
-rw-r--r--lisp/vc-hooks.el89
1 files changed, 59 insertions, 30 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 4dfe4100bca..f4d843397e3 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -5,7 +5,7 @@
5;; Author: FSF (see vc.el for full credits) 5;; Author: FSF (see vc.el for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8;; $Id: vc-hooks.el,v 1.130 2000/11/20 14:01:18 spiegel Exp $ 8;; $Id: vc-hooks.el,v 1.131 2000/11/24 16:25:59 spiegel Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -120,6 +120,14 @@ See also variable `vc-consult-headers'."
120(make-variable-buffer-local 'vc-mode) 120(make-variable-buffer-local 'vc-mode)
121(put 'vc-mode 'permanent-local t) 121(put 'vc-mode 'permanent-local t)
122 122
123(defun vc-mode (&optional arg)
124 ;; Dummy function for C-h m
125 "Version Control minor mode.
126This minor mode is automatically activated whenever you visit a file under
127control of one of the revision control systems in `vc-handled-backends'.
128VC commands are globally reachable under the prefix `\\[vc-prefix-map]':
129\\{vc-prefix-map}")
130
123(defmacro vc-error-occurred (&rest body) 131(defmacro vc-error-occurred (&rest body)
124 (list 'condition-case nil (cons 'progn (append body '(nil))) '(error t))) 132 (list 'condition-case nil (cons 'progn (append body '(nil))) '(error t)))
125 133
@@ -224,14 +232,14 @@ exists and its contents were successfully inserted."
224 (set-buffer-modified-p nil) 232 (set-buffer-modified-p nil)
225 t)) 233 t))
226 234
227;;; Access functions to file properties 235;; Access functions to file properties
228;;; (Properties should be _set_ using vc-file-setprop, but 236;; (Properties should be _set_ using vc-file-setprop, but
229;;; _retrieved_ only through these functions, which decide 237;; _retrieved_ only through these functions, which decide
230;;; if the property is already known or not. A property should 238;; if the property is already known or not. A property should
231;;; only be retrieved by vc-file-getprop if there is no 239;; only be retrieved by vc-file-getprop if there is no
232;;; access function.) 240;; access function.)
233 241
234;;; properties indicating the backend being used for FILE 242;; properties indicating the backend being used for FILE
235 243
236(defun vc-registered (file) 244(defun vc-registered (file)
237 "Return non-nil if FILE is registered in a version control system. 245 "Return non-nil if FILE is registered in a version control system.
@@ -635,7 +643,7 @@ current, and kill the buffer that visits the link."
635 643
636(add-hook 'find-file-hooks 'vc-find-file-hook) 644(add-hook 'find-file-hooks 'vc-find-file-hook)
637 645
638;;; more hooks, this time for file-not-found 646;; more hooks, this time for file-not-found
639(defun vc-file-not-found-hook () 647(defun vc-file-not-found-hook ()
640 "When file is not found, try to check it out from version control. 648 "When file is not found, try to check it out from version control.
641Returns t if checkout was successful, nil otherwise. 649Returns t if checkout was successful, nil otherwise.
@@ -662,11 +670,32 @@ Used in `find-file-not-found-hooks'."
662;; ??? DL: why is this not done? 670;; ??? DL: why is this not done?
663;;;(add-hook 'kill-buffer-hook 'vc-kill-buffer-hook) 671;;;(add-hook 'kill-buffer-hook 'vc-kill-buffer-hook)
664 672
665;;; Now arrange for bindings and autoloading of the main package. 673;; Now arrange for (autoloaded) bindings of the main package.
666;;; Bindings for this have to go in the global map, as we'll often 674;; Bindings for this have to go in the global map, as we'll often
667;;; want to call them from random buffers. 675;; want to call them from random buffers.
668 676
669(autoload 'vc-prefix-map "vc" nil nil 'keymap) 677;; Autoloading works fine, but it prevents shortcuts from appearing
678;; in the menu because they don't exist yet when the menu is built.
679;; (autoload 'vc-prefix-map "vc" nil nil 'keymap)
680(defvar vc-prefix-map
681 (let ((map (make-sparse-keymap)))
682 (define-key map "a" 'vc-update-change-log)
683 (define-key map "b" 'vc-switch-backend)
684 (define-key map "c" 'vc-cancel-version)
685 (define-key map "d" 'vc-directory)
686 (define-key map "g" 'vc-annotate)
687 (define-key map "h" 'vc-insert-headers)
688 (define-key map "i" 'vc-register)
689 (define-key map "l" 'vc-print-log)
690 (define-key map "m" 'vc-merge)
691 (define-key map "r" 'vc-retrieve-snapshot)
692 (define-key map "s" 'vc-create-snapshot)
693 (define-key map "u" 'vc-revert-buffer)
694 (define-key map "v" 'vc-next-action)
695 (define-key map "=" 'vc-diff)
696 (define-key map "~" 'vc-version-other-window)
697 map))
698(fset 'vc-prefix-map vc-prefix-map)
670(define-key global-map "\C-xv" 'vc-prefix-map) 699(define-key global-map "\C-xv" 'vc-prefix-map)
671 700
672(if (not (boundp 'vc-menu-map)) 701(if (not (boundp 'vc-menu-map))
@@ -698,22 +727,22 @@ Used in `find-file-not-found-hooks'."
698 (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action)) 727 (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action))
699 (define-key vc-menu-map [vc-register] '("Register" . vc-register))) 728 (define-key vc-menu-map [vc-register] '("Register" . vc-register)))
700 729
701;;; These are not correct and it's not currently clear how doing it 730;; These are not correct and it's not currently clear how doing it
702;;; better (with more complicated expressions) might slow things down 731;; better (with more complicated expressions) might slow things down
703;;; on older systems. 732;; on older systems.
704 733
705;;;(put 'vc-rename-file 'menu-enable 'vc-mode) 734;;(put 'vc-rename-file 'menu-enable 'vc-mode)
706;;;(put 'vc-annotate 'menu-enable '(eq (vc-buffer-backend) 'CVS)) 735;;(put 'vc-annotate 'menu-enable '(eq (vc-buffer-backend) 'CVS))
707;;;(put 'vc-version-other-window 'menu-enable 'vc-mode) 736;;(put 'vc-version-other-window 'menu-enable 'vc-mode)
708;;;(put 'vc-diff 'menu-enable 'vc-mode) 737;;(put 'vc-diff 'menu-enable 'vc-mode)
709;;;(put 'vc-update-change-log 'menu-enable 738;;(put 'vc-update-change-log 'menu-enable
710;;; '(member (vc-buffer-backend) '(RCS CVS))) 739;; '(member (vc-buffer-backend) '(RCS CVS)))
711;;;(put 'vc-print-log 'menu-enable 'vc-mode) 740;;(put 'vc-print-log 'menu-enable 'vc-mode)
712;;;(put 'vc-cancel-version 'menu-enable 'vc-mode) 741;;(put 'vc-cancel-version 'menu-enable 'vc-mode)
713;;;(put 'vc-revert-buffer 'menu-enable 'vc-mode) 742;;(put 'vc-revert-buffer 'menu-enable 'vc-mode)
714;;;(put 'vc-insert-headers 'menu-enable 'vc-mode) 743;;(put 'vc-insert-headers 'menu-enable 'vc-mode)
715;;;(put 'vc-next-action 'menu-enable 'vc-mode) 744;;(put 'vc-next-action 'menu-enable 'vc-mode)
716;;;(put 'vc-register 'menu-enable '(and buffer-file-name (not vc-mode))) 745;;(put 'vc-register 'menu-enable '(and buffer-file-name (not vc-mode)))
717 746
718(provide 'vc-hooks) 747(provide 'vc-hooks)
719 748