Mercurial > emacs
comparison lisp/vc-hooks.el @ 10176:332014233a2c
(vc-toggle-read-only): Accept prefix arg
and pass it along to vc-next-action.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 15 Dec 1994 16:38:05 +0000 |
parents | ae7a27dc719d |
children | 540868154dc9 |
comparison
equal
deleted
inserted
replaced
10175:a52d1ab148f5 | 10176:332014233a2c |
---|---|
159 (if name-and-type | 159 (if name-and-type |
160 (progn | 160 (progn |
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 |
175 (defun vc-mode-line (file &optional label) | 176 (defun vc-mode-line (file &optional label) |
176 "Set `vc-mode' to display type of version control for FILE. | 177 "Set `vc-mode' to display type of version control for FILE. |