Questions tagged [call-process]

23 questions
8
votes
3 answers

Set environment variables for spawned subprocesses

I would like to set the environment variables for a spawned subprocess only. They are controlled by process-environment. The documentation says: binding that variable with let is also reasonable practice. In this example I try to unset HOME…
antonio
  • 1,762
  • 12
  • 24
5
votes
1 answer

Differences between cmdproxy.exe and cmd.exe

What is the difference between: (call-process "cmdproxy" nil "foo" nil "/c" "dir") (call-process "cmd" nil "foo" nil "/c" "dir") ? I seem to get exactly the same results in Emacs 25.1 on Windows 10, except cmdproxy works with the -c switch…
antonio
  • 1,762
  • 12
  • 24
4
votes
2 answers

Run a process synchronously and obtain stdout and stderr in different buffers?

I'm using emacs version 25.1.1. I would like to run a process synchronously and have its stdout and stderr end up in two different buffers. I know I can use make-process to separate stdout and stderr in this way, but make-process runs the process…
HippoMan
  • 582
  • 2
  • 11
2
votes
1 answer

How to pipe data through multiple processes?

Currently I'm generating text from a command, eg: (with-temp-buffer (call-process "my-command" nil t nil "my" "args") ;; operate on output in current buffer. ) How can I use pipes, something that would be written in shell like…
ideasman42
  • 8,375
  • 1
  • 28
  • 105
2
votes
1 answer

How to call "echo ${GOPATH}" with call-process?

I try to execute echo ${GOPATH} with call-process as below: (call-process "echo" nil t nil "${GOPATH}") But it only output "${GOPATH}" not the value of that value. Would anyone please let me know what the correct way to do it?
Enze Chi
  • 1,410
  • 12
  • 28
1
vote
0 answers

Insert output of slow external process in current buffer, character-by-character

Imagine in the current buffer I have the text: Hello Bye I want to call an external program and add the output of it at the end of the buffer. The tricky thing is that the external program provides output little by little, and I want the output to…
scaramouche
  • 1,772
  • 10
  • 24
1
vote
0 answers

How can I execute synchronously a xdotool process in an Elisp function?

I want to perform a repetitive task using Emacs and another program (which, unfortunately, runs under X). I have then set up an elisp function and a xdotool script to do the two parts of the work. The elisp function uses a cl-loop to iterate over…
1
vote
1 answer

open gVim at current line number

We can open a file in gVim at line 99: $ gvim file +99 & With the same file open in Emacs, I can open it in gVim: (when (eq system-type 'gnu/linux) (global-set-key (kbd "C-c g") (lambda () (interactive) (call-process "gvim" nil…
joharr
  • 113
  • 4
1
vote
1 answer

call-process: How to output the progress bars to a buffer

In the following example using a terminal window (Ubuntu 20.04), the program ocrmypdf produces some progress bars while it is running and the last two (2) lines are printed when the program finishes. Using the Emacs function call-process and the…
lawlist
  • 18,826
  • 5
  • 37
  • 118
1
vote
1 answer

How to start a persistent asynchronous process trough emacs?

I am writing a lisp program to be run as a batch file through emacs. The program calls an external application which is supposed to stay running after the call to emacs finishes. The two basic ways for emacs to call external application that I…
Ruy
  • 787
  • 4
  • 11
1
vote
1 answer

How to send quoted argument to call-process

I want to use the imagemagick convert command to draw on a image file. I have the image data as raw-text in a buffer and now I would like to run convert - -draw 'rectangle 0,0,100,100' - on it (the dashes tell convert to use stdin for input and…
dalanicolai
  • 6,108
  • 7
  • 23
1
vote
0 answers

Why does calling `term-send-backspace` (just pressing backspace) create a newline in the `*terminal*` buffer in `term-mode`?

Specs: i@debord:~$ emacs --version GNU Emacs 26.3.50 Copyright (C) 2019 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the terms of the GNU General Public License. For more…
John DeBord
  • 550
  • 3
  • 13
1
vote
1 answer

Why does :command argument of make-process not work when string passed as a variable?

This works fine: (make-process :name "my-proc2" :buffer " *my-proc2*" :command '("sh" "-c" "echo \"hi\"\nsleep 10\necho \"there\"") :connection-type 'pipe :filter (apply-partially 'my-pass-it-on-filter…
codygman
  • 153
  • 6
1
vote
0 answers

tramp variant of `call-process-region`

What is the remote variant of call-process-region or an easy way to implement it? I tried (let ((fh (find-file-name-handler default-directory 'call-process-region))) (apply fh #'call-process-region ...)) But this fails with unsupported i/o…
ensc
  • 168
  • 5
1
vote
0 answers

Prevent call-process from stealing focus

When Emacs executes call-process after the focus has moved to another window (this is after a compilation step which takes some time to finish) it grabs the focus and causes the pointer to move to the upper-right of the Emacs frame. This is on Linux…
Mike B
  • 121
  • 7
1
2