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

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

bug#7524: 24.0.50; backquote converts newlines in strings to "\n"


From: Stefan Monnier
Subject: bug#7524: 24.0.50; backquote converts newlines in strings to "\n"
Date: Wed, 01 Dec 2010 11:04:19 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> Evaluate this:
> `("Foo" . (lambda ()
>             "Four score and seven years ago
> Our forefathers brought forth etc.
> Etc., etc., etc."
>             (message "HOWDY")))
 
> That doc string is a literal string with two embedded newline chars.
> Evaluation converts each of those chars to a string of two chars: "\n":
 
> ("Foo" lambda nil "Four score and seven years ago\nOur forefathers brought 
> forth
> etc.\nEtc., etc., etc."
>  (message "Howdy"))
 
It's got nothing to do with backquote.  It's just that

    "foo
    bar"

is just another way to write "foo\nbar": the Elisp reader will return
the exact same string in both cases.  So the Elisp printer can't know
which one was used originally and has to choose arbitrarily which form
to output.

> Shouldn't happen.

Unavoidable.  Tho you do get to choose somewhat the print format by
choosing between prin1 and princ (aka %s and %S in format).

> (This is particularly messy when used in defcustom values.)

I don't know what you're referring to.  I'll keep the bug open for now,
assuming that the defcustom issue will be the actual bug.


        Stefan





reply via email to

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