173 |
(defun cvs-reread-cvsrc () |
(defun cvs-reread-cvsrc () |
174 |
"Reset the default arguments to those in the `cvs-cvsrc-file'." |
"Reset the default arguments to those in the `cvs-cvsrc-file'." |
175 |
(interactive) |
(interactive) |
176 |
(let ((cvsrc (cvs-file-to-string cvs-cvsrc-file))) |
(condition-case nil |
177 |
(when (stringp cvsrc) |
(with-temp-buffer |
178 |
;; fetch the values |
(insert-file-contents cvs-cvsrc-file) |
179 |
(dolist (cmd '("cvs" "checkout" "status" "log" "diff" "tag" |
;; fetch the values |
180 |
"add" "commit" "remove" "update")) |
(dolist (cmd '("cvs" "checkout" "status" "log" "diff" "tag" |
181 |
(let* ((sym (intern (concat "cvs-" cmd "-flags"))) |
"add" "commit" "remove" "update")) |
182 |
(val (when (string-match (concat "^" cmd "\\s-\\(.*\\)$") cvsrc) |
(goto-char (point-min)) |
183 |
(cvs-string->strings (match-string 1 cvsrc))))) |
(let* ((sym (intern (concat "cvs-" cmd "-flags"))) |
184 |
(cvs-flags-set sym 0 val))) |
(val (when (re-search-forward |
185 |
;; ensure that cvs doesn't have -q or -Q |
(concat "^" cmd "\\s-+\\(.*\\)$") nil t) |
186 |
(cvs-flags-set 'cvs-cvs-flags 0 |
(cvs-string->strings (match-string 1))))) |
187 |
(cons "-f" |
(cvs-flags-set sym 0 val))) |
188 |
(cdr (cvs-partition |
;; ensure that cvs doesn't have -q or -Q |
189 |
(lambda (x) (member x '("-q" "-Q"))) |
(cvs-flags-set 'cvs-cvs-flags 0 |
190 |
(cvs-flags-query 'cvs-cvs-flags |
(cons "-f" |
191 |
nil 'noquery)))))))) |
(cdr (cvs-partition |
192 |
|
(lambda (x) (member x '("-q" "-Q"))) |
193 |
|
(cvs-flags-query 'cvs-cvs-flags |
194 |
|
nil 'noquery)))))) |
195 |
|
(file-error nil))) |
196 |
|
|
197 |
;; initialize to cvsrc's default values |
;; initialize to cvsrc's default values |
198 |
(cvs-reread-cvsrc) |
(cvs-reread-cvsrc) |