-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow overriding of connection type? #102
Comments
alphapapa <notifications@github.com> writes:
Hi John,
I'm having a problem using rg with async-start-process: BurntSushi/ripgrep#951
Ripgrep in helm works perfecly called in an async process, see in
helm-grep.el how it is called.
I don't understand what you want to do here, don't know also why you
want to use async-start-process???
`async-start-process` should call "emacs" only and then inside the new
emacs process, compute your code.
So it is nonsense to start an emacs async to run an async-process in it,
use instead directly `start-process` from your main emacs.
I tried to bind process-connection-type around async-start-process, but it has no effect because async-start-process rebinds it to nil before calling start-process.
However, when I do this, it works:
(defun argh-start-process (name program finish-func &rest program-args)
"Start the executable PROGRAM asynchronously. See `async-start'.
PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the
process object when done. If FINISH-FUNC is nil, the future
object will return the process object when the program is
finished. Set DEFAULT-DIRECTORY to change PROGRAM's current
working directory."
(let* ((buf (generate-new-buffer (concat "*" name "*")))
;; NOTE: Removed let-binding of process-connection-type.
(proc (apply #'start-process name buf program program-args)))
(with-current-buffer buf
(set (make-local-variable 'async-callback) finish-func)
(set-process-sentinel proc #'async-when-done)
(unless (string= name "emacs")
(set (make-local-variable 'async-callback-for-process) t))
proc)))
(let ((default-directory directory)
(process-connection-type 'pty))
(argh-start-process "rg-scan-async" "nice"
(apply-partially #'magit-todos--rg-scan-async-callback magit-status-buffer)
"-n5"
"rg" "--column" magit-todos-ag-search-regexp))
Is there a reason it doesn't allow the connection type to be changed? If not, could it?
Really hard to understand what you want to achieve here...
…--
Thierry
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi John,
I'm having a problem using
rg
withasync-start-process
: BurntSushi/ripgrep#951I tried to bind
process-connection-type
aroundasync-start-process
, but it has no effect becauseasync-start-process
rebinds it tonil
before callingstart-process
. However, when I do this, it works:Is there a reason it doesn't allow the connection type to be changed? If not, could it?
Thanks.
The text was updated successfully, but these errors were encountered: