branch: elpa/helm
commit 13e48dcebeb34bdae84d9ac3b3c9ee66ea01d93f
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Restore commit d69a7da8
    
    Exit async processes softly when reaching limit
    
    and notify process limit is reached to allow sentinels to work
    correctly in such cases.
    
    This is passed to processes with the symbol 'reach-limit which can now
    be used in sentinels.
---
 helm-core.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 3ba0413a54..a3675f9130 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -5569,7 +5569,8 @@ This will work only in Emacs-26+, i.e. Emacs versions 
that have
                          source))
     (cl-incf (cdr (assq 'item-count source)))
     (when (>= (assoc-default 'item-count source) limit)
-      (helm-kill-async-process process)
+      (process-put process 'reach-limit t)
+      (helm-kill-async-process process 'kill-process)
       (helm-log-run-hook "helm-output-filter--process-source"
                          'helm-async-outer-limit-hook)
       (cl-return))))
@@ -5648,10 +5649,10 @@ function."
     (helm-kill-async-process (caar helm-async-processes))
     (setq helm-async-processes (cdr helm-async-processes))))
 
-(defun helm-kill-async-process (process)
+(cl-defun helm-kill-async-process (process &optional (kill-fn 'delete-process))
   "Stop output from `helm-output-filter' and kill associated PROCESS."
-  (set-process-filter process nil)
-  (delete-process process))
+  (set-process-filter process t)
+  (funcall kill-fn process))
 
 
 ;;; Actions

Reply via email to