From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#15033: [PATCH] Fix display of symbols containing backslashes Date: Tue, 06 Aug 2013 18:04:18 -0400 Message-ID: <87a9kuv5lp.fsf@tines.lan> References: <1375796648-5517-1-git-send-email-dak@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1375826717 25062 80.91.229.3 (6 Aug 2013 22:05:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Aug 2013 22:05:17 +0000 (UTC) Cc: 15033-done@debbugs.gnu.org To: David Kastrup Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Aug 07 00:05:18 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V6pNV-0003lt-Sp for guile-bugs@m.gmane.org; Wed, 07 Aug 2013 00:05:18 +0200 Original-Received: from localhost ([::1]:59205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6pNV-0003n8-Dh for guile-bugs@m.gmane.org; Tue, 06 Aug 2013 18:05:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6pNN-0003Zw-Fz for bug-guile@gnu.org; Tue, 06 Aug 2013 18:05:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6pNH-0006Yg-IF for bug-guile@gnu.org; Tue, 06 Aug 2013 18:05:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6pNH-0006Y6-F4 for bug-guile@gnu.org; Tue, 06 Aug 2013 18:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V6pNH-0008MY-0N for bug-guile@gnu.org; Tue, 06 Aug 2013 18:05:03 -0400 Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Tue, 06 Aug 2013 22:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 15033 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Mail-Followup-To: 15033@debbugs.gnu.org, mhw@netris.org, dak@gnu.org Original-Received: via spool by 15033-done@debbugs.gnu.org id=D15033.137582667832071 (code D ref 15033); Tue, 06 Aug 2013 22:05:02 +0000 Original-Received: (at 15033-done) by debbugs.gnu.org; 6 Aug 2013 22:04:38 +0000 Original-Received: from localhost ([127.0.0.1]:43859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V6pMr-0008LC-QG for submit@debbugs.gnu.org; Tue, 06 Aug 2013 18:04:38 -0400 Original-Received: from world.peace.net ([96.39.62.75]:48794 ident=hope4) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V6pMq-0008Kz-3z for 15033-done@debbugs.gnu.org; Tue, 06 Aug 2013 18:04:36 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1V6pMj-0003gl-66; Tue, 06 Aug 2013 18:04:29 -0400 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") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7247 Archived-At: David Kastrup 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