org-macs: Ensure that filter run before callbacks

* lisp/org-macs.el (org-async--cleanup-process): Run
`accept-process-output` until no further output is fetched on process
exit, so we can assume that the callbacks are run after all filter
invocations.
This commit is contained in:
TEC 2023-01-04 17:57:53 +08:00
parent 2b36e6f5d3
commit cfed7bbc79
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 3 additions and 0 deletions

View File

@ -542,6 +542,9 @@ Otherwise, the failure callback is run."
(proc-buf (if (consp buffer-val) (cdr buffer-val) buffer-val)))
(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--execute-callback
(plist-get
proc-info