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 17:56:03 +0300 Message-ID: <558C1683.3030302@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> <558BF993.2010105@yandex.ru> <558C0A90.1040107@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: 8bit X-Trace: ger.gmane.org 1435244200 5069 80.91.229.3 (25 Jun 2015 14:56:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 14:56:40 +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 16:56:35 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 1Z88Zu-0001sI-5C for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2015 16:56:34 +0200 Original-Received: from localhost ([::1]:56105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z88Zt-0006ey-8T for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2015 10:56:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z88Zf-0006eZ-Uk for emacs-devel@gnu.org; Thu, 25 Jun 2015 10:56:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z88Za-0000V0-UT for emacs-devel@gnu.org; Thu, 25 Jun 2015 10:56:19 -0400 Original-Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:37904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z88Za-0000SE-Ni for emacs-devel@gnu.org; Thu, 25 Jun 2015 10:56:14 -0400 Original-Received: by wibdq8 with SMTP id dq8so78581668wib.1 for ; Thu, 25 Jun 2015 07:56:05 -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=iYjiCyem0TZdXGUj/RtG8APtQ5Ttg0gxpX33uQ+gxqQ=; b=qErIGCo0fT6HgZULovP2aEj3Z1GRrr5FoRHpFwOMmrwzMGWT32mY3XQfNEvRTO9cX0 hEDua54Na49E+Z75a6Kl6j1qa7xI4FtqSlztsN23juSAJDQeWHfwKXyQORe76WMCwoRQ hmVpV2fN5o9xcaZI36zodbg8UQCRitSVNYQqjlfWmTyifHh5lC7RrEBwiGKv7XSMZCim HCPuNBKcwwcDaf8K9JPdHu73q999+6dDDzlEwYCc9Im5TxRtY5gZN3s0E3EDQbx5dXAK 3EFGxpQpzsGkYxiqjk9Me22joJ33lCalcTeLKmBskWEV7CGpzOsITHyn/3wP6KpbJRg7 4nAQ== X-Received: by 10.194.246.105 with SMTP id xv9mr14401301wjc.135.1435244165472; Thu, 25 Jun 2015 07:56:05 -0700 (PDT) Original-Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id hn7sm46115070wjc.16.2015.06.25.07.56.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 07:56:05 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <558C0A90.1040107@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::233 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:187516 Archived-At: On 06/25/2015 05:05 PM, Paul Eggert wrote: > I didn't see any patch in that email, unfortunately -- perhaps you > forgot to include it? Sorry, it's attached now. > True. But it's still a temptation we should strive to avoid. Depends on what we call complicated. Like Richard mentioned, at least we can try to leave unpaired quotes alone. Or not, I don't really care that much personally. >> - 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. > > As you'll recall, I don't understand font-lock. There's no requirement for you to implement all of it yourself. You can take my patch, look for problems, and ask for them to be fixed. You'll have to do the substitute-command-keys part, though. > That being said, I > worry that all this stuff would be complicated and would involve using > undocumented or poorly-documented features (see Bug#20613). I've enumerated practical considerations of having it implemented *not* in font-lock. If some font-lock features lack documentation, demand it to be added, then. > Also, it's not clear how the overall approach would work on limited > displays that don't have alternate fonts and/or colors. Suppose, for > example, that the user is running 'emacs --color=never' on a character > terminal? diff --git a/lisp/help-mode.el b/lisp/help-mode.el index f99e916..6256513 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -287,6 +287,13 @@ Commands: \\{help-mode-map}" (set (make-local-variable 'revert-buffer-function) 'help-mode-revert-buffer) + (setq font-lock-defaults '(nil t)) + (font-lock-add-keywords + nil '(("`\\([^[:space:]'`‘’][^'`‘’]*\\)?'" + . (0 (progn (compose-region (match-beginning 0) + (1+ (match-beginning 0)) ?‘) + (compose-region (1- (match-end 0)) (match-end 0) ?’) + nil))))) (set (make-local-variable 'bookmark-make-record-function) 'help-bookmark-make-record))