I have been reading the documentation for call-process-region here and I am trying to redirect stderr to a file. from the the documentation, this looks correct

(call-process-region beg end perltidy-executable t '(t (:file "/tmp/tidy")))

however when I try to run it I get the following error

Wrong type argument: stringp, (:file "/tmp/tidy")

it works without errors if I use

(call-process-region beg end perltidy-executable t '(t nil))

but that causes stderr to be lost.

What am I doing wrong here?

1 Answer 1


You don't need the (:file ) just give the error file as second element in the list.

BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.

So you would call:

(call-process-region beg end perltidy-executable t '(t "/tmp/tidy"))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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