emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introducing 'unrecognized and 'ignored


From: Dan Nicolaescu
Subject: Re: Introducing 'unrecognized and 'ignored
Date: Sun, 20 Jan 2008 09:08:51 -0800

Stefan Monnier <address@hidden> writes:

  > > log, diff and annotate could all use this functionality.
  > 
  > Indeed, they could use `mode-line-process'.
  > 
  > As for on-the-fly updating rather than updating in the end.  It's been
  > on my todo list for PCL-CVS, but I never got to it.  It'd probably be
  > a good idea to add this from the beginning because it substantially
  > changes the way things work: you have to use a process filter rather than
  > a sentinel, you have to check whether the partial output you have is
  > enough to parse it reliably or whether we need to way for more output,
  > and you have to be able to update the display incrementally.

For doing incremental updates the needed changes for vc.el changes are
quite small. Just pass to the `dir-status' backend function another
function that is called when the asynchronous process finishes.
AFAICT vc-update-vc-status-buffer can work incrementally, the backend
just needs to call it with partial results when they are available.

Like this:

--- vc.el.~1.516.~      Fri Jan 18 15:05:37 2008
+++ vc.el               Sun Jan 20 08:52:48 2008
@@ -2627,6 +2627,11 @@
                  (vc-status-create-fileinfo (cdr entry) (car entry))))
     (ewoc-goto-node vc-status (ewoc-nth vc-status 0))))
 
+(defun vc-status-command-finished (successp buffer)
+  ;; This is called when dir-status finished processing the
+  ;; asynchronous output from the status command.
+  )
+
 (defun vc-status-refresh ()
   "Refresh the contents of the VC status buffer."
   (interactive)
@@ -2639,7 +2644,8 @@
     ;; the results.
     (vc-call-backend 
      backend 'dir-status default-directory 
-     #'vc-update-vc-status-buffer (current-buffer))))
+     #'vc-update-vc-status-buffer #'vc-status-command-finished
+     (current-buffer))))
 
 (defun vc-status-next-line (arg)
   "Go to the next line.

The backend changes to use a process filter are probably a bit more
complex, patches showing how to do that would be most welcome!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]