From cfed7bbc79b495115eff0825d7ee77a8f72ec4e1 Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 4 Jan 2023 17:57:53 +0800 Subject: [PATCH] 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. --- lisp/org-macs.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 03fe400ca..b07c6208e 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -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