helm-dash icon indicating copy to clipboard operation
helm-dash copied to clipboard

When using helm from terminal emacs, typing too quickly may result in helm unexpectedly closing

Open mullikine opened this issue 3 years ago • 0 comments

This relates to the following issue in helm.

https://github.com/emacs-helm/helm/issues/2417

The issue is that helm-dash uses :candidates instead of :candidates-process. In terminal emacs, this will break because a C-g is generated by typing quickly as the terminal will hang while generating candidates with the external process.

(defun helm-dash--build-source (docset)
  "Build a Helm source for DOCSET."
  (lexical-let ((docset docset))
    (helm-build-sync-source (car docset)
      :action-transformer #'helm-dash-actions
      :candidates (lambda ()
                    (cl-loop for row in (helm-dash--run-query docset helm-pattern)
                             collect (helm-dash--candidate docset row)))
      :volatile t
      :persistent-help "View doc"
      :requires-pattern helm-dash-min-length)))

That would require some re-engineering. Alternatively, a inhibit-quit can be placed inside the lambda. This would fix it for terminal emacs.

Here is an example of the correct way to implement a source by using an emacs process.

https://github.com/emacs-helm/helm-notmuch/blob/97a01497e079a7b6505987e9feba6b603bbec288/helm-notmuch.el#L74

mullikine avatar May 17 '21 13:05 mullikine