From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#20707: [PROPOSED PATCH] Use curved quoting in C-generated errors Date: Mon, 01 Jun 2015 10:55:44 -0700 Organization: UCLA Computer Science Department Message-ID: <556C9CA0.3090400@cs.ucla.edu> References: <1433144361-9424-1-git-send-email-eggert@cs.ucla.edu> <83bngzts46.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1433181387 3654 80.91.229.3 (1 Jun 2015 17:56:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2015 17:56:27 +0000 (UTC) Cc: 20707@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 01 19:56:17 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 1YzTwd-0000qs-TV for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jun 2015 19:56:16 +0200 Original-Received: from localhost ([::1]:53695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzTwd-0007ic-92 for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jun 2015 13:56:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzTwX-0007hg-43 for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 13:56:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzTwR-0005XW-L6 for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 13:56:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzTwR-0005XQ-F2 for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 13:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YzTwQ-0005mU-Lj for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2015 13:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2015 17:56:02 +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.143318135722210 (code B ref 20707); Mon, 01 Jun 2015 17:56:02 +0000 Original-Received: (at 20707) by debbugs.gnu.org; 1 Jun 2015 17:55:57 +0000 Original-Received: from localhost ([127.0.0.1]:36372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzTwJ-0005m9-Qt for submit@debbugs.gnu.org; Mon, 01 Jun 2015 13:55:56 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:44629) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzTwG-0005lr-Ia for 20707@debbugs.gnu.org; Mon, 01 Jun 2015 13:55:53 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 5AC73A6000C; Mon, 1 Jun 2015 10:55:46 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ec2phdokDvvN; Mon, 1 Jun 2015 10:55:45 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 254E9A6000B; Mon, 1 Jun 2015 10:55:45 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <83bngzts46.fsf@gnu.org> 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:103448 Archived-At: 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. 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. But if it's really needed I suppose someone should make a pass over the source code.... > 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. 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. Emacs source code is never in UTF-16 so this shouldn't be an issue. Getting rid of u8 would remove the need for uLSQM and uRSQM which would be nice. > '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?