Mercurial > emacs
comparison lisp/vc.el @ 46623:9ed0e3821f7a
(vc-next-action-on-file): Preserve find-file-literally.
author | André Spiegel <spiegel@gnu.org> |
---|---|
date | Mon, 22 Jul 2002 18:52:04 +0000 |
parents | 021204d82a30 |
children | e7b1564342e2 |
comparison
equal
deleted
inserted
replaced
46622:7ac7ae3b6a36 | 46623:9ed0e3821f7a |
---|---|
4 | 4 |
5 ;; Author: FSF (see below for full credits) | 5 ;; Author: FSF (see below for full credits) |
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
7 ;; Keywords: tools | 7 ;; Keywords: tools |
8 | 8 |
9 ;; $Id: vc.el,v 1.333 2002/07/16 20:44:23 monnier Exp $ | 9 ;; $Id: vc.el,v 1.334 2002/07/19 13:20:02 spiegel Exp $ |
10 | 10 |
11 ;; This file is part of GNU Emacs. | 11 ;; This file is part of GNU Emacs. |
12 | 12 |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
14 ;; it under the terms of the GNU General Public License as published by | 14 ;; it under the terms of the GNU General Public License as published by |
1103 If COMMENT is specified, it will be used as an admin or checkin comment. | 1103 If COMMENT is specified, it will be used as an admin or checkin comment. |
1104 If VERBOSE is non-nil, query the user rather than using default parameters." | 1104 If VERBOSE is non-nil, query the user rather than using default parameters." |
1105 (let ((visited (get-file-buffer file)) | 1105 (let ((visited (get-file-buffer file)) |
1106 state version) | 1106 state version) |
1107 (when visited | 1107 (when visited |
1108 (if vc-dired-mode | |
1109 (switch-to-buffer-other-window visited) | |
1110 (set-buffer visited)) | |
1108 ;; Check relation of buffer and file, and make sure | 1111 ;; Check relation of buffer and file, and make sure |
1109 ;; user knows what he's doing. First, finding the file | 1112 ;; user knows what he's doing. First, finding the file |
1110 ;; will check whether the file on disk is newer. | 1113 ;; will check whether the file on disk is newer. |
1111 (set-buffer visited) | 1114 ;; Ignore buffer-read-only during this test, and |
1112 ;; ignore buffer-read-only during this test | 1115 ;; preserve find-file-literally. |
1113 (let ((buffer-read-only (not (file-writable-p file)))) | 1116 (let ((buffer-read-only (not (file-writable-p file)))) |
1114 (if vc-dired-mode | 1117 (find-file-noselect file nil find-file-literally)) |
1115 (find-file-other-window file) | |
1116 (find-file-noselect file))) | |
1117 (if (not (verify-visited-file-modtime (current-buffer))) | 1118 (if (not (verify-visited-file-modtime (current-buffer))) |
1118 (if (yes-or-no-p "Replace file on disk with buffer contents? ") | 1119 (if (yes-or-no-p "Replace file on disk with buffer contents? ") |
1119 (write-file (buffer-file-name)) | 1120 (write-file (buffer-file-name)) |
1120 (error "Aborted")) | 1121 (error "Aborted")) |
1121 ;; Now, check if we have unsaved changes. | 1122 ;; Now, check if we have unsaved changes. |