aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Julliard2008-04-14 15:22:47 +0000
committerAlexandre Julliard2008-04-14 15:22:47 +0000
commit1f3e0cb5d235369585c9bb1c5fcca0b52d2ef7fd (patch)
tree935b1676f74c8ec56cb1e5430f80fb54f4634d4a
parent888932153ba7b6984deef265e72d624ef9faaa92 (diff)
downloademacs-1f3e0cb5d235369585c9bb1c5fcca0b52d2ef7fd.tar.gz
emacs-1f3e0cb5d235369585c9bb1c5fcca0b52d2ef7fd.zip
(vc-status-update): Undo the previous revert.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc.el51
2 files changed, 31 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 90090c66784..07babb88d4b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12008-04-14 Alexandre Julliard <julliard@winehq.org>
2
3 * vc.el (vc-status-update): Undo the previous revert.
4
12008-04-14 Stefan Monnier <monnier@iro.umontreal.ca> 52008-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * minibuffer.el (completion-table-with-terminator): Those completions 7 * minibuffer.el (completion-table-with-terminator): Those completions
diff --git a/lisp/vc.el b/lisp/vc.el
index 5435c53e621..e946191a0e0 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -3011,8 +3011,9 @@ specific headers."
3011 3011
3012(put 'vc-status-mode 'mode-class 'special) 3012(put 'vc-status-mode 'mode-class 'special)
3013 3013
3014(defun vc-status-update (entries buffer) 3014(defun vc-status-update (entries buffer &optional noinsert)
3015 "Update BUFFER's ewoc from the list of ENTRIES." 3015 "Update BUFFER's ewoc from the list of ENTRIES.
3016If NOINSERT, ignore elements on ENTRIES which are not in the ewoc."
3016 ;; Add ENTRIES to the vc-status buffer BUFFER. 3017 ;; Add ENTRIES to the vc-status buffer BUFFER.
3017 (with-current-buffer buffer 3018 (with-current-buffer buffer
3018 ;; Insert the entries sorted by name into the ewoc. 3019 ;; Insert the entries sorted by name into the ewoc.
@@ -3021,28 +3022,30 @@ specific headers."
3021 (setq entries (sort entries 3022 (setq entries (sort entries
3022 (lambda (entry1 entry2) 3023 (lambda (entry1 entry2)
3023 (string-lessp (car entry1) (car entry2))))) 3024 (string-lessp (car entry1) (car entry2)))))
3024 (let ((entry (pop entries)) 3025 (let ((entry (car entries))
3025 (node (ewoc-nth vc-status 0))) 3026 (node (ewoc-nth vc-status 0)))
3026 (while entry 3027 (while (and entry node)
3027 (let ((file (car entry))) 3028 (let ((entryfile (car entry))
3028 ;; Note: we always keep node pointing to the last inserted entry 3029 (nodefile (vc-status-fileinfo->name (ewoc-data node))))
3029 ;; in order to catch duplicates in the entries list 3030 (cond
3030 (cond ((not node) 3031 ((string-lessp nodefile entryfile)
3031 (setq node (ewoc-enter-last vc-status 3032 (setq node (ewoc-next vc-status node)))
3032 (apply 'vc-status-create-fileinfo entry))) 3033 ((string-lessp nodefile entryfile)
3033 (setq entry (pop entries))) 3034 (unless noinsert
3034 ((string-lessp (vc-status-fileinfo->name (ewoc-data node)) file) 3035 (ewoc-enter-before vc-status node
3035 (setq node (ewoc-next vc-status node))) 3036 (apply 'vc-status-create-fileinfo entry)))
3036 ((string-equal (vc-status-fileinfo->name (ewoc-data node)) file) 3037 (setq entries (cdr entries) entry (car entries)))
3037 (setf (vc-status-fileinfo->state (ewoc-data node)) (nth 1 entry)) 3038 (t
3038 (setf (vc-status-fileinfo->extra (ewoc-data node)) (nth 2 entry)) 3039 (setf (vc-status-fileinfo->state (ewoc-data node)) (nth 1 entry))
3039 (setf (vc-status-fileinfo->needs-update (ewoc-data node)) nil) 3040 (setf (vc-status-fileinfo->extra (ewoc-data node)) (nth 2 entry))
3040 (ewoc-invalidate vc-status node) 3041 (ewoc-invalidate vc-status node)
3041 (setq entry (pop entries))) 3042 (setq entries (cdr entries) entry (car entries))
3042 (t 3043 (setq node (ewoc-next vc-status node))))))
3043 (setq node (ewoc-enter-before vc-status node 3044 (unless (or node noinsert)
3044 (apply 'vc-status-create-fileinfo entry))) 3045 ;; We're past the last node, all remaining entries go to the end.
3045 (setq entry (pop entries))))))))) 3046 (while entries
3047 (ewoc-enter-last vc-status
3048 (apply 'vc-status-create-fileinfo (pop entries))))))))
3046 3049
3047(defun vc-status-busy () 3050(defun vc-status-busy ()
3048 (and (buffer-live-p vc-status-process-buffer) 3051 (and (buffer-live-p vc-status-process-buffer)