diff options
| author | Richard M. Stallman | 1994-12-15 16:38:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-15 16:38:05 +0000 |
| commit | c844616ca64344a4f414c0717f1ce06fb4305b0b (patch) | |
| tree | e979f56f3b97bdd82bfbf2902f92466ed585ebb9 | |
| parent | e547d71e2cfd9d8e95a044c06ceb1db8fb3a3fee (diff) | |
| download | emacs-c844616ca64344a4f414c0717f1ce06fb4305b0b.tar.gz emacs-c844616ca64344a4f414c0717f1ce06fb4305b0b.zip | |
(vc-toggle-read-only): Accept prefix arg
and pass it along to vc-next-action.
| -rw-r--r-- | lisp/vc-hooks.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 23faab08947..6780f3ad703 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -161,14 +161,15 @@ Otherwise, not displayed.") | |||
| 161 | (vc-file-setprop file 'vc-name (car name-and-type)) | 161 | (vc-file-setprop file 'vc-name (car name-and-type)) |
| 162 | (vc-file-setprop file 'vc-backend (cdr name-and-type)))))))) | 162 | (vc-file-setprop file 'vc-backend (cdr name-and-type)))))))) |
| 163 | 163 | ||
| 164 | (defun vc-toggle-read-only () | 164 | (defun vc-toggle-read-only (&optional verbose) |
| 165 | "Change read-only status of current buffer, perhaps via version control. | 165 | "Change read-only status of current buffer, perhaps via version control. |
| 166 | If the buffer is visiting a file registered with version control, | 166 | If the buffer is visiting a file registered with version control, |
| 167 | then check the file in or out. Otherwise, just change the read-only flag | 167 | then check the file in or out. Otherwise, just change the read-only flag |
| 168 | of the buffer." | 168 | of the buffer. |
| 169 | (interactive) | 169 | If you provide a prefix argument, we pass it on to `vc-next-action'." |
| 170 | (interactive "P") | ||
| 170 | (if (vc-backend-deduce (buffer-file-name)) | 171 | (if (vc-backend-deduce (buffer-file-name)) |
| 171 | (vc-next-action nil) | 172 | (vc-next-action verbose) |
| 172 | (toggle-read-only))) | 173 | (toggle-read-only))) |
| 173 | (define-key global-map "\C-x\C-q" 'vc-toggle-read-only) | 174 | (define-key global-map "\C-x\C-q" 'vc-toggle-read-only) |
| 174 | 175 | ||