[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Linefeeds (\n) to stdout
From: |
Thorsten Jolitz |
Subject: |
Linefeeds (\n) to stdout |
Date: |
Mon, 07 Oct 2013 22:24:13 +0200 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
Hi List,
I'm trying to figure out some strange issues I have with linefeeds:
1. with standalone Emacs
#+begin_src sh
$ emacs -Q -e ...
#+end_src
sending an Org-mode text from another program Emacs and receiving the HTML
produced by Org-mode's exporter (stdout and stdin) works fine.
2. doing exactly the same thing with emacs server/client
#+begin_src sh
$ emacsclient -e ...
#+end_src
results in HTML cluttered with \n that are printed verbatim in the webpage
Another problem I face is that sending a parse-tree containing strings with
only a linefeed (printed with '(print-escape-newlines t)')
#+begin_src emacs-lisp
#(\"\\n\" 0 1 (:parent #3))
#+end_src
to another Lisp (that only knows about "^J", not about "\n") via
stdout/stdin results, after the other Lisp's reader did its work, into
something like
#+begin_src picolisp
(\# ("n" 0 1 (:parent \#3)))
#+end_src
[ignore the # stuff, but note that the linefeed was read as "n" string].
Now I wonder:
- what does Emacs sends to stdout when it sends a linefeed? I use
`prin1-to-string' and then `buffer-substring-no-properties' to produce the
string I send from Emacs.
- why are there differences between standalone Emacs and Emacsclient?
--
cheers,
Thorsten
- Linefeeds (\n) to stdout,
Thorsten Jolitz <=