branch: elpa/helm
commit 5ffb322b907f1f9e5b24a327ab81bd0af8d16f9f
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Fix #2741 - error when quitting helm grep ag
    
    It seems that on MacOS delete-process behave differently according to
    the value of process-connection-type.  When it is non nil (pty) it seems
    delete-process behave like if the call was interactive and delete the
    process-buffer which is helm-buffer, then when the sentinel is called
    the helm-window doesn't exists anymore and we have an error with
    (select-window nil).
    
    Binding process-connection-type to nil seems to fix the issue.
---
 helm-grep.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/helm-grep.el b/helm-grep.el
index 97e5cc073a5..014937f4eff 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -1651,7 +1651,10 @@ returns if available with current AG version."
                        (encode-coding-string directory locale-coding-system))
                    type))
         (start-time (float-time))
-        (proc-name (helm-grep--ag-command)))
+        (proc-name (helm-grep--ag-command))
+        ;; Fix error in MacOS with process-buffer deleted resulting in a nil
+        ;; helm-window (with-helm-window) in sentinel see issue#2741.
+        process-connection-type)
     (set (make-local-variable 'helm-grep-last-cmd-line) cmd-line)
     (helm-log "helm-grep-ag-init" "Starting %s process in directory `%s'"
               proc-name directory)

Reply via email to