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: Escaping quotes in docstrings, Was: A simple solution to "Upcoming loss of usability ..." Date: Sun, 02 Aug 2015 08:13:51 -0700 Organization: UCLA Computer Science Department Message-ID: <55BE33AF.6080402@cs.ucla.edu> References: <87egkzg7gb.fsf@gmail.com> <558C2E25.10303@cs.ucla.edu> <558C492E.9000705@yandex.ru> <558C7DE1.4060507@cs.ucla.edu> <558C82D2.1070408@yandex.ru> <558CBA7E.7060900@cs.ucla.edu> <558D403D.303@yandex.ru> <558EDD4C.4040002@cs.ucla.edu> <558EE315.3080107@yandex.ru> <558F10FA.409@cs.ucla.edu> <558F4804.1020406@yandex.ru> <559010D6.5090905@cs.ucla.edu> <559058AD.5060504@yandex.ru> <55908355.3080407@yandex.ru> <559356D2.4000103@cs.ucla.edu> <5594813A.3000705@yandex.ru> <5594E0DB.1080702@cs.ucla.edu> <559A1C54.5030405@cs.ucla.edu> <559A6F86.2080809@yandex.ru> <559AAD27.3000403@cs.ucla.edu> <559AFCC3.3070409@yandex.ru> <559B85BE.4070303@cs.ucla.edu> <559B902D.4000906@yandex.ru> <55BC22BB.4020002@cs.ucla.edu> <55BD34B2.5060001@yandex.ru> <55BDBF2C.10000@cs.ucla.edu> <55BE1255.3040401@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 1438528462 10934 80.91.229.3 (2 Aug 2015 15:14:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 15:14:22 +0000 (UTC) To: Dmitry Gutov , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 02 17:14:13 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 1ZLuxo-0003dt-BT for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2015 17:14:12 +0200 Original-Received: from localhost ([::1]:56197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLuxn-0000Z9-37 for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2015 11:14:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLuxj-0000Z4-Tq for emacs-devel@gnu.org; Sun, 02 Aug 2015 11:14:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLuxg-0008Gn-Ng for emacs-devel@gnu.org; Sun, 02 Aug 2015 11:14:07 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLuxg-0008Gc-EH for emacs-devel@gnu.org; Sun, 02 Aug 2015 11:14:04 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 66E48160195; Sun, 2 Aug 2015 08:14:03 -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 888ocZBBYgcz; Sun, 2 Aug 2015 08:14:02 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 883F61601B7; Sun, 2 Aug 2015 08:14:02 -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 lJmlW4NWSjum; Sun, 2 Aug 2015 08:14:02 -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 61C0B160195; Sun, 2 Aug 2015 08:14:02 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: <55BE1255.3040401@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:188294 Archived-At: Dmitry Gutov wrote: > we have an escaping syntax! Yet, Elisp doesn't know what's escaped and = what > isn't, so even this won't help: > > (defun =E2=80=99=E2=80=98 (a b c) > "It's called `\\=3D=E2=80=99\\=3D=E2=80=98'." > (+ 1 2 3)) Again, this problem is independent of quoting style, and has long existed= in=20 Emacs evem with the older quoting style. For example: (defun \'\` (a b c) "It's called `\\=3D'\\=3D`'." (+ 1 2 3)) has even worse problems than the =E2=80=99=E2=80=98 example does (and the= se problems also exist=20 in older Emacs). > It's also a matter of readability. Take the latest related commit that = you > pushed. Sometime later, someone will come along and wonder: why do we n= eed to > substitute command keys in widget options? Who would put keys in there? That can be addressed by renaming the function to 'substitute-doc-string'= . >> this is not just because of curved quotes, but >> also because its other substitutions can generate characters that also >> need special treatment. > > You might want to give an example. (defun foo (a b c) "It's invoked by `\\[next-error]'." (+ 1 2 3)) > But in general, those characters also could > have `escaped' put on them. Or `substituted', for instance. Yes, and substituting \[...] has problems and solutions that are quite si= milar=20 to substituting ` and '. So even if it makes sense to tease this functio= nality=20 apart in some cases, it also makes sense to have a single function that d= oes=20 both subsitutions for convenience, as typically programs will not want to= do one=20 without doing the other. > As long as that task involves rearranging C code, you're excluding a si= gnificant > portion of Emacs developers from contributing, myself included. It's a simple-enough matter to add an argument to substitute-doc-string=20 specifying which kinds of substitutions are wanted. I can volunteer to d= o that=20 if it would be helpful (though I confess I don't see the use case). Or i= f you=20 prefer you can rewrite substitute-doc-string in Lisp -- as long as it doe= sn't=20 affect performance significantly that should be merely an implementation = detail. > as long as font-lock isn't used for translation (and we've pretty much > agreed that it won't), why wouldn't a Lisp solution work like you descr= ibe? I mentioned the possibility because it's still not clear to me what a Lis= p=20 solution would be, if it's not something involving font-lock. If the Lis= p=20 solution merely translates the existing C code to Lisp, then of course yo= ur=20 point is correct.