comparison lisp/vc-hooks.el @ 94540:55cb4c49dc98

The day wehen vc-toggle-ready-only was a good idea is long gone.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Fri, 02 May 2008 07:12:59 +0000
parents 2a61c5f918a5
children 135f7ef84766
comparison
equal deleted inserted replaced
94539:fee32a11924d 94540:55cb4c49dc98
677 677
678 (defun vc-toggle-read-only (&optional verbose) 678 (defun vc-toggle-read-only (&optional verbose)
679 "Change read-only status of current buffer, perhaps via version control. 679 "Change read-only status of current buffer, perhaps via version control.
680 680
681 If the buffer is visiting a file registered with version control, 681 If the buffer is visiting a file registered with version control,
682 then check the file in or out. Otherwise, just change the read-only flag 682 throw an error, because this is not a safe or really meaningful operation
683 of the buffer. 683 on any version-control system newer than RCS.
684 With prefix argument, ask for version number to check in or check out. 684
685 Check-out of a specified version number does not lock the file; 685 Otherwise, just change the read-only flag of the buffer.
686 to do that, use this command a second time with no argument. 686
687 687 If you bind this function to \\[toggle-read-only], then Emacs
688 If you bind this function to \\[toggle-read-only], then Emacs checks files 688 will properly intercept all attempts to toggle the read-only flag
689 in or out whenever you toggle the read-only flag." 689 on version-controlled buffer."
690 (interactive "P") 690 (interactive "P")
691 (if (or (and (boundp 'vc-dired-mode) vc-dired-mode) 691 (if (vc-backend buffer-file-name)
692 ;; use boundp because vc.el might not be loaded 692 (error "Toggling the readability of a version controlled file is likely to wreak havoc.")
693 (vc-backend buffer-file-name))
694 (vc-next-action verbose)
695 (toggle-read-only))) 693 (toggle-read-only)))
696 694
697 (defun vc-default-make-version-backups-p (backend file) 695 (defun vc-default-make-version-backups-p (backend file)
698 "Return non-nil if unmodified versions should be backed up locally. 696 "Return non-nil if unmodified versions should be backed up locally.
699 The default is to switch off this feature." 697 The default is to switch off this feature."