From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#23425: master branch: `message' wrongly corrupts ' to curly quote. Date: Fri, 9 Jun 2017 19:41:42 +0000 Message-ID: <20170609194141.GA3410@acm.fritz.box> References: <20170603205331.GA2130@acm.fritz.box> <20170605162737.GA30946@acm.fritz.box> <20170605203753.GB30946@acm.fritz.box> <20170607191344.GB2430@acm.fritz.box> <20170608173400.GA2662@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497037395 12801 195.159.176.226 (9 Jun 2017 19:43:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Jun 2017 19:43:15 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: 23425@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 09 21:43:11 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 1dJPoM-00036w-ID for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Jun 2017 21:43:10 +0200 Original-Received: from localhost ([::1]:56187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJPoR-0006aF-GU for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Jun 2017 15:43:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJPoJ-0006Zw-MN for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2017 15:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJPoE-0002OG-LV for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2017 15:43:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34730) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJPoE-0002OC-Gu for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2017 15:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dJPoE-0007gT-0i for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2017 15:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2017 19:43:01 +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.149703736929518 (code B ref 23425); Fri, 09 Jun 2017 19:43:01 +0000 Original-Received: (at 23425) by debbugs.gnu.org; 9 Jun 2017 19:42:49 +0000 Original-Received: from localhost ([127.0.0.1]:37407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJPo1-0007g2-84 for submit@debbugs.gnu.org; Fri, 09 Jun 2017 15:42:49 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:59863 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJPo0-0007fu-4X for 23425@debbugs.gnu.org; Fri, 09 Jun 2017 15:42:48 -0400 Original-Received: (qmail 94916 invoked by uid 3782); 9 Jun 2017 19:42:45 -0000 Original-Received: from acm.muc.de (p548C6FE9.dip0.t-ipconnect.de [84.140.111.233]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 09 Jun 2017 21:42:44 +0200 Original-Received: (qmail 3784 invoked by uid 1000); 9 Jun 2017 19:41:42 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:133418 Archived-At: Hello, Paul. On Thu, Jun 08, 2017 at 13:17:39 -0700, Paul Eggert wrote: > On 06/08/2017 10:34 AM, Alan Mackenzie wrote: > > YUCK! So we'd have both message and memo doing basically the > > samething, with different interfaces. > If it’s the API difference you object to, it’d be OK for the two > functions to have the same signature. It’s no big deal. It's not OK to have two functions doing the same thing. > > you've got two functions which are so close to each other, one > > single function would be better..... > If having one single function would mean changing hundreds or thousands > of callers, then there is an important sense in which one single > function would not be better. That depends solely on whether anybody's prepared to do the work. You're proposing changing `message' to `memo' for those callers anyway. If you do that, we will end up with a horrible mess, with two almost identical functions competing in the vast space of messaging where there are no quote characters in the format string. This would leave unsolved the problem of format strings containing both literal quote characters and quote characters for possible replacement by curlies. We should be looking firstly at where we want to end up, and only later at whether we can get there. I still maintain that the most satisfactory solution now available is for %` and %' to become part of the format string, as already described. > > NOBODY will write (message "30%-50% done") > Admittedly the example was contrived, but I thought it was cool how one > can use % to delete parts of messages, something that is much worse than > quote restyling. More commonly people compute a message string S > somewhere else and then call (message S), and that does have real > problems with %, particularly in situations where an adversary has some > control over the contents of S. Maybe, but that's a different problem. We should not be adding to it. > >> It’s not intended to be “surreptitious” or “hidden” or anything > >> like that, .... > > That may be the case, but it _seems_ very much like it. If the > > intention had actually been to be surreptitious, what more could > > have been done than was actually done? > Lots. We discussed and rejected more-“surreptitious” options back before > this stuff was installed. For example, we discussed changing ‘format’ to > behave like ‘format-message’ does now. In effect, that's what was actually done. `format-message' was introduced and `message' was switched unconditionally to use it, despite the serious problems this was bound to cause. Let me summarise the current state of the discussion. I have proposed restoring message's property of every format specifier starting with %, with every character which isn't % being a literal character. Two new format specifiers would be introduced, %` and %' to indicate the substitution by the user's preferred version of left and right single quote. This would render format strings containing these new specifiers unusable on Older Emacsen. This would be worked around by providing advice to message, to be applied by external packages using the new specifiers. There would be a significant amount of work amending format strings which currently use ` and ' to use %` and %'. I think the topic has been pretty thoroughly discussed. Are there any objections remaining to me implementing this change and committing it to master? -- Alan Mackenzie (Nuremberg, Germany).