unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Alan Mackenzie <acm@muc.de>
Cc: Glenn Morris <rgm@gnu.org>, 23425@debbugs.gnu.org, emacs-devel@gnu.org
Subject: Re: bug#23425: master branch: `message' wrongly corrupts ' to curly quote.
Date: Mon, 5 Jun 2017 11:19:06 -0700	[thread overview]
Message-ID: <ac90b979-6a37-29c4-03b3-6322ac2cc11a@cs.ucla.edu> (raw)
In-Reply-To: <20170605162737.GA30946@acm.fritz.box>

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....



  reply	other threads:[~2017-06-05 18:19 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <83d1p1iwls.fsf@gnu.org>
     [not found] ` <20160504180417.GB31717@acm.fritz.box>
     [not found]   ` <4019c1e5-36b4-745f-b299-16b074bff81e@cs.ucla.edu>
     [not found]     ` <b6310cb1-184c-8643-cced-1c25a7c13d5a@cs.ucla.edu>
     [not found]       ` <83zis4h59w.fsf@gnu.org>
     [not found]         ` <51a2ae75-71f7-10f6-ae2a-7c830bdf0a30@cs.ucla.edu>
     [not found]           ` <ux37blx2a2.fsf@fencepost.gnu.org>
     [not found]             ` <17c1c00d-a275-5e61-0c47-6872a64a9347@cs.ucla.edu>
     [not found]               ` <20170531212452.GA3789@acm.fritz.box>
     [not found]                 ` <kur2z38x5m.fsf@fencepost.gnu.org>
2017-06-03 21:07                   ` bug#23425: master branch: `message' wrongly corrupts ' to curly quote Alan Mackenzie
     [not found]                 ` <07bf5f9d-e8cd-a4d9-1843-b488bfe0b92c@cs.ucla.edu>
     [not found]                   ` <20170602210209.GA3570@acm.fritz.box>
     [not found]                     ` <11c0adfb-7fdd-8d28-1a47-869e3e7043ea@cs.ucla.edu>
2017-06-03 20:53                       ` Alan Mackenzie
2017-06-04 21:01                         ` Paul Eggert
2017-06-05 16:27                           ` Alan Mackenzie
2017-06-05 18:19                             ` Paul Eggert [this message]
2017-06-05 18:31                               ` Andreas Schwab
2017-06-05 20:37                               ` Alan Mackenzie
2017-06-05 21:05                                 ` Clément Pit-Claudel
2017-06-07 16:50                                   ` Alan Mackenzie
2017-06-07 19:29                                     ` Clément Pit-Claudel
2017-06-06  0:14                                 ` Paul Eggert
2017-06-06  8:21                                   ` Andreas Schwab
2017-06-06 12:24                                     ` Clément Pit-Claudel
2017-06-06 13:55                                       ` Yuri Khan
2017-06-06 18:21                                         ` Clément Pit-Claudel
2017-06-06 18:59                                           ` Yuri Khan
2017-06-06 19:39                                             ` Clément Pit-Claudel
2017-06-07  4:57                                               ` Eli Zaretskii
2017-06-06 23:09                                     ` Paul Eggert
2017-06-07  7:44                                       ` Andreas Schwab
2017-06-07 13:27                                       ` Drew Adams
2017-06-07 19:13                                   ` Alan Mackenzie
2017-06-07 19:27                                     ` Clément Pit-Claudel
2017-06-07 19:33                                       ` Dmitry Gutov
2017-06-07 19:51                                       ` Alan Mackenzie
2017-06-07 20:33                                       ` Alan Mackenzie
2017-06-07 20:56                                         ` Drew Adams
2017-06-07 22:05                                           ` `message' with quotes [was: bug#23425: `message' wrongly corrupts ' to curly quote] Drew Adams
2017-06-08 17:49                                             ` Alan Mackenzie
     [not found]                       ` <73poemlyhp.fsf@fencepost.gnu.org>
2017-06-03 21:01                         ` bug#23425: master branch: `message' wrongly corrupts ' to curly quote Alan Mackenzie
     [not found]                     ` <a874cfc4-8810-a981-6228-83a3b6c703e8@yandex.ru>
2017-06-03 21:10                       ` Alan Mackenzie
2017-06-03 21:32                         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac90b979-6a37-29c4-03b3-6322ac2cc11a@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=23425@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).