help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacsclient - load file and recieve output


From: Thorsten Jolitz
Subject: emacsclient - load file and recieve output
Date: Sat, 13 Jul 2013 11:53:41 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Hi List,

say I start emacs as server

,------------------------------------------------------
| $ emacs -Q --daemon=my-server --directory=/home/DIR
`------------------------------------------------------

and calls from the command-line work so far

,---------------------------------------------------------
| $ emacsclient -s my-server -e "(+ 3 5)"
| 8
| $ emacsclient -s my-server -e "(message \"%s\" (+ 3 5))"
| "8"
| $ emacsclient -s my-server -e "(format \"%s\" (+ 3 5))"
| "8"
| $ emacsclient -s my-server -e "(print \"hallo world\")"
| "hallo world"
`---------------------------------------------------------

Now I want to load a file (in /home/DIR/) with Emacs Lisp code and
receive the output from that code.

,------------------------------------------------------------------------
| $ emacsclient -s my-server -e "(load-file \"testfile.el\")"
| t
`------------------------------------------------------------------------

The file contains the same expressions as above

,-----------------------
| (+ 3 5)
|
| (message "%s" (+ 3 5))
|
| (format "%s" (+ 3 5))
|
| (print "hallo world")
`-----------------------

and loading it from withing Emacs with 'M-: (load-file ...)' prints the
'message and 'print output into the *Messages* buffer as expected. But
with the call to emacsclient, (it seems) I only receive the final 't'
(=> load-file was successful).

How can I load a file within a call to emacsclient and receive all the
output that goes to stdout or stderr?

--
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]