aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEric S. Raymond <[email protected]>2008-05-02 07:12:59 +0000
committerEric S. Raymond <[email protected]>2008-05-02 07:12:59 +0000
commit25e94278c3e592422f67404b75c9997a68f6b797 (patch)
tree6cb5e82bf3aab93b5843df1a262bb3d2ce2f5f43 /lisp
parent0a29940833c0e8ef917be460430558ddeda03058 (diff)
The day wehen vc-toggle-ready-only was a good idea is long gone.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/vc-hooks.el22
2 files changed, 13 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 12d862bcc4..c53e77bddc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,9 @@
to prettify-state-info, in preparation for ripping out dired mode.
* vc-bzr.el (vc-bzr-dired-state-info): Change name of primitive
to prettify-state-info, in preparation for ripping out dired mode.
+ * vc-hooks.el (vc-toggle-read-only): Throw an error when a user
+ tries this on a version-controlled buffer. it will do useless or
+ actively bad things on any version control system newer than RCS.
2008-05-02 Dan Nicolaescu <[email protected]>
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 3c17c816e5..5b513c46c4 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -679,19 +679,17 @@ this function."
"Change read-only status of current buffer, perhaps via version control.
If the buffer is visiting a file registered with version control,
-then check the file in or out. Otherwise, just change the read-only flag
-of the buffer.
-With prefix argument, ask for version number to check in or check out.
-Check-out of a specified version number does not lock the file;
-to do that, use this command a second time with no argument.
-
-If you bind this function to \\[toggle-read-only], then Emacs checks files
-in or out whenever you toggle the read-only flag."
+throw an error, because this is not a safe or really meaningful operation
+on any version-control system newer than RCS.
+
+Otherwise, just change the read-only flag of the buffer.
+
+If you bind this function to \\[toggle-read-only], then Emacs
+will properly intercept all attempts to toggle the read-only flag
+on version-controlled buffer."
(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)
+ (if (vc-backend buffer-file-name)
+ (error "Toggling the readability of a version controlled file is likely to wreak havoc.")
(toggle-read-only)))
(defun vc-default-make-version-backups-p (backend file)