Karthik Chikmagalur <[email protected]> writes:

> I'm working on org-latex-preview actively this week, so even incremental
> feedback will be helpful as I can get started on it.

- org-async-call does not document its return value, while it appears to
  be meaningfully returned
- (or (assq 'read-process-output-max process-variables) read-process-output-max)
  is not consistent with the docstring. The docstring hard-codes 65536
- (format "org-async-%d" (cl-incf org-async--counter))
  Why not just gensym?

(apply #'start-process
                           (format "org-async-%s-%d"
                                   (car proc) (cl-incf org-async--counter))
                           buffer proc)
but the docstring says
"...a list run using `start-process' with the car as the command and the cdr
 as the arguments."
Nothing about BUFFER.

> (when-let ((proc-info (alist-get process org-async--stack)))

when-let*

> (proc-buf (if (consp buffer-val) (cdr buffer-val) buffer-val))

The fact the :buffer can be a cons is not documented in
`org-async--stack' and `org-async--wait-queue'.

> (setq org-async--stack
>             (delq (assq process org-async--stack) org-async--stack))
>       ;; Ensure that any filter is called on the final output
>       ;; prior to the callbacks.
>       (while (accept-process-output process))

`org-async--filter' will never be called in the above, because it starts
with (when-let ((proc-info (alist-get process org-async--stack)))

> (when (and org-async--wait-queue
>                (< org-async-process-limit (length org-async--stack)))
>       (apply #'org-async-call (pop org-async--wait-queue)))

I feel that I am missing something, but do you really mean that you call
waiting process *only* when we queue more processes than 
org-async-process-limit?

> The only runs when `org-async--monitor-scheduled' is nil, unless FORCE is set.
*This

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to