From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master c4151eb: Improve the optional translation of quotes Date: Thu, 25 Jun 2015 15:52:35 +0300 Message-ID: <558BF993.2010105@yandex.ru> References: <20150619073901.5856.32718@vcs.savannah.gnu.org> <55870BD2.6040706@yandex.ru> <558716E9.30903@cs.ucla.edu> <55871721.5060709@yandex.ru> <55871883.7080600@cs.ucla.edu> <55871E96.2020506@yandex.ru> <558722C0.5040702@cs.ucla.edu> <55874E55.4020501@yandex.ru> <5587B029.5000503@cs.ucla.edu> <55882522.3030305@yandex.ru> <5588F071.7030501@cs.ucla.edu> <55893B2D.40506@yandex.ru> <558A3F12.3080005@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435236791 6903 80.91.229.3 (25 Jun 2015 12:53:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 12:53:11 +0000 (UTC) To: Paul Eggert , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 25 14:52:58 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 1Z86eI-0002r8-BV for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2015 14:52:58 +0200 Original-Received: from localhost ([::1]:55595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z86eH-0007eh-1q for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2015 08:52:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z86eB-0007bT-4B for emacs-devel@gnu.org; Thu, 25 Jun 2015 08:52:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z86e7-00059l-RA for emacs-devel@gnu.org; Thu, 25 Jun 2015 08:52:51 -0400 Original-Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:34050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z86e7-00056y-KU for emacs-devel@gnu.org; Thu, 25 Jun 2015 08:52:47 -0400 Original-Received: by wicnd19 with SMTP id nd19so17017658wic.1 for ; Thu, 25 Jun 2015 05:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=asLSf0qaMQqgSChBbPhjmSxyUP6e1CSE65S8cUgAXxw=; b=u1njRI2BPJkkJNQrd9D3KE41+LK/RAMrD3ZeL/RIAseRQT6bFbwtlEiXHTLnHyIU2b CvaI7XX+tjn7hOcW0zTGGuy4QyZYLhaWH5R46cHTHG1Ejdg4pbSGhi1ccFtgxLO4xnPc h/Anuml5rWW8rE3gwGi2DPI/SN41ZwZiZdkopGfOzxAL/3Uv8O8GAGV+Jrp6Xph7JSEw t3n1AjOO8lpmV52uRpSYM+SxmVwPtRjgOU+JlzI8krq83K3DSZsCAPkoxqZyuCkLNu33 uRVI63jAmXeuj6Z5ordkZWmFxt7ETqhk0CiF6MofY+m8ZChC5WxKtgjt7Wm28YGmfWU1 eqpw== X-Received: by 10.194.11.73 with SMTP id o9mr71536296wjb.116.1435236757328; Thu, 25 Jun 2015 05:52:37 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id a9sm7492968wiv.13.2015.06.25.05.52.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 05:52:37 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <558A3F12.3080005@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::235 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:187512 Archived-At: On 06/24/2015 08:24 AM, Paul Eggert wrote: > As I mentioned earlier I never fully understood the font-lock proposal. > I could not easily decipher most of the abovementioned message. Asking questions might help. I can't help but feel frustrated that you haven't made an informed decision. See the bottom of this email for the patch against f743819 (which was the version in master at the time). It only adds one line, the one I've mentioned in that message. I'm not sure what more to explain, but the undesirable effect you've seen was due to http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntactic-Font-Lock.html > Luckily, though, the abovementioned message briefly mentioned not using > font-locking and said of it "...but indeed, this approach could be the > simpler one." -- an assessmeent that seemed sound to me -- and so I took > the simpler approach. I did say that, tentatively, and I've changed my mind since. - Using font-lock will allow to change the output significantly in the future, without breaking the substitute-command-keys API. - This functionality is closely related to linkification of identifiers between the quotes, also performed in Lisp (see the usages of help-xref-symbol-regexp). If substitute-command-keys handles escapes, help-xref-symbol-regexp (and the function using it) don't know whether a given quote was escaped or not). Especially if the source file can contain curly quotes, and substitute-command-keys also translates into them. - "too tempting to implement complicated heuristics that would have been a pain to document" is not a good argument not to do something in a high-level language. Now, there are still problems with that patch: - It doesn't handle escaping either. Someone just needs to pick the escaping syntax, and we can handle it in Lisp just as well as in C. Why did we decide that "\\" isn't good enough? - Like you said: "describe-variable should curve the quotes in the doc string, but not in the contents of the variable". The code that prints the value will need to add some text property to it ("verbatim"? "font-lock-ignore"?), and the font-lock rule can look it up and skip those regions. Nothing too hard.