Mercurial > emacs
comparison lisp/vc-hooks.el @ 47918:022aa2332f91
(vc-insert-file): Fix typo.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 17 Oct 2002 15:46:06 +0000 |
parents | 150814112c89 |
children | c1b2182d8ca1 |
comparison
equal
deleted
inserted
replaced
47917:ca7641fe56ba | 47918:022aa2332f91 |
---|---|
3 ;; Copyright (C) 1992,93,94,95,96,98,99,2000 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992,93,94,95,96,98,99,2000 Free Software Foundation, Inc. |
4 | 4 |
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.144 2002/09/04 20:45:34 spiegel Exp $ | 8 ;; $Id: vc-hooks.el,v 1.145 2002/09/05 06:31:11 spiegel Exp $ |
9 | 9 |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
168 (intern (concat "vc-" (downcase (symbol-name backend)) | 168 (intern (concat "vc-" (downcase (symbol-name backend)) |
169 "-" (symbol-name sym)))) | 169 "-" (symbol-name sym)))) |
170 | 170 |
171 (defun vc-find-backend-function (backend fun) | 171 (defun vc-find-backend-function (backend fun) |
172 "Return BACKEND-specific implementation of FUN. | 172 "Return BACKEND-specific implementation of FUN. |
173 If there is no such implementation, return the default implementation; | 173 If there is no such implementation, return the default implementation; |
174 if that doesn't exist either, return nil." | 174 if that doesn't exist either, return nil." |
175 (let ((f (vc-make-backend-sym backend fun))) | 175 (let ((f (vc-make-backend-sym backend fun))) |
176 (if (fboundp f) f | 176 (if (fboundp f) f |
177 ;; Load vc-BACKEND.el if needed. | 177 ;; Load vc-BACKEND.el if needed. |
178 (require (intern (concat "vc-" (downcase (symbol-name backend))))) | 178 (require (intern (concat "vc-" (downcase (symbol-name backend))))) |
215 (defun vc-insert-file (file &optional limit blocksize) | 215 (defun vc-insert-file (file &optional limit blocksize) |
216 "Insert the contents of FILE into the current buffer. | 216 "Insert the contents of FILE into the current buffer. |
217 | 217 |
218 Optional argument LIMIT is a regexp. If present, the file is inserted | 218 Optional argument LIMIT is a regexp. If present, the file is inserted |
219 in chunks of size BLOCKSIZE (default 8 kByte), until the first | 219 in chunks of size BLOCKSIZE (default 8 kByte), until the first |
220 occurrence of LIMIT is found. Anything from the start of that occurence | 220 occurrence of LIMIT is found. Anything from the start of that occurrence |
221 to the end of the buffer is then deleted. The function returns | 221 to the end of the buffer is then deleted. The function returns |
222 non-nil if FILE exists and its contents were successfully inserted." | 222 non-nil if FILE exists and its contents were successfully inserted." |
223 (erase-buffer) | 223 (erase-buffer) |
224 (when (file-exists-p file) | 224 (when (file-exists-p file) |
225 (if (not limit) | 225 (if (not limit) |
266 (mapcar | 266 (mapcar |
267 (lambda (b) | 267 (lambda (b) |
268 (and (vc-call-backend b 'registered file) | 268 (and (vc-call-backend b 'registered file) |
269 (vc-file-setprop file 'vc-backend b) | 269 (vc-file-setprop file 'vc-backend b) |
270 (throw 'found t))) | 270 (throw 'found t))) |
271 (if (or (not backend) (eq backend 'none)) | 271 (if (or (not backend) (eq backend 'none)) |
272 vc-handled-backends | 272 vc-handled-backends |
273 (cons backend vc-handled-backends)))) | 273 (cons backend vc-handled-backends)))) |
274 ;; File is not registered. | 274 ;; File is not registered. |
275 (vc-file-setprop file 'vc-backend 'none) | 275 (vc-file-setprop file 'vc-backend 'none) |
276 nil)))) | 276 nil)))) |
349 locking is used for the file, this state means that | 349 locking is used for the file, this state means that |
350 the current version is locked by the calling user. | 350 the current version is locked by the calling user. |
351 | 351 |
352 USER The current version of the working file is locked by | 352 USER The current version of the working file is locked by |
353 some other USER (a string). | 353 some other USER (a string). |
354 | 354 |
355 'needs-patch The file has not been edited by the user, but there is | 355 'needs-patch The file has not been edited by the user, but there is |
356 a more recent version on the current branch stored | 356 a more recent version on the current branch stored |
357 in the master file. | 357 in the master file. |
358 | 358 |
359 'needs-merge The file has been edited by the user, and there is also | 359 'needs-merge The file has been edited by the user, and there is also |
499 the user should be returned; if REGEXP is non-nil that means to return | 499 the user should be returned; if REGEXP is non-nil that means to return |
500 a regexp for matching all such backup files, regardless of the version." | 500 a regexp for matching all such backup files, regardless of the version." |
501 (if regexp | 501 (if regexp |
502 (concat (regexp-quote (file-name-nondirectory file)) | 502 (concat (regexp-quote (file-name-nondirectory file)) |
503 "\\.~[0-9.]+" (unless manual "\\.") "~") | 503 "\\.~[0-9.]+" (unless manual "\\.") "~") |
504 (expand-file-name (concat (file-name-nondirectory file) | 504 (expand-file-name (concat (file-name-nondirectory file) |
505 ".~" (or rev (vc-workfile-version file)) | 505 ".~" (or rev (vc-workfile-version file)) |
506 (unless manual ".") "~") | 506 (unless manual ".") "~") |
507 (file-name-directory file)))) | 507 (file-name-directory file)))) |
508 | 508 |
509 (defun vc-delete-automatic-version-backups (file) | 509 (defun vc-delete-automatic-version-backups (file) |
510 "Delete all existing automatic version backups for FILE." | 510 "Delete all existing automatic version backups for FILE." |
656 ;; it again. GUD does that, and repeated questions | 656 ;; it again. GUD does that, and repeated questions |
657 ;; are painful. | 657 ;; are painful. |
658 (get-file-buffer | 658 (get-file-buffer |
659 (abbreviate-file-name | 659 (abbreviate-file-name |
660 (file-chase-links buffer-file-name)))) | 660 (file-chase-links buffer-file-name)))) |
661 | 661 |
662 (vc-follow-link) | 662 (vc-follow-link) |
663 (message "Followed link to %s" buffer-file-name) | 663 (message "Followed link to %s" buffer-file-name) |
664 (vc-find-file-hook)) | 664 (vc-find-file-hook)) |
665 (t | 665 (t |
666 (if (yes-or-no-p (format | 666 (if (yes-or-no-p (format |