comparison lisp/vc.el @ 94085:7601144a671f

(vc-status-update): Set needs-update. (vc-status-refresh): ¦Ç-reduce.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 14 Apr 2008 16:36:32 +0000
parents 603bcf433ab2
children e8b7cae31fe3
comparison
equal deleted inserted replaced
94084:603bcf433ab2 94085:7601144a671f
3036 (apply 'vc-status-create-fileinfo entry))) 3036 (apply 'vc-status-create-fileinfo entry)))
3037 (setq entries (cdr entries) entry (car entries))) 3037 (setq entries (cdr entries) entry (car entries)))
3038 (t 3038 (t
3039 (setf (vc-status-fileinfo->state (ewoc-data node)) (nth 1 entry)) 3039 (setf (vc-status-fileinfo->state (ewoc-data node)) (nth 1 entry))
3040 (setf (vc-status-fileinfo->extra (ewoc-data node)) (nth 2 entry)) 3040 (setf (vc-status-fileinfo->extra (ewoc-data node)) (nth 2 entry))
3041 (setf (vc-status-fileinfo->needs-update (ewoc-data node)) nil)
3041 (ewoc-invalidate vc-status node) 3042 (ewoc-invalidate vc-status node)
3042 (setq entries (cdr entries) entry (car entries)) 3043 (setq entries (cdr entries) entry (car entries))
3043 (setq node (ewoc-next vc-status node)))))) 3044 (setq node (ewoc-next vc-status node))))))
3044 (unless (or node noinsert) 3045 (unless (or node noinsert)
3045 ;; We're past the last node, all remaining entries go to the end. 3046 ;; We're past the last node, all remaining entries go to the end.
3105 ;; takes too long. 3106 ;; takes too long.
3106 (unless (buffer-live-p vc-status-process-buffer) 3107 (unless (buffer-live-p vc-status-process-buffer)
3107 (setq vc-status-process-buffer 3108 (setq vc-status-process-buffer
3108 (generate-new-buffer (format " *VC-%s* tmp status" backend)))) 3109 (generate-new-buffer (format " *VC-%s* tmp status" backend))))
3109 ;; set the needs-update flag on all entries 3110 ;; set the needs-update flag on all entries
3110 (ewoc-map (lambda (info) (setf (vc-status-fileinfo->needs-update info) t) nil) vc-status) 3111 (ewoc-map (lambda (info) (setf (vc-status-fileinfo->needs-update info) t) nil)
3112 vc-status)
3111 (lexical-let ((buffer (current-buffer))) 3113 (lexical-let ((buffer (current-buffer)))
3112 (with-current-buffer vc-status-process-buffer 3114 (with-current-buffer vc-status-process-buffer
3113 (cd def-dir) 3115 (cd def-dir)
3114 (erase-buffer) 3116 (erase-buffer)
3115 (vc-call-backend 3117 (vc-call-backend
3120 ;; the asynchronous process. 3122 ;; the asynchronous process.
3121 (with-current-buffer buffer 3123 (with-current-buffer buffer
3122 (vc-status-update entries buffer) 3124 (vc-status-update entries buffer)
3123 (unless more-to-come 3125 (unless more-to-come
3124 (let ((remaining 3126 (let ((remaining
3125 (ewoc-collect vc-status 3127 (ewoc-collect
3126 (lambda (info) (vc-status-fileinfo->needs-update info))))) 3128 vc-status 'vc-status-fileinfo->needs-update)))
3127 (if remaining 3129 (if remaining
3128 (vc-status-refresh-files 3130 (vc-status-refresh-files
3129 (mapcar (lambda (info) (vc-status-fileinfo->name info)) remaining) 3131 (mapcar 'vc-status-fileinfo->name remaining)
3130 'up-to-date) 3132 'up-to-date)
3131 (setq mode-line-process nil)))))))))))) 3133 (setq mode-line-process nil))))))))))))
3132 3134
3133 (defun vc-status-kill-dir-status-process () 3135 (defun vc-status-kill-dir-status-process ()
3134 "Kill the temporary buffer and associated process." 3136 "Kill the temporary buffer and associated process."