comparison lisp/vc.el @ 20602:e8566ea47491

(vc-resynch-window): Behave properly when view-read-only is non-nil.
author André Spiegel <spiegel@gnu.org>
date Wed, 07 Jan 1998 14:33:37 +0000
parents e39dadab5521
children e3498221274f
comparison
equal deleted inserted replaced
20601:97249de6bbfa 20602:e8566ea47491
988 ;; temporarily remove vc-find-file-hook, so that 988 ;; temporarily remove vc-find-file-hook, so that
989 ;; we don't lose the properties 989 ;; we don't lose the properties
990 (remove-hook 'find-file-hooks 'vc-find-file-hook) 990 (remove-hook 'find-file-hooks 'vc-find-file-hook)
991 (vc-revert-buffer1 t noquery) 991 (vc-revert-buffer1 t noquery)
992 (add-hook 'find-file-hooks 'vc-find-file-hook) 992 (add-hook 'find-file-hooks 'vc-find-file-hook)
993 (and view-read-only
994 (if (file-writable-p file)
995 (and view-mode
996 (let ((view-old-buffer-read-only nil))
997 (view-mode-exit)))
998 (and (not view-mode)
999 (not (eq (get major-mode 'mode-class) 'special))
1000 (view-mode-enter))))
993 (vc-mode-line buffer-file-name)) 1001 (vc-mode-line buffer-file-name))
994 (kill-buffer (current-buffer))))) 1002 (kill-buffer (current-buffer)))))
995 1003
996 (defun vc-resynch-buffer (file &optional keep noquery) 1004 (defun vc-resynch-buffer (file &optional keep noquery)
997 ;; if FILE is currently visited, resynch its buffer 1005 ;; if FILE is currently visited, resynch its buffer