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: Escaping quotes in docstrings, Was: A simple solution to "Upcoming loss of usability ..." Date: Sun, 28 Jun 2015 23:27:25 +0300 Message-ID: <559058AD.5060504@yandex.ru> 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> 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 1435523267 23702 80.91.229.3 (28 Jun 2015 20:27:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jun 2015 20:27:47 +0000 (UTC) To: Paul Eggert , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 28 22:27:47 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 1Z9JB4-0007CU-EO for ged-emacs-devel@m.gmane.org; Sun, 28 Jun 2015 22:27:46 +0200 Original-Received: from localhost ([::1]:39819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9JB3-0007Pe-TP for ged-emacs-devel@m.gmane.org; Sun, 28 Jun 2015 16:27:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9JB0-0007PS-Oh for emacs-devel@gnu.org; Sun, 28 Jun 2015 16:27:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9JAu-0005An-Cb for emacs-devel@gnu.org; Sun, 28 Jun 2015 16:27:42 -0400 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:36904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9JAu-0005AA-3H for emacs-devel@gnu.org; Sun, 28 Jun 2015 16:27:36 -0400 Original-Received: by wicgi11 with SMTP id gi11so55887273wic.0 for ; Sun, 28 Jun 2015 13:27:30 -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=1mRM73KpCpjevH6LqQCW4vN59dPv3t+WhkMm6MVHwao=; b=RAb3hBKNUckq7TuL9Bbhz/ABOOLz0UBFqi0qoaXN3i24d69Zg42jZnE5/ghs/VmaZd 5Yoehv98Y4w089zQhCmPAgQmQWIXPuy3qmRe6L56y+W+13fuXRAScjVrv8drXrhC6oCr eQkV7dgRDiB4R1+xosnFoxaocHRhGJtzqu1OQZR2KfHVgokviSln4Kuf7SpGPAjLrwPq QOjN+g3yILWwwwsJpypM2ZlmdaciYIeb7BFOoLvixoZjoqWwFm8kqyAsRgfk5lMmy86M w2xRxu2YMJ81Z5+HbpCTga6Mht1AnOpWjREiOKpQFQCNkT0CoefJu2t1DV8SwuT7UN+R zK1g== X-Received: by 10.180.75.4 with SMTP id y4mr15756831wiv.1.1435523250508; Sun, 28 Jun 2015 13:27:30 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id az1sm9307219wib.0.2015.06.28.13.27.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 13:27:30 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <559010D6.5090905@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::236 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:187624 Archived-At: On 06/28/2015 06:20 PM, Paul Eggert wrote: > That rule is too complicated. Please let's keep it simple. It's > simpler to explain if the escape sequence always works. It should be > rare to need these escapes, so it's OK if they are multicharacter. Well, if you think so. > How > about your other suggestion of using backslash-tilde? This would be \\~ > in the source-file string. This is unlikely to occur in docstrings; > there are no occurrences in the current Emacs sources. I remember Stefan disliking \\=. But okay, let's try this one. >> + nil '(("\\(?:\\=\\|[^\\]\\)\\(\\\\*\\)[`']" > > First, this translates all apostrophes to quotes. It should translate > only the apostrophes that are used as quotes (i.e., those that match > grave accents). That's what the current master does, and what your > earlier prototype did. We shouldn't try to second-guess unmatched > apostrophe, any more than we should try to second-guess double-quote. You expressed dislike for "action at a distance" and wanted a simple translation, so there it was. Ok, let's try matching. > Second, the last bracketed RE should be [`'‘’] if we are to mimic the > current-master behavior. (However, please see the next comment.) There's no technical difficulty there, but I don't want to see curly quotes used as markup. And if we also want to translate them to help with terminals that can't display curlies, the translation should affect all curlies, not just the markup ones (so we can't limit it to paired quotes, or unescaped ones). > As I understand it, the need for help-quote-translation has gone away, > since the primary impetus for it was that one couldn't easily search for > quotes, and that problem has been fixed in the meantime by Artur's > commits. So this part can be simplified and the code can always assume > that the above expression evaluates to t. (This is also true of the > current master of course.) IIUC, there was also a problem with some terminals that can't display them, and also users that would prefer not to see them in Help. Maybe we can disregard the latter, at least for now. >> I meant an example of a Help buffer where we must not translate quotes >> in the value. > > Ah, OK, try loading the attached file. The file name contains accent > grave and apostrophe, which should not be translated when one types ‘C-h > v foo’. Thanks. The last patch seems to successfully deal with it already. > PS. Can you please attach patches instead of pasting them bodily into > your email? I could not apply the patch in your email automatically, as > some characters were munged somewhere in the process. Ok. But I'd rather push to the scratch/quote-escaping branch, if you don't mind.