From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: 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 1496686834 8322 195.159.176.226 (5 Jun 2017 18:20:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Jun 2017 18:20:34 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 Cc: 23425@debbugs.gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 05 20:20:30 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dHwc9-0001mQ-UA for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jun 2017 20:20:30 +0200 Original-Received: from localhost ([::1]:34620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHwcF-0007a4-25 for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jun 2017 14:20:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHwbj-0007JA-NH for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 14:20:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHwbi-0006UJ-Jq for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 14:20:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHwbi-0006Tu-HI for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 14:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dHwbi-0005um-73 for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 14:20: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, 05 Jun 2017 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23425 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23425-submit@debbugs.gnu.org id=B23425.149668675922683 (code B ref 23425); Mon, 05 Jun 2017 18:20:02 +0000 Original-Received: (at 23425) by debbugs.gnu.org; 5 Jun 2017 18:19:19 +0000 Original-Received: from localhost ([127.0.0.1]:58029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHwb1-0005tn-I7 for submit@debbugs.gnu.org; Mon, 05 Jun 2017 14:19:19 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:48152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHwaz-0005tZ-J3 for 23425@debbugs.gnu.org; Mon, 05 Jun 2017 14:19:18 -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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:133311 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....