diff options
| author | Xue Fuqiao | 2013-12-26 06:24:37 +0800 |
|---|---|---|
| committer | Xue Fuqiao | 2013-12-26 06:24:37 +0800 |
| commit | 3bc1e1880f232ccaea7c35a0c51bac61df9ac23c (patch) | |
| tree | 5a4b6886264f497bb8889ae1cd8f876ad96f0b42 | |
| parent | 1139b0be8b1bc0d63420c69aaec0e2b0cb19d71d (diff) | |
| download | emacs-3bc1e1880f232ccaea7c35a0c51bac61df9ac23c.tar.gz emacs-3bc1e1880f232ccaea7c35a0c51bac61df9ac23c.zip | |
Some fixes for vc-ignore (Bug#15754).
Inspired by Andreas Politz and Dmitry Gutov.
| -rw-r--r-- | lisp/vc/vc.el | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0ef13bfc61d..93778babaaa 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -1343,23 +1343,33 @@ first backend that could register the file is used." | |||
| 1343 | (let ((vc-handled-backends (list backend))) | 1343 | (let ((vc-handled-backends (list backend))) |
| 1344 | (call-interactively 'vc-register))) | 1344 | (call-interactively 'vc-register))) |
| 1345 | 1345 | ||
| 1346 | (defun vc-ignore (file &optional directory) | 1346 | (defun vc-ignore (file &optional directory remove) |
| 1347 | "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). | 1347 | "Ignore FILE under the VCS of DIRECTORY. |
| 1348 | FILE is a file wildcard. | 1348 | |
| 1349 | When called interactively and with a prefix argument, remove FILE | 1349 | Normally, FILE is a wildcard specification that matches the files |
| 1350 | from ignored files. | 1350 | to be ignored. When REMOVE is non-nil, remove FILE from the list |
| 1351 | When called from Lisp code, if DIRECTORY is non-nil, the | 1351 | of ignored files. |
| 1352 | repository to use will be deduced by DIRECTORY." | 1352 | |
| 1353 | DIRECTORY defaults to `default-directory' and is used to | ||
| 1354 | determine the responsible VC backend. | ||
| 1355 | |||
| 1356 | When called interactively, prompt for a FILE to ignore, unless a | ||
| 1357 | prefix argument is given, in which case prompt for a file FILE to | ||
| 1358 | remove from the list of ignored files." | ||
| 1353 | (interactive | 1359 | (interactive |
| 1354 | (list (read-file-name "The file to ignore: ") | 1360 | (list |
| 1355 | (completing-read | 1361 | (if (not current-prefix-arg) |
| 1356 | "The file to remove: " | 1362 | (read-file-name "File to ignore: ") |
| 1357 | (vc-call-backend | 1363 | (completing-read |
| 1358 | (vc-backend default-directory) | 1364 | "File to remove: " |
| 1359 | 'ignore-completion-table default-directory)))) | 1365 | (vc-call-backend |
| 1366 | (or (vc-responsible-backend default-directory) | ||
| 1367 | (error "Unknown backend")) | ||
| 1368 | 'ignore-completion-table default-directory))) | ||
| 1369 | nil current-prefix-arg)) | ||
| 1360 | (let* ((directory (or directory default-directory)) | 1370 | (let* ((directory (or directory default-directory)) |
| 1361 | (backend (vc-backend default-directory)) | 1371 | (backend (or (vc-responsible-backend default-directory) |
| 1362 | (remove current-prefix-arg)) | 1372 | (error "Unknown backend")))) |
| 1363 | (vc-call-backend backend 'ignore file directory remove))) | 1373 | (vc-call-backend backend 'ignore file directory remove))) |
| 1364 | 1374 | ||
| 1365 | (defun vc-default-ignore (backend file &optional directory remove) | 1375 | (defun vc-default-ignore (backend file &optional directory remove) |