I think I'm going to try writing an incremental parser for the dvc-log output. The new git-log code, in particular, feels unacceptably slow.
The current idea that I'm thinking of is as follows.
Modify dvc-run-dvc-async to take new key :started that specifies some
function to call immediately after starting the process and setting up
its parameters. If this key is not given, fall back to the old
behavior.
The :started function will be called only once by dvc-run-dvc-async.
- It will be passed args: output, error, arguments.
- It must check to see whether a buffer is alive before using it.
- It must check to see whether the current process is alive, and
not call itself any more when the process is dead.
- It must deal the case of not having any output in the buffer, or
having no new changes in the buffer.
- It should keep track of the position of the last process mark, so as
to determine new output.
- It should set up a call to itself via run-at-time, which is triggered
after a certain number of seconds. I'm going to go with 0.3 for the
case of dvc-log for git.
- It should be smart about determining whether a complete entry is
present in the buffer. One way of doing this is to move to the
process mark, re-search-backward by one start delimiter, and only
look at the output between the former value of process mark and
point.
- Its state variables may be either generated symbols via (capture ...)
statements in dvc-capturing-lambda, or permanent buffer-local
variables which are defined outside of the function with a proper
prefix, or can be &optional arguments that come after the required
arguments (these arguments are passed to the next instance via
run-at-time).
- If any :finished, :killed, or :error functions are given, take into
account the fact that they could be called either before or after the
last periodic call of the :started function.
What do others think?
--
Michael Olson -- FSF Associate Member #652 |
http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net | /` |\ | | |
Sysadmin -- Hobbies: Lisp, GP2X, HCoop | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
pgpYpUemJH7HH.pgp
Description: PGP signature
_______________________________________________ Dvc-dev mailing list [email protected] https://mail.gna.org/listinfo/dvc-dev
