1

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.

codygman
  • 153
  • 6

1 Answers1

3

You've quoted the list:

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

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

Try:

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

or:

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

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

phils
  • 48,657
  • 3
  • 76
  • 115