From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagnostics Date: Tue, 18 Aug 2015 23:28:32 -0700 Organization: UCLA Computer Science Department Message-ID: <55D42210.9070703@cs.ucla.edu> References: <20150816160149.9416.80132@vcs.savannah.gnu.org> <55D1043C.3030909@yandex.ru> <55D15899.2070105@cs.ucla.edu> <55D1C9CE.2060407@yandex.ru> <55D20EDF.5070906@cs.ucla.edu> <55D223CA.4080109@yandex.ru> <55D22A1F.8040508@cs.ucla.edu> <55D22CF4.9030608@yandex.ru> <55D2747D.10809@cs.ucla.edu> <55D317A9.6000805@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1439965746 9706 80.91.229.3 (19 Aug 2015 06:29:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Aug 2015 06:29:06 +0000 (UTC) To: Dmitry Gutov , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 19 08:28:57 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZRwrf-0002tI-HP for ged-emacs-devel@m.gmane.org; Wed, 19 Aug 2015 08:28:47 +0200 Original-Received: from localhost ([::1]:60652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRwrZ-0007mQ-Pd for ged-emacs-devel@m.gmane.org; Wed, 19 Aug 2015 02:28:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRwrW-0007mL-OV for emacs-devel@gnu.org; Wed, 19 Aug 2015 02:28:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRwrT-0005HS-CA for emacs-devel@gnu.org; Wed, 19 Aug 2015 02:28:38 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRwrT-0005Ge-1z for emacs-devel@gnu.org; Wed, 19 Aug 2015 02:28:35 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D0ABD160D1E; Tue, 18 Aug 2015 23:28:33 -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 7Q4YP505aG4V; Tue, 18 Aug 2015 23:28:33 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 000FF160D22; Tue, 18 Aug 2015 23:28:32 -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 aeyW-PZAWY4g; Tue, 18 Aug 2015 23:28:32 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C9A7B160D1E; Tue, 18 Aug 2015 23:28:32 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: <55D317A9.6000805@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188932 Archived-At: Dmitry Gutov wrote: > So yes, I think it's valuable. OK, thanks for reviewing; I installed the %q patch, and followed up with=20 simplifications that it allows at the C level, mostly by using %qs in for= mats=20 instead of uLSQM and uRSQM. This makes the C code easier to read and so = is a=20 clear win. Doing something similar in Elisp code makes the code harder t= o read,=20 though, so I held off on that. > two format sequences, one for opening quote, and one for closing. That > would be more cumbersome, though. Yes, it would be more cumbersome. Instead of the current: (message "Press =E2=80=98?=E2=80=99 or =E2=80=98h=E2=80=99 for help, =E2= =80=98q=E2=80=99 to quit") we would have something like: (message "Press % or % for help, % to quit") which is harder to read and is more error-prone. This less-readable appr= oach is=20 used in GCC's source code, which must port to old-fashioned C++ compilers= that=20 lack support for multibyte characters in strings. It is not needed for E= macs=20 Lisp, and we shouldn't insist on it there. >> Also, it wouldn't suffice for code like this: > > >> (insert (symbol-name type) >> (format " is a type (of kind =E2=80=98")) >> (help-insert-xref-button (symbol-name metatype) >> 'cl-help-type metatype) >> (insert (format "=E2=80=99)")) > > But this is not about diagnostic messages anymore, right? At the moment= , IIRC, > these situations are handled by substitute-command-keys (and there's no= need to > have curly quotes in the strings here). At the moment these situations are handled by =E2=80=98format=E2=80=99. = Simply changing the=20 code to use =E2=80=98substitute-command-keys=E2=80=99 and ASCII character= s would not work in=20 cases like the above, because (insert (substitute-command-keys "')")) wou= ld=20 insert an apostrophe regardless of user text-quoting preference. Of cour= se=20 there are workarounds but the workarounds are clumsy. (Also, the=20 ASCII-only-source approach would typically be a tad slower, which is anno= ying. :-) > text -> (substitute-command-keys) -> text with "escaped" text prop > -> (translate-quotes) -> text with non-escaped straight quotes re= places As mentioned above it's not obvious how to get that to work; even if we d= id so=20 it'd be more complicated and error-prone, and a bit slower. Hardly seems= worth it.