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: A simple solution to "Upcoming loss of usability ..." Date: Sun, 28 Jun 2015 08:20:54 -0700 Organization: UCLA Computer Science Department Message-ID: <559010D6.5090905@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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000605010204000005040106" X-Trace: ger.gmane.org 1435504886 16308 80.91.229.3 (28 Jun 2015 15:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jun 2015 15:21:26 +0000 (UTC) To: Dmitry Gutov , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 28 17:21:18 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 1Z9EOU-0002FK-Ds for ged-emacs-devel@m.gmane.org; Sun, 28 Jun 2015 17:21:18 +0200 Original-Received: from localhost ([::1]:39209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9EOT-0000Uc-HZ for ged-emacs-devel@m.gmane.org; Sun, 28 Jun 2015 11:21:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9EOE-0000UU-MV for emacs-devel@gnu.org; Sun, 28 Jun 2015 11:21:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9EOB-0003fK-E9 for emacs-devel@gnu.org; Sun, 28 Jun 2015 11:21:02 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:43989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9EOB-0003eK-4a for emacs-devel@gnu.org; Sun, 28 Jun 2015 11:20:59 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4BA5A16026C; Sun, 28 Jun 2015 08:20:56 -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 cmILjb4be7DV; Sun, 28 Jun 2015 08:20:55 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7B4B2160821; Sun, 28 Jun 2015 08:20:55 -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 Ku_LLi4t8zO5; Sun, 28 Jun 2015 08:20:55 -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 5A8F816026C; Sun, 28 Jun 2015 08:20:55 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <558F4804.1020406@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:187615 Archived-At: This is a multi-part message in MIME format. --------------000605010204000005040106 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Dmitry Gutov wrote: >> > > Ok, try this, please. "\\" before a quote keeps it untranslated. > > However, it order for us to be able to show an arbitrary number of back= slashes > before a quote (both translated or not), the backslashes also escape th= emselves. > I've limited this effect to only before a quote, so that we don't have = to add > them in a lot of places (like substitute-command-keys docstring). That rule is too complicated. Please let's keep it simple. It's simpler= to=20 explain if the escape sequence always works. It should be rare to need t= hese=20 escapes, so it's OK if they are multicharacter. How about your other sug= gestion=20 of using backslash-tilde? This would be \\~ in the source-file string. = This is=20 unlikely to occur in docstrings; there are no occurrences in the current = Emacs=20 sources. > +Quote \\'like this\\' if the value is ?\\' (apostrophe). > ... > +Quote \\`like this\\' if the value is ?\\` (grave accent). There should be no need to escape the apostrophes in these lines (see the= next=20 comment). > + nil '(("\\(?:\\=3D\\|[^\\]\\)\\(\\\\*\\)[`']" First, this translates all apostrophes to quotes. It should translate on= ly the=20 apostrophes that are used as quotes (i.e., those that match grave accents= ).=20 That's what the current master does, and what your earlier prototype did.= We=20 shouldn't try to second-guess unmatched apostrophe, any more than we shou= ld try=20 to second-guess double-quote. Second, the last bracketed RE should be [`'=E2=80=98=E2=80=99] if we are = to mimic the=20 current-master behavior. (However, please see the next comment.) > + ((or (and (null help-quote-translation) > + (char-displayable-p ?=E2=80=98)) > + (eq help-quote-translation ?=E2=80=98)) As I understand it, the need for help-quote-translation has gone away, si= nce the=20 primary impetus for it was that one couldn't easily search for quotes, an= d that=20 problem has been fixed in the meantime by Artur's commits. So this part = can be=20 simplified and the code can always assume that the above expression evalu= ates to=20 t. (This is also true of the current master of course.) > 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 gra= ve and=20 apostrophe, which should not be translated when one types =E2=80=98C-h v = foo=E2=80=99. PS. Can you please attach patches instead of pasting them bodily into yo= ur=20 email? I could not apply the patch in your email automatically, as some=20 characters were munged somewhere in the process. --------------000605010204000005040106 Content-Type: text/x-emacs-lisp; name="`big deal'.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="`big deal'.el" (defvar foo "`xxx-yyy' \\`zzz-www' \\~`aaa-bbb\\~'" "Don't ask me what this variable does.") --------------000605010204000005040106--