comparison lisp/vc-hooks.el @ 46453:8a775aba60aa

Don't bind vc-toggle-read-only to C-x C-q. (vc-toggle-read-only): Explain in the doc string that users can bind this to C-x C-q. (vc-checkout-model): Change doc string to refer to vc-next-action, not vc-toggle-read-only.
author André Spiegel <spiegel@gnu.org>
date Tue, 16 Jul 2002 17:42:57 +0000
parents 2e33fd043708
children f8e6993503cf
comparison
equal deleted inserted replaced
46452:ac445c632354 46453:8a775aba60aa
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.138 2002/02/21 20:56:58 spiegel Exp $ 8 ;; $Id: vc-hooks.el,v 1.139 2002/02/28 13:09:36 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
309 309
310 'implicit FILE is always writeable, and checked out `implicitly' 310 'implicit FILE is always writeable, and checked out `implicitly'
311 when the user saves the first changes to the file. 311 when the user saves the first changes to the file.
312 312
313 'locking FILE is read-only if up-to-date; user must type 313 'locking FILE is read-only if up-to-date; user must type
314 \\[vc-toggle-read-only] before editing. Strict locking 314 \\[vc-next-action] before editing. Strict locking
315 is assumed. 315 is assumed.
316 316
317 'announce FILE is read-only if up-to-date; user must type 317 'announce FILE is read-only if up-to-date; user must type
318 \\[vc-toggle-read-only] before editing. But other users 318 \\[vc-next-action] before editing. But other users
319 may be editing at the same time." 319 may be editing at the same time."
320 (or (vc-file-getprop file 'vc-checkout-model) 320 (or (vc-file-getprop file 'vc-checkout-model)
321 (if (vc-backend file) 321 (if (vc-backend file)
322 (vc-file-setprop file 'vc-checkout-model 322 (vc-file-setprop file 'vc-checkout-model
323 (vc-call checkout-model file))))) 323 (vc-call checkout-model file)))))
451 (throw 'found trial)))) 451 (throw 'found trial))))
452 templates)))) 452 templates))))
453 453
454 (defun vc-toggle-read-only (&optional verbose) 454 (defun vc-toggle-read-only (&optional verbose)
455 "Change read-only status of current buffer, perhaps via version control. 455 "Change read-only status of current buffer, perhaps via version control.
456
456 If the buffer is visiting a file registered with version control, 457 If the buffer is visiting a file registered with version control,
457 then check the file in or out. Otherwise, just change the read-only flag 458 then check the file in or out. Otherwise, just change the read-only flag
458 of the buffer. 459 of the buffer.
459 With prefix argument, ask for version number to check in or check out. 460 With prefix argument, ask for version number to check in or check out.
460 Check-out of a specified version number does not lock the file; 461 Check-out of a specified version number does not lock the file;
461 to do that, use this command a second time with no argument." 462 to do that, use this command a second time with no argument.
463
464 If you bind this function to \\[toggle-read-only], then Emacs checks files
465 in or out whenever you toggle the read-only flag."
462 (interactive "P") 466 (interactive "P")
463 (if (or (and (boundp 'vc-dired-mode) vc-dired-mode) 467 (if (or (and (boundp 'vc-dired-mode) vc-dired-mode)
464 ;; use boundp because vc.el might not be loaded 468 ;; use boundp because vc.el might not be loaded
465 (vc-backend (buffer-file-name))) 469 (vc-backend (buffer-file-name)))
466 (vc-next-action verbose) 470 (vc-next-action verbose)
467 (toggle-read-only))) 471 (toggle-read-only)))
468 (define-key global-map "\C-x\C-q" 'vc-toggle-read-only)
469 472
470 (defun vc-default-make-version-backups-p (backend file) 473 (defun vc-default-make-version-backups-p (backend file)
471 "Return non-nil if unmodified versions should be backed up locally. 474 "Return non-nil if unmodified versions should be backed up locally.
472 The default is to switch off this feature." 475 The default is to switch off this feature."
473 nil) 476 nil)