unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* prin1-to-string noescape parameter
@ 2014-10-31 16:15 Oleh Krehel
  2014-10-31 19:11 ` Andreas Schwab
  2014-10-31 19:54 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Oleh Krehel @ 2014-10-31 16:15 UTC (permalink / raw)
  To: emacs-devel

Hi all,

I'm trying to write some code that formats/restructures Elisp source
files (a la Paredit).  But instead of using text manipulation,
I want to read the object in, manipulate it and print it
out.

One issue that I'm facing is:

    (prin1-to-string (read "(foo.bar baz?)"))
    => "(foo\\.bar baz\\?)"

I tried to overcome this with:

    (prin1-to-string (read "(foo.bar baz?)") t)
    => "(foo.bar baz?)"

But another problem resurfaces instead:

    (prin1-to-string (read "(foo \"bar\")") t)
    => "(foo bar)"

Even worse:

     (prin1-to-string (read "(foo \";bar\")") t)
     => "(foo ;bar)"

I think a fix to the issue would be to split the `escapeflag'
parameter of the `print_object' C function into two parts. Currently a
single bool flag decides if to escape strings or not, and if to escape
certain characters or not.

Any other suggestions to overcome this issue are welcome as well, so
far I've tried setting `print-quoted', `print-escape-multibyte', and
`print-escape-nonascii'.

regards,
Oleh



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-01 10:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 16:15 prin1-to-string noescape parameter Oleh Krehel
2014-10-31 19:11 ` Andreas Schwab
2014-10-31 20:11   ` Oleh Krehel
2014-10-31 20:51     ` Andreas Schwab
2014-10-31 21:24       ` Oleh Krehel
2014-11-01  7:34         ` Andreas Schwab
2014-11-01  8:28           ` Oleh Krehel
2014-11-01 10:03             ` Andreas Schwab
2014-10-31 19:54 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).