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 9d35bb8: Fix minor quoting problems in doc strings Date: Wed, 20 May 2015 04:16:46 +0300 Message-ID: <555BE07E.8090209@yandex.ru> References: <20150519220123.30678.22605@vcs.savannah.gnu.org> <555BB96F.3050700@yandex.ru> <555BC4BD.1030207@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 1432084638 23336 80.91.229.3 (20 May 2015 01:17:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 May 2015 01:17:18 +0000 (UTC) To: Paul Eggert , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 20 03:17:14 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 1YusdG-0005Sq-Jh for ged-emacs-devel@m.gmane.org; Wed, 20 May 2015 03:17:14 +0200 Original-Received: from localhost ([::1]:49498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YusdF-0003GK-PM for ged-emacs-devel@m.gmane.org; Tue, 19 May 2015 21:17:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yusd3-0003GF-TF for emacs-devel@gnu.org; Tue, 19 May 2015 21:17:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yusd0-0000KI-GZ for emacs-devel@gnu.org; Tue, 19 May 2015 21:17:01 -0400 Original-Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:34367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yusd0-0000GM-8u for emacs-devel@gnu.org; Tue, 19 May 2015 21:16:58 -0400 Original-Received: by wghq2 with SMTP id q2so36358204wgh.1 for ; Tue, 19 May 2015 18:16:48 -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=CNm0/dGBZ8Y+oIQh71OQYwlciUbhP1tDgR9GUoAUxzo=; b=ynscOGZ4IWhGdpqWD3qVH4uQiG82rNVHaFWOupyywz0m+79TNSLfxcpFxQbjjP301w VemFwEXGM64sa1y0ikoPRSYjOd4Cnj+4+pHUUuiXWoa/206Sx5ajgZyfCfgOT5PdPppt 77RW8sUAIQUcnu5IBXR5a2DTl5UolMrtlMhWU17yqW4xmyMFvWkXZuPXB0GSV6OOIWcd ck6BMz2GlA8hP1zT1Algbg7dkni7rp91Nr6ME5MOLJms/KQ36YuQzT40TUmeJJx48Zov sOe2X0LMvQqSQG7/R3oNFvC3UwxlTpt1GXxfrHoEvi5elwIf+GZQaG7CwBKGFLPmwqqV LzQQ== X-Received: by 10.180.11.196 with SMTP id s4mr36737764wib.43.1432084608243; Tue, 19 May 2015 18:16:48 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id be6sm24195518wjb.14.2015.05.19.18.16.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 18:16:48 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <555BC4BD.1030207@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22c 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:186637 Archived-At: On 05/20/2015 02:18 AM, Paul Eggert wrote: > The problem they're trying to address is that one can't reasonably > expect a regular expression to handle cases where grave accent or > apostrophe is itself being quoted `like this'. Those two cases look simple (replace ` and the first matching ', the second ` would be skipped), but if the apostrophe were quoted, it'd have to be escaped: `\''. And it's not very simple, but a regular expression can distinguish between an escaped and an unescaped character. Examples: https://github.com/emacs-mirror/emacs/blob/9d35bb8d6518bb913ab08bace2af08963c003177/lisp/progmodes/js.el#L1698 https://github.com/emacs-mirror/emacs/blob/9d35bb8d6518bb913ab08bace2af08963c003177/lisp/progmodes/xref.el#L757 Though granted, that's a lot of backslashes. > Another possibility, which would also be fine and would be simpler, > would be to replace all curved double quotes in doc strings with > straight double-quotes. I could easily do that if you prefer; it's no > big deal either way. Not a big deal indeed, but consistency would be preferable IMHO.