From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#20707: [PROPOSED PATCH] Use curved quoting in C-generated errors Date: Wed, 10 Jun 2015 19:17:30 +0000 Message-ID: <20150610191730.GB3632@acm.fritz.box> References: <20150606205023.GA3862@acm.fritz.box> <55738BA9.7050104@cs.ucla.edu> <20150608171804.GA3184@acm.fritz.box> <55768D82.3040509@cs.ucla.edu> <20150609133423.GA3735@acm.fritz.box> <5577516B.9020709@cs.ucla.edu> <20150609224616.GC3735@acm.fritz.box> <557779E9.3050409@cs.ucla.edu> <20150610133931.GA3632@acm.fritz.box> <557863CA.8060609@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1433963904 18644 80.91.229.3 (10 Jun 2015 19:18:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jun 2015 19:18:24 +0000 (UTC) Cc: 20707@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 10 21:18:13 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 1Z2lVs-0003oP-DP for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jun 2015 21:18:12 +0200 Original-Received: from localhost ([::1]:41886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2lVr-0006gN-PI for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jun 2015 15:18:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2lVo-0006gF-67 for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 15:18:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2lVj-0000D8-5s for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 15:18:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2lVj-0000Cz-2o for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 15:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z2lVi-0006P7-I0 for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 15:18: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: Wed, 10 Jun 2015 19:18: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.143396382724472 (code B ref 20707); Wed, 10 Jun 2015 19:18:02 +0000 Original-Received: (at 20707) by debbugs.gnu.org; 10 Jun 2015 19:17:07 +0000 Original-Received: from localhost ([127.0.0.1]:47457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2lUn-0006MZ-9u for submit@debbugs.gnu.org; Wed, 10 Jun 2015 15:17:06 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:53392) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2lUj-0006Lu-27 for 20707@debbugs.gnu.org; Wed, 10 Jun 2015 15:17:03 -0400 Original-Received: (qmail 46148 invoked by uid 3782); 10 Jun 2015 19:16:59 -0000 Original-Received: from acm.muc.de (p548A5390.dip0.t-ipconnect.de [84.138.83.144]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 10 Jun 2015 21:16:58 +0200 Original-Received: (qmail 7469 invoked by uid 1000); 10 Jun 2015 19:17:30 -0000 Content-Disposition: inline In-Reply-To: <557863CA.8060609@cs.ucla.edu> User-Agent: Mutt/1.5.23 (2014-03-12) 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.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:103799 Archived-At: Hello, Paul. On Wed, Jun 10, 2015 at 09:20:26AM -0700, Paul Eggert wrote: > Alan Mackenzie wrote: > > You want to > > promote difficult-to-type and problematic-to-display characters to the > > status of standard "working characters". > The problems aren't that serious. Display problems are limited to obsolete > environments that hardly anybody uses .... Is that right? How many people is that, then? The answer is you haven't a clue. You haven't even a clue how many people in total use Emacs. None of us has, and neither has anybody else. It seems to me, judging by the number of questions relating to Emacs on the Linux console I've answered over the years, the number of users is not small. And "obsolete" these environments are not. They're useful, and they're used. > ... because they're so awful, ... Actually, I happen rather to like them. I believe RMS does, too. There are several advantages the console has over a GUI, even assuming both are available (which they aren't always). Logically, if you're doing pure text work, a GUI is going to have lots of irrelevant graphicsy things which are just going to get in the way. One example is window managers taking M- away from Emacs. Yes, I know there are workarounds for this. > ... and even there we have workarounds. Workarounds are by their very nature second rate. As competent hackers, we should be finding solutions rather than workarounds. > And typing problems aren't a big deal in my Emacs environment: for left > and right single quotes I normally type a single keystroke, without any > control or shift or meta keys. (This is because I use Electric Quote > mode.) Other typing environments are also available that work nearly > as well (using Alt-[ and Alt-] for the two characters, if your Alt key > works). It doesn't. Last time I checked, the Alt key wasn't in use at all in standard Emacs. It would be easy enough to introduce an Alt in GNU/Linux, there's no shortage of silly keys around, but it would be more problematic in MS-Windows, where the silly keys are already in use. And things like Electric Quote mode will only work inside Emacs. But we've talked about that before. > I'm not expecting everyone to use these keyboard methods right away. > There will be a transition period, and perhaps other, better methods of > dealing this will emerge. However, there should be no obstacle to > people who do want to use those methods. > > I have a feeling you're intending to argue for making the use of curly > > quotes in our Lisp files standard. > Yes, of course. It should be normal to type quotes as themselves in doc > strings. It's basic WYSIWYG. My entire argument over the last several posts has been about upholding WYSIWYG. > > Anyway, here's another idea for making curly quotes in lisp code > > optional: an escaped 0x27 or 0x60 in a string should be translated by the > > reader to the appropriate ASCII or curly quote, depending on the user's > > configuration. So a doc string might contain this: > > \`foo-bar\' > I considered doing that, but there were problems. First, it would make doc > strings harder to read. For example, this: > "Setting this attribute will also set the \`:family\', > \`:foundry\', \`:width\', \`:height\', \`:weight\', and > \`:slant\' attributes." > is harder to read than this: > "Setting this attribute will also set the ‘:family’, ‘:foundry’, > ‘:width’, ‘:height’, ‘:weight’, and ‘:slant’ attributes." Only marginally harder. We routinely cope with \" and \n and so on inside strings without problems. \' and \` are no harder. And the number of strings with lots of single quoted symbols on a line is going to be quite small. > Second, the new escapes would cause mental overload with similar > already-existing uses (e.g., ?\`, "\\`"). We cope fine with ?\" in code and \" in strings. The mental overload for the corresponding ` and ' cases will be no higher. And, most importantly, it will be confined to the source code. When reading the doc strings with C-h f/v, the backslashes wouldn't be there. > Third, and most serious, is that the new escapes would mean that string > literals are not constants but are instead expressions whose values > depend on runtime context, and this would affect everything: how the > byte-compiler works, for example. No, not at all. My proposition is that string literals remain constants just as they are now. The decision would be made at configuration time, and a trivial #ifdef in the reader would decide at build time how to expand the escaped quotes. The necessary change took me less than 20 minutes, having started with no familiarity of the reader: --- lread.c 2015-06-08 12:54:35.000000000 +0000 +++ lread.c.acm 2015-06-10 17:58:01.000000000 +0000 @@ -2350,6 +2350,13 @@ return i; } +#ifdef WITH_CURLY_QUOTES + case '\'': + return '?'; + case '`': + return '?'; +#endif + default: return c; } . As always, forgive me not having the requisite keys to type the actual curly quote characters in the above. > To avoid the most serious problem, I considered a simpler idea: have the Lisp > reader treat \` and \' as curved single quotes in strings. However, this still > has the basic problem of being hard to read. It is needless work to add a > hard-to-read and nearly-ubiquitous feature merely to cater to obsolete > platforms. It's simpler to use quote characters to represent themselves. By "obsolete platforms" you just mean ones you yourself don't like, I think. I believe it's a tradition that when retiring obsolete OS support from Emacs, a single dissenting voice is sufficient to "rescue" an OS from being dropped. The same should apply here. Emacs on the Linux console is used. Gratuitously damaging functionality on supported platforms is not something to be done lightly, particularly when there's an easy, if tedious, way to carry on supporting them properly. The whole ethos of Emacs is about being able to set it up to suit personal preferences. I'm anxious that this continue. As noted before you are proposing a massive philosophical change from pure ASCII (modulo a few "display characters") source to (presumably unrestricted) Unicode. The number of unicode characters you want to insert is in the tens of thousands. > > Again, I think the only justification for the change you've given is that > > you personally don't like the look > It's not just me personally. The rest of the world has moved on. Much of the world might well have moved, but that's not grounds for allowing ourselves to be dragged along with it. If we allowed popularity to be the deciding criterion for making our decisions, we'd all be using MS-Windows. > At this point when outsiders look at Emacs they see mysterious and > inappropriate and off-putting quoting. And this sort of thing has been > happening for a while. See, for example: > http://www.trilithium.com/johan/2005/07/quotation-marks/ One person doesn't like 0x60 and 0x27 as quote marks. So? Follow my suggestion above, and he can configure his Emacs with --with-curly-quotes (or, more likely, just allow the default to take its course). And if he neither uses Emacs nor intends to, of what value are his opinions in this thread? -- Alan Mackenzie (Nuremberg, Germany).