From: Mark H Weaver <mhw@netris.org>
To: David Kastrup <dak@gnu.org>
Cc: 15033-done@debbugs.gnu.org
Subject: bug#15033: [PATCH] Fix display of symbols containing backslashes
Date: Tue, 06 Aug 2013 18:04:18 -0400 [thread overview]
Message-ID: <87a9kuv5lp.fsf@tines.lan> (raw)
In-Reply-To: <1375796648-5517-1-git-send-email-dak@gnu.org> (David Kastrup's message of "Tue, 6 Aug 2013 15:44:08 +0200")
David Kastrup <dak@gnu.org> writes:
> Symbols printed with `#{...#}' notation need to double backslashes when
> displaying as they serve as escape characters when reading. The
> behavior before this patch is clearly erroneous:
>
> GNU Guile 2.0.7
> [...]
> scheme@(guile-user)> (string->symbol "\\(")
> $1 = #{\\x28;}#
> scheme@(guile-user)> (symbol->string '#{\\x28;}#)
> $2 = "\\x28;"
> ---
> libguile/print.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libguile/print.c b/libguile/print.c
> index 50f5a3e..bb7fd84 100644
> --- a/libguile/print.c
> +++ b/libguile/print.c
> @@ -448,7 +448,8 @@ print_extended_symbol (SCM sym, SCM port)
> SUBSEQUENT_IDENTIFIER_MASK
> | UC_CATEGORY_MASK_Zs))
> {
> - if (!display_character (c, port, strategy))
> + if (!display_character (c, port, strategy)
> + || (c == '\\' && !display_character (c, port, strategy)))
> scm_encoding_error ("print_extended_symbol", errno,
> "cannot convert to output locale",
> port, SCM_MAKE_CHAR (c));
Applied in b4a099883d20d7852c95acf07ab6cbc56bce18c4.
Thanks!
Mark
prev parent reply other threads:[~2013-08-06 22:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-06 13:44 bug#15033: [PATCH] Fix display of symbols containing backslashes David Kastrup
2013-08-06 22:04 ` Mark H Weaver [this message]
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a9kuv5lp.fsf@tines.lan \
--to=mhw@netris.org \
--cc=15033-done@debbugs.gnu.org \
--cc=dak@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.
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).