From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: bug#23425: master branch: `message' wrongly corrupts ' to curly quote. Date: Mon, 5 Jun 2017 11:19:06 -0700 Organization: UCLA Computer Science Department Message-ID: References: <83zis4h59w.fsf@gnu.org> <51a2ae75-71f7-10f6-ae2a-7c830bdf0a30@cs.ucla.edu> <17c1c00d-a275-5e61-0c47-6872a64a9347@cs.ucla.edu> <20170531212452.GA3789@acm.fritz.box> <07bf5f9d-e8cd-a4d9-1843-b488bfe0b92c@cs.ucla.edu> <20170602210209.GA3570@acm.fritz.box> <11c0adfb-7fdd-8d28-1a47-869e3e7043ea@cs.ucla.edu> <20170603205331.GA2130@acm.fritz.box> <20170605162737.GA30946@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1496686804 1893 195.159.176.226 (5 Jun 2017 18:20:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Jun 2017 18:20:04 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 Cc: Glenn Morris , 23425@debbugs.gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 05 20:20:00 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHwbf-0008NV-KQ for ged-emacs-devel@m.gmane.org; Mon, 05 Jun 2017 20:19:59 +0200 Original-Received: from localhost ([::1]:34613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHwbg-00071r-E7 for ged-emacs-devel@m.gmane.org; Mon, 05 Jun 2017 14:20:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHwb4-00071m-7C for emacs-devel@gnu.org; Mon, 05 Jun 2017 14:19:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHway-0005kJ-9q for emacs-devel@gnu.org; Mon, 05 Jun 2017 14:19:22 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dHway-0005iT-02; Mon, 05 Jun 2017 14:19:16 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AC5371600F3; Mon, 5 Jun 2017 11:19:11 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id C1XaOQhHs5if; Mon, 5 Jun 2017 11:19:10 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D68DC1600F5; Mon, 5 Jun 2017 11:19:10 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZNbO4M-GrTa7; Mon, 5 Jun 2017 11:19:10 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 83A701600F3; Mon, 5 Jun 2017 11:19:10 -0700 (PDT) In-Reply-To: <20170605162737.GA30946@acm.fritz.box> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215455 Archived-At: On 06/05/2017 09:27 AM, Alan Mackenzie wrote: > Can you give an example of something which might need two strings? Suppose the same string is used for both messages and documentation. You're proposing %` in the former where ` is in the latter, so we would need distinct strings.People cut and paste between messages and doc strings, and it's possible there's even code that does this (I haven't checked). Using different quoting notations for the two kinds of strings will cause confusion and problems. > 2745 is a good first approximation. This is being optimistic. It's not just the message and error functions; there are others, ranging from general functions like user-error to more-specialized functions like icalendar--dmsg.These cannot be found merely by a simple text search for function names. A simple albeit tedious and somewhat error-prone approach would be to examine every ` and ' in every string and character constant (in either C or Elisp) and fix those intended for the message function or any of its callers. This is the sort of thing that I did when converting for Emacs 25. > The consequences of surreptitious unwanted translation are so severe It's not surreptitious: it's documented. And the consequences are not severe: they are a minor change to strings intended for human consumption, where humans can easily recover from unwanted translation, and where humans who don't want translation can easily turn it off. As I understand it, you're proposing making hundreds or thousands of changes like this: (error "Can't find `%s' in %s" thing where))) => (error "Can%'t find %`%s%' in %s" thing where))) These changes will adversely affect code readability, and this will have a maintenance cost in the long run -- not just to whoever makes the hundreds or thousands of changes, but to everybody who has to read the code afterwards.It's not at all clear that this cost is greater than the benefit of fixing some of the minor problems that you're objecting to. > _Anybody_ who's used `message' knows Perhaps I should introduce you to my students someday. I teach them elements of Emacs and I assure you that some of them do not know. Although I readily concede that more people know about % than ` or ', this doesn't alter the fact that it causes problems to support special characters of any sort in the message function. Elisp code needed to use (message "%s" STR) even before the change you're objecting to, and it'd still need (message "%s" STR) even if the change were reverted. > It is not merely annoying, it is hideously irregular. Having to write > (message "%s" (format "...." arg1 arg2 ....)) screams out "we didn't > think this through properly". Yes, and that's just as true for % as it is for ` and '. In hindsight, the message function should have had a better API. Hindsight is wonderful....