[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc-hooks.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc-hooks.el |
Date: |
Wed, 07 May 2003 13:20:29 -0400 |
Index: emacs/lisp/vc-hooks.el
diff -c emacs/lisp/vc-hooks.el:1.147 emacs/lisp/vc-hooks.el:1.148
*** emacs/lisp/vc-hooks.el:1.147 Wed Feb 5 18:14:06 2003
--- emacs/lisp/vc-hooks.el Wed May 7 13:20:29 2003
***************
*** 5,11 ****
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <address@hidden>
! ;; $Id: vc-hooks.el,v 1.147 2003/02/05 23:14:06 lektu Exp $
;; This file is part of GNU Emacs.
--- 5,11 ----
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <address@hidden>
! ;; $Id: vc-hooks.el,v 1.148 2003/05/07 17:20:29 monnier Exp $
;; This file is part of GNU Emacs.
***************
*** 45,51 ****
(defvar vc-header-alist ())
(make-obsolete-variable 'vc-header-alist 'vc-BACKEND-header)
! (defcustom vc-handled-backends '(RCS CVS SCCS)
"*List of version control backends for which VC will be used.
Entries in this list will be tried in order to determine whether a
file is under that sort of version control.
--- 45,51 ----
(defvar vc-header-alist ())
(make-obsolete-variable 'vc-header-alist 'vc-BACKEND-header)
! (defcustom vc-handled-backends '(RCS CVS SVN MCVS SCCS)
"*List of version control backends for which VC will be used.
Entries in this list will be tried in order to determine whether a
file is under that sort of version control.
***************
*** 281,287 ****
(defun vc-backend (file)
"Return the version control type of FILE, nil if it is not registered."
;; `file' can be nil in several places (typically due to the use of
! ;; code like (vc-backend (buffer-file-name))).
(when (stringp file)
(let ((property (vc-file-getprop file 'vc-backend)))
;; Note that internally, Emacs remembers unregistered
--- 281,287 ----
(defun vc-backend (file)
"Return the version control type of FILE, nil if it is not registered."
;; `file' can be nil in several places (typically due to the use of
! ;; code like (vc-backend buffer-file-name)).
(when (stringp file)
(let ((property (vc-file-getprop file 'vc-backend)))
;; Note that internally, Emacs remembers unregistered
***************
*** 487,493 ****
(interactive "P")
(if (or (and (boundp 'vc-dired-mode) vc-dired-mode)
;; use boundp because vc.el might not be loaded
! (vc-backend (buffer-file-name)))
(vc-next-action verbose)
(toggle-read-only)))
--- 487,493 ----
(interactive "P")
(if (or (and (boundp 'vc-dired-mode) vc-dired-mode)
;; use boundp because vc.el might not be loaded
! (vc-backend buffer-file-name))
(vc-next-action verbose)
(toggle-read-only)))
***************
*** 533,539 ****
;; If the file on disk is still in sync with the repository,
;; and version backups should be made, copy the file to
;; another name. This enables local diffs and local reverting.
! (let ((file (buffer-file-name)))
(and (vc-backend file)
(vc-up-to-date-p file)
(eq (vc-checkout-model file) 'implicit)
--- 533,539 ----
;; If the file on disk is still in sync with the repository,
;; and version backups should be made, copy the file to
;; another name. This enables local diffs and local reverting.
! (let ((file buffer-file-name))
(and (vc-backend file)
(vc-up-to-date-p file)
(eq (vc-checkout-model file) 'implicit)
***************
*** 545,551 ****
;; If the file in the current buffer is under version control,
;; up-to-date, and locking is not used for the file, set
;; the state to 'edited and redisplay the mode line.
! (let ((file (buffer-file-name)))
(and (vc-backend file)
(or (and (equal (vc-file-getprop file 'vc-checkout-time)
(nth 5 (file-attributes file)))
--- 545,551 ----
;; If the file in the current buffer is under version control,
;; up-to-date, and locking is not used for the file, set
;; the state to 'edited and redisplay the mode line.
! (let ((file buffer-file-name))
(and (vc-backend file)
(or (and (equal (vc-file-getprop file 'vc-checkout-time)
(nth 5 (file-attributes file)))
***************
*** 568,595 ****
The value is set in the current buffer, which should be the buffer
visiting FILE."
(interactive (list buffer-file-name))
! (if (not (vc-backend file))
! (setq vc-mode nil)
! (setq vc-mode (concat " " (if vc-display-status
! (vc-call mode-line-string file)
! (symbol-name (vc-backend file)))))
! ;; If the file is locked by some other user, make
! ;; the buffer read-only. Like this, even root
! ;; cannot modify a file that someone else has locked.
! (and (equal file (buffer-file-name))
! (stringp (vc-state file))
! (setq buffer-read-only t))
! ;; If the user is root, and the file is not owner-writable,
! ;; then pretend that we can't write it
! ;; even though we can (because root can write anything).
! ;; This way, even root cannot modify a file that isn't locked.
! (and (equal file (buffer-file-name))
! (not buffer-read-only)
! (zerop (user-real-uid))
! (zerop (logand (file-modes (buffer-file-name)) 128))
! (setq buffer-read-only t)))
! (force-mode-line-update)
! (vc-backend file))
(defun vc-default-mode-line-string (backend file)
"Return string for placement in modeline by `vc-mode-line' for FILE.
--- 568,596 ----
The value is set in the current buffer, which should be the buffer
visiting FILE."
(interactive (list buffer-file-name))
! (let ((backend (vc-backend file)))
! (if (not backend)
! (setq vc-mode nil)
! (setq vc-mode (concat " " (if vc-display-status
! (vc-call mode-line-string file)
! (symbol-name backend))))
! ;; If the file is locked by some other user, make
! ;; the buffer read-only. Like this, even root
! ;; cannot modify a file that someone else has locked.
! (and (equal file buffer-file-name)
! (stringp (vc-state file))
! (setq buffer-read-only t))
! ;; If the user is root, and the file is not owner-writable,
! ;; then pretend that we can't write it
! ;; even though we can (because root can write anything).
! ;; This way, even root cannot modify a file that isn't locked.
! (and (equal file buffer-file-name)
! (not buffer-read-only)
! (zerop (user-real-uid))
! (zerop (logand (file-modes buffer-file-name) 128))
! (setq buffer-read-only t)))
! (force-mode-line-update)
! backend))
(defun vc-default-mode-line-string (backend file)
"Return string for placement in modeline by `vc-mode-line' for FILE.
***************
*** 698,705 ****
(defun vc-kill-buffer-hook ()
"Discard VC info about a file when we kill its buffer."
! (if (buffer-file-name)
! (vc-file-clearprops (buffer-file-name))))
(add-hook 'kill-buffer-hook 'vc-kill-buffer-hook)
--- 699,706 ----
(defun vc-kill-buffer-hook ()
"Discard VC info about a file when we kill its buffer."
! (if buffer-file-name
! (vc-file-clearprops buffer-file-name)))
(add-hook 'kill-buffer-hook 'vc-kill-buffer-hook)
- [Emacs-diffs] Changes to emacs/lisp/vc-hooks.el,
Stefan Monnier <=