* error message without quotes translation
@ 2016-09-01 4:19 Tino Calancha
2016-09-01 6:08 ` Paul Eggert
0 siblings, 1 reply; 3+ messages in thread
From: Tino Calancha @ 2016-09-01 4:19 UTC (permalink / raw)
To: Emacs developers; +Cc: tino.calancha
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]
Hi,
my question is related with the following NEWS entry:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
** Message-issuing functions like 'message' and 'error' now translate
various sorts of single quotes in their format strings according to
the value of 'text-quoting-style' (see above). This translation
cannot be disabled. To get the old behavior, use 'format', which is
not affected by 'text-quoting-style', e.g., (message "%s" (format
"...." foo bar)).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If i want to show in the echo are the literal message: "`Symbol' 'foo"
then i can do as follows:
(message "%s" (format "`Symbol' 'foo"))
=> "`Symbol' 'foo"
From the above entry i expect the same works for `error' as well:
(error "%s" (format "`Symbol' 'foo"))
but i see in the echo area:
"‘Symbol’ ’foo"
that is, with the quotes translated.
In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.9)
of 2016-09-01
Repository revision: 6f125aa3de06fa0180a83ec7b5a26970309eeeb6
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: error message without quotes translation
2016-09-01 4:19 error message without quotes translation Tino Calancha
@ 2016-09-01 6:08 ` Paul Eggert
2016-09-01 8:47 ` Tino Calancha
0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2016-09-01 6:08 UTC (permalink / raw)
To: Tino Calancha; +Cc: Emacs developers
[-- Attachment #1: Type: text/plain, Size: 231 bytes --]
Tino Calancha wrote:
> From the above entry i expect the same works for `error' as well:
> (error "%s" (format "`Symbol' 'foo"))
Yes, there's a bug there. Thanks for reporting it. I fixed it in master by
installing the attached.
[-- Attachment #2: 0001-Fix-over-substitution-of-quotes-on-error.patch --]
[-- Type: text/x-diff, Size: 1314 bytes --]
From 83f79ea8f4704444e6a3f88f5890d06904e574cb Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 31 Aug 2016 23:05:48 -0700
Subject: [PATCH] Fix over-substitution of quotes on error
Problem reported by Tino Calancha in:
http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00000.html
* src/print.c (print_error_message):
Substitute quotes in errmsg only when gotten from a property.
---
src/print.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/print.c b/src/print.c
index 5531210..d54a7c9 100644
--- a/src/print.c
+++ b/src/print.c
@@ -920,7 +920,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
else
{
Lisp_Object error_conditions = Fget (errname, Qerror_conditions);
- errmsg = Fget (errname, Qerror_message);
+ errmsg = Fsubstitute_command_keys (Fget (errname, Qerror_message));
file_error = Fmemq (Qfile_error, error_conditions);
}
@@ -939,7 +939,7 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
if (!STRINGP (errmsg))
write_string_1 ("peculiar error", stream);
else if (SCHARS (errmsg))
- Fprinc (Fsubstitute_command_keys (errmsg), stream);
+ Fprinc (errmsg, stream);
else
sep = NULL;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-01 8:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 4:19 error message without quotes translation Tino Calancha
2016-09-01 6:08 ` Paul Eggert
2016-09-01 8:47 ` Tino Calancha
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).