diff options
| author | Stefan Monnier | 2003-05-14 15:02:05 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-14 15:02:05 +0000 |
| commit | 1d2b9bbaf9f72541c4d3e3087c7d572980974391 (patch) | |
| tree | 98b9ff7fea00990561c5fa7871ac9dd6aff55915 | |
| parent | 0ded0280ab0255cbad50008c2aea69eadd23bd15 (diff) | |
| download | emacs-1d2b9bbaf9f72541c4d3e3087c7d572980974391.tar.gz emacs-1d2b9bbaf9f72541c4d3e3087c7d572980974391.zip | |
(cvs-append-to-ignore): New arg `old-dir'.
(cvs-mode-ignore): Use it.
| -rw-r--r-- | lisp/pcvs.el | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/pcvs.el b/lisp/pcvs.el index 3b4e60ec03c..a15ecc5ccb8 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el | |||
| @@ -1861,24 +1861,27 @@ With a prefix argument, prompt for cvs flags." | |||
| 1861 | This command ignores files that are not flagged as `Unknown'." | 1861 | This command ignores files that are not flagged as `Unknown'." |
| 1862 | (interactive) | 1862 | (interactive) |
| 1863 | (dolist (fi (cvs-mode-marked 'ignore)) | 1863 | (dolist (fi (cvs-mode-marked 'ignore)) |
| 1864 | (cvs-append-to-ignore (cvs-fileinfo->dir fi) (cvs-fileinfo->file fi)) | 1864 | (cvs-append-to-ignore (cvs-fileinfo->dir fi) (cvs-fileinfo->file fi) |
| 1865 | (eq (cvs-fileinfo->subtype fi) 'NEW-DIR)) | ||
| 1865 | (setf (cvs-fileinfo->type fi) 'DEAD)) | 1866 | (setf (cvs-fileinfo->type fi) 'DEAD)) |
| 1866 | (cvs-cleanup-collection cvs-cookies nil nil nil)) | 1867 | (cvs-cleanup-collection cvs-cookies nil nil nil)) |
| 1867 | 1868 | ||
| 1868 | 1869 | ||
| 1869 | (defun cvs-append-to-ignore (dir str) | 1870 | (defun cvs-append-to-ignore (dir str &optional old-dir) |
| 1870 | "Add STR to the .cvsignore file in DIR." | 1871 | "Add STR to the .cvsignore file in DIR. |
| 1871 | (save-window-excursion | 1872 | If OLD-DIR is non-nil, then this is a directory that we don't want |
| 1872 | (set-buffer (find-file-noselect (expand-file-name ".cvsignore" dir))) | 1873 | to hear about anymore." |
| 1874 | (with-current-buffer | ||
| 1875 | (find-file-noselect (expand-file-name ".cvsignore" dir)) | ||
| 1873 | (when (ignore-errors | 1876 | (when (ignore-errors |
| 1874 | (and buffer-read-only | 1877 | (and buffer-read-only |
| 1875 | (eq 'CVS (vc-backend buffer-file-name)) | 1878 | (eq 'CVS (vc-backend buffer-file-name)) |
| 1876 | (not (vc-editable-p buffer-file-name)))) | 1879 | (not (vc-editable-p buffer-file-name)))) |
| 1877 | ;; CVSREAD=on special case | 1880 | ;; CVSREAD=on special case |
| 1878 | (vc-toggle-read-only)) | 1881 | (vc-checkout buffer-file-name t)) |
| 1879 | (goto-char (point-max)) | 1882 | (goto-char (point-max)) |
| 1880 | (unless (zerop (current-column)) (insert "\n")) | 1883 | (unless (bolp) (insert "\n")) |
| 1881 | (insert str "\n") | 1884 | (insert str (if old-dir "/\n" "\n")) |
| 1882 | (if cvs-sort-ignore-file (sort-lines nil (point-min) (point-max))) | 1885 | (if cvs-sort-ignore-file (sort-lines nil (point-min) (point-max))) |
| 1883 | (save-buffer))) | 1886 | (save-buffer))) |
| 1884 | 1887 | ||