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 "/tmp/mytmprealtest"))

But if I use a variable like the code below I get Debugger entered--Lisp error: (wrong-type-argument stringp body):

(let ((body "echo \"hi\"\nsleep 10\necho \"there from var\""))
  (make-process :name "my-proc2"
        :buffer " *my-proc2*"
        :command '("sh" "-c" body)
        :connection-type 'pipe
        :filter (apply-partially 'my-pass-it-on-filter "/tmp/mytmprealtest")))

The variable should be a string as well, so why doesn't it work?

The documentation for make-process says:

:command COMMAND -- COMMAND is a list starting with the program file
name, followed by strings to give to the program as arguments.

The variable was a string as were all other arguments, so I'm not sure what is wrong.


1 Answer 1


You've quoted the list:

    :command '("sh" "-c" body)

So you have passed it a symbol body not the string value of the variable.


    :command (list "sh" "-c" body)


    :command `("sh" "-c" ,body)

Either of which cause body to be evaluated to its string value.

Not the answer you're looking for? Browse other questions tagged or ask your own question.