diff options
| author | André Spiegel | 2000-11-04 18:24:50 +0000 |
|---|---|---|
| committer | André Spiegel | 2000-11-04 18:24:50 +0000 |
| commit | ff40374a7bce878046a9495b4d473b816b6a9be2 (patch) | |
| tree | cab6227dfb9af6d595302d654447b2cde916bba1 | |
| parent | ad88b950fecfbee5b34800e3d3ce60c2c5993be5 (diff) | |
| download | emacs-ff40374a7bce878046a9495b4d473b816b6a9be2.tar.gz emacs-ff40374a7bce878046a9495b4d473b816b6a9be2.zip | |
(vc-insert-file): Rewritten. Don't bother about auto-save-mode.
| -rw-r--r-- | lisp/vc-hooks.el | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index d3ac6517187..7af6c735c97 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.125 2000/10/27 12:11:55 spiegel Exp $ | 8 | ;; $Id: vc-hooks.el,v 1.126 2000/10/27 13:26:18 spiegel Exp $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -208,26 +208,24 @@ It is usually called via the `vc-call' macro." | |||
| 208 | 208 | ||
| 209 | Optional argument LIMIT is a regexp. If present, the file is inserted | 209 | Optional argument LIMIT is a regexp. If present, the file is inserted |
| 210 | in chunks of size BLOCKSIZE (default 8 kByte), until the first | 210 | in chunks of size BLOCKSIZE (default 8 kByte), until the first |
| 211 | occurrence of LIMIT is found. The function returns nil if FILE doesn't | 211 | occurrence of LIMIT is found. The function returns non-nil if FILE |
| 212 | exist." | 212 | exists and its contents were successfully inserted." |
| 213 | (erase-buffer) | 213 | (erase-buffer) |
| 214 | (cond ((file-exists-p file) | 214 | (when (file-exists-p file) |
| 215 | (cond (limit | 215 | (if (not limit) |
| 216 | (if (not blocksize) (setq blocksize 8192)) | 216 | (insert-file-contents file) |
| 217 | (let (found s) | 217 | (if (not blocksize) (setq blocksize 8192)) |
| 218 | (while (not found) | 218 | (let (found s) |
| 219 | (setq s (buffer-size)) | 219 | (while (not found) |
| 220 | (goto-char (1+ s)) | 220 | (setq s (buffer-size)) |
| 221 | (setq found | 221 | (goto-char (1+ s)) |
| 222 | (or (zerop (cadr (insert-file-contents | 222 | (setq found |
| 223 | file nil s (+ s blocksize)))) | 223 | (or (zerop (cadr (insert-file-contents |
| 224 | (progn (beginning-of-line) | 224 | file nil s (+ s blocksize)))) |
| 225 | (re-search-forward limit nil t))))))) | 225 | (progn (beginning-of-line) |
| 226 | (t (insert-file-contents file))) | 226 | (re-search-forward limit nil t))))))) |
| 227 | (set-buffer-modified-p nil) | 227 | (set-buffer-modified-p nil) |
| 228 | (auto-save-mode nil) | 228 | t)) |
| 229 | t) | ||
| 230 | (t nil))) | ||
| 231 | 229 | ||
| 232 | ;;; Access functions to file properties | 230 | ;;; Access functions to file properties |
| 233 | ;;; (Properties should be _set_ using vc-file-setprop, but | 231 | ;;; (Properties should be _set_ using vc-file-setprop, but |