branch: elpa/helm commit d69a7da810c8feaa56da0e8518a892308643cc91 Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
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 ebf75558ec..5507c7f0f2 100644 --- a/helm-core.el +++ b/helm-core.el @@ -5581,7 +5581,8 @@ This will work only in Emacs-26+, i.e. Emacs versions that have (and ml (put-text-property start (point) 'helm-multiline t)) (cl-incf (cdr (assq 'item-count source))) (when (>= (cdr (assq '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)))))) @@ -5633,10 +5634,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