Mercurial > emacs
comparison lisp/vc.el @ 12280:b33cc6583bb9
(vc-backend-dispatch): Move definition before first use.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 16 Jun 1995 18:04:47 +0000 |
parents | de2a82180af0 |
children | ba3d2da14bca |
comparison
equal
deleted
inserted
replaced
12279:de2a82180af0 | 12280:b33cc6583bb9 |
---|---|
72 | 72 |
73 (if (not (assoc 'vc-parent-buffer minor-mode-alist)) | 73 (if (not (assoc 'vc-parent-buffer minor-mode-alist)) |
74 (setq minor-mode-alist | 74 (setq minor-mode-alist |
75 (cons '(vc-parent-buffer vc-parent-buffer-name) | 75 (cons '(vc-parent-buffer vc-parent-buffer-name) |
76 minor-mode-alist))) | 76 minor-mode-alist))) |
77 | |
78 ;; To implement support for a new version-control system, add another | |
79 ;; branch to the vc-backend-dispatch macro and fill it in in each | |
80 ;; call. The variable vc-master-templates in vc-hooks.el will also | |
81 ;; have to change. | |
82 | |
83 (defmacro vc-backend-dispatch (f s r c) | |
84 "Execute FORM1, FORM2 or FORM3 for SCCS, RCS or CVS respectively. | |
85 If FORM3 is `RCS', use FORM2 for CVS as well as RCS. | |
86 \(CVS shares some code with RCS)." | |
87 (list 'let (list (list 'type (list 'vc-backend f))) | |
88 (list 'cond | |
89 (list (list 'eq 'type (quote 'SCCS)) s) ;; SCCS | |
90 (list (list 'eq 'type (quote 'RCS)) r) ;; RCS | |
91 (list (list 'eq 'type (quote 'CVS)) ;; CVS | |
92 (if (eq c 'RCS) r c)) | |
93 ))) | |
77 | 94 |
78 ;; General customization | 95 ;; General customization |
79 | 96 |
80 (defvar vc-suppress-confirm nil | 97 (defvar vc-suppress-confirm nil |
81 "*If non-nil, treat user as expert; suppress yes-no prompts on some things.") | 98 "*If non-nil, treat user as expert; suppress yes-no prompts on some things.") |
296 (message "Running %s...OK" command)) | 313 (message "Running %s...OK" command)) |
297 ) | 314 ) |
298 (set-buffer obuf) | 315 (set-buffer obuf) |
299 status) | 316 status) |
300 ) | 317 ) |
301 | |
302 ;; Everything eventually funnels through these functions. To implement | |
303 ;; support for a new version-control system, add another branch to the | |
304 ;; vc-backend-dispatch macro and fill it in in each call. The variable | |
305 ;; vc-master-templates in vc-hooks.el will also have to change. | |
306 | |
307 (defmacro vc-backend-dispatch (f s r c) | |
308 "Execute FORM1, FORM2 or FORM3 depending whether we're using SCCS, RCS or CVS. | |
309 If FORM3 is RCS, use FORM2 even if we are using CVS. (CVS shares some code | |
310 with RCS)." | |
311 (list 'let (list (list 'type (list 'vc-backend f))) | |
312 (list 'cond | |
313 (list (list 'eq 'type (quote 'SCCS)) s) ;; SCCS | |
314 (list (list 'eq 'type (quote 'RCS)) r) ;; RCS | |
315 (list (list 'eq 'type (quote 'CVS)) ;; CVS | |
316 (if (eq c 'RCS) r c)) | |
317 ))) | |
318 | 318 |
319 ;;; Save a bit of the text around POSN in the current buffer, to help | 319 ;;; Save a bit of the text around POSN in the current buffer, to help |
320 ;;; us find the corresponding position again later. This works even | 320 ;;; us find the corresponding position again later. This works even |
321 ;;; if all markers are destroyed or corrupted. | 321 ;;; if all markers are destroyed or corrupted. |
322 (defun vc-position-context (posn) | 322 (defun vc-position-context (posn) |