From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20707: [PROPOSED PATCH] Use curved quoting in C-generated errors Date: Mon, 01 Jun 2015 21:29:05 +0300 Message-ID: <83twurs2oe.fsf@gnu.org> References: <1433144361-9424-1-git-send-email-eggert@cs.ucla.edu> <83bngzts46.fsf@gnu.org> <556C9CA0.3090400@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1433183428 10877 80.91.229.3 (1 Jun 2015 18:30:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2015 18:30:28 +0000 (UTC) Cc: 20707@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 01 20:30:19 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1YzUTX-0001bK-5h for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jun 2015 20:30:15 +0200 Original-Received: from localhost ([::1]:53838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzUTW-0001o4-8z for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jun 2015 14:30:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzUTS-0001nr-VU for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 14:30:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzUTP-0000Ef-OS for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 14:30:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzUTP-0000Cz-Lg for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 14:30:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YzUTO-0006b8-7e for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 14:30:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2015 18:30:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20707 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 20707-submit@debbugs.gnu.org id=B20707.143318336825292 (code B ref 20707); Mon, 01 Jun 2015 18:30:05 +0000 Original-Received: (at 20707) by debbugs.gnu.org; 1 Jun 2015 18:29:28 +0000 Original-Received: from localhost ([127.0.0.1]:36382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzUSl-0006Zr-6L for submit@debbugs.gnu.org; Mon, 01 Jun 2015 14:29:27 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:57269) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzUSi-0006Zc-Ow for 20707@debbugs.gnu.org; Mon, 01 Jun 2015 14:29:26 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NPA00E002Z4JL00@mtaout28.012.net.il> for 20707@debbugs.gnu.org; Mon, 01 Jun 2015 21:28:38 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NPA008WG3BQ8580@mtaout28.012.net.il>; Mon, 01 Jun 2015 21:28:38 +0300 (IDT) In-reply-to: <556C9CA0.3090400@cs.ucla.edu> X-012-Sender: halo1@inter.net.il 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-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103450 Archived-At: > Date: Mon, 01 Jun 2015 10:55:44 -0700 > From: Paul Eggert > CC: 20707@debbugs.gnu.org > > On 06/01/2015 07:34 AM, Eli Zaretskii wrote: > > They use UTF-8 encoded characters, and so will require a suitable > > 'coding:' cookie in the affected files, or some equivalent setting > > (perhaps in .dir-locals.el?), otherwise they might not be decoded > > correctly in non-UTF-8 locales. > > Good point, and this raises a related issue with all text files in the > Emacs repository that aren't ASCII. The way I've been testing this sort > of thing is to visit a source file in a Latin-9 locale, and if it is > correctly decoded as UTF-8 then I don't bother with adding a coding: > cookie. I'm not sure testing this in a single non-UTF-8 locale is enough. > To be honest I've been hoping that use of non-UTF-8 locales > would be dying off among Emacs developers, so that we wouldn't need to > worry about sprinkling coding: cookies everywhere. There are no UTF-8 locales on Windows, and I don't think there are any plans to introduce them. Perhaps teaching .dir-locals.el to support directory-wide default encoding is the best approach. > > Doing so might remove at least part of the need for using the u8 > > qualifier, I think. > > The u8 prefix is for C compilers, not for Emacs, and the C compilers > won't know about coding: cookies. Right, but why do we want u8 there? Isn't it to make sure the string ends up in UTF-8 in the binary when the source code is encoded in something other than UTF-8? > Come to think of it, though, perhaps we can dispense with u8. As far as > I know u8 is needed only for MS-Windows compilers when the source code > is in UTF-16 or suchlike but you want the string to be UTF-8. We no longer support Microsoft compilers anyway. > > 'error' calls 'verror', which calls 'make_string' to actually produce > > the message string. However, 'make_string' is not reliable enough wrt > > whether it produces unibyte or multibyte strings > > Hmm, why isn't make_string reliable enough? If the string is validly > encoded UTF-8 (a safe assumption here), then make_string should produce > a unibyte string if its ASCII only, and a multibyte string otherwise, > and either way the string value should be OK. What am I missing? The convoluted logic of deciding when to produce a multibyte string sometimes surprised me in the past, so I tend not to trust it. We know what we want in this case, so why not use make_multibyte_string directly?