From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Linefeeds (\n) to stdout
Date: Mon, 07 Oct 2013 22:24:13 +0200 [thread overview]
Message-ID: <87y564q176.fsf@gmail.com> (raw)
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
next reply other threads:[~2013-10-07 20:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 20:24 Thorsten Jolitz [this message]
2013-10-10 9:42 ` Linefeeds (\n) to stdout Thorsten Jolitz
2013-10-10 11:49 ` Stefan Monnier
2013-10-10 17:17 ` Thorsten Jolitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y564q176.fsf@gmail.com \
--to=tjolitz@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.