thanks a lot for you help.
Maybe its related to this too:
,------------------------------------------------------
| Apparently there is a problem with running C programs
| that use stdout under Emacs: stdout is attached to a
| pipe, which is a block device, rather than the
| console, which is a character device. Thus, you don't
| get your output until the program terminates or there
| is enough data to fill the block buffer.
`------------------------------------------------------
from:
http://lua-users.org/lists/lua-l/2007-04/msg00642.html
> There is a syntax for using --eval inside an existing interactive
> emacsclient frame. One cannot combine -t and -e. Try emacsclient -te
> '(message "boop") and check your *Messages* buffer.
I tried that, but the bahaviour of "-e" and "-te" is exactly the same -
output appears only after the frame is closed.
> What is the Lisp-like program composing these calls, by the way? Is
> this scsh or something?
Its PicoLisp:
http://picolisp.com/5000/!wiki?home
here is the doc for call:
http://software-lab.de/doc/refC.html#call
PicoLisp has a command-line modeled after Vi (modal editing), and I'm
writing an Emacs mode for that command-line. That does not only include
using Emacs keybindings for editing and navigation on the command-line,
but also calling an editor (Vi or Emacs) for editing symbols or PicoLisp
source-files.
So the PicoLisp philosophy is a bit upside down - you work on the
command-line and call an editor when you need one (and close it when
done), instead of living inside the editor and controlling external
programs via Emacs subprocesses. Emacsclient is the perfect solution for
this 'open an editor on demand' philosphy.
There is a PicoLisp major mode (picolisp.el) for Emacs and a comint based
inferior-picolisp.el (and even a swank/slime implementation) that can be
used the usal way - opening a .l (PicoLisp source) file puts it in
PicoLisp-mode, and a call to 'run-picolip' starts a PicoLisp process
in a dedicated process-buffer from inside Emacs. Then, code in the
source buffer can be evaluated and send to the process buffer.
What I'm struggling with is that in my use case, PicoLisp calls Emacs
not vice versa. So there is an open connection between both programs,
probably based on stdin/out, and I would like to use it to do the usual
things like
,------------------------------------------------
| C-x C-e picolisp-send-last-sexp
| C-c C-e picolisp-send-definition
| C-c C-l picolisp-load-file
| C-c C-r picolisp-send-region
| C-c C-x switch-to-picolisp
| C-c M-e picolisp-send-definition-and-go
| C-c M-r picolisp-send-region-and-go
`------------------------------------------------
but not sending from the source-code buffer in the emacsclient to a
process-buffer, but rather sending from the Emacs source-code buffer to the
PicoLisp command-line shell, i.e. via stdout back to the calling program ...
... that sits there after calling emacsclient (inside the 'em' function)
,---------------------
| : (em 'edit)
| Waiting for Emacs...
`---------------------
So I - probably - would need to
1. change stdout from *Messages* to regular stdout
2. flush output immediately after written
3. make output appear in the PicoLisp shell
Or maybe I should rather use the existing connection and open an Emacs
process-buffer for it - but how do I get a process-object for it?
--
cheers,
Thorsten