From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Regexp error scan (March 26) Date: Wed, 27 Mar 2019 13:09:07 +0100 Message-ID: References: <0E648A80-8673-44DB-B481-981474AC3D7C@acm.org> <77419a89-ce9f-919b-c221-c7a3b938587a@cs.ucla.edu> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="78389"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 27 13:13:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h97QU-000KGh-Dy for ged-emacs-devel@m.gmane.org; Wed, 27 Mar 2019 13:13:02 +0100 Original-Received: from localhost ([127.0.0.1]:46724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h97QT-0006bv-7j for ged-emacs-devel@m.gmane.org; Wed, 27 Mar 2019 08:13:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h97P6-0006YE-3K for emacs-devel@gnu.org; Wed, 27 Mar 2019 08:11:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h97Mx-0008VX-4H for emacs-devel@gnu.org; Wed, 27 Mar 2019 08:09:24 -0400 Original-Received: from mail156c50.megamailservers.eu ([91.136.10.166]:50628 helo=mail51c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h97Mw-0008Sn-8s for emacs-devel@gnu.org; Wed, 27 Mar 2019 08:09:23 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1553688549; bh=iExgk8JehrpqdLTfMjcG1/bmLNCvyKCdzDBTIw9Wc3E=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=Z4R7YL2/28LHxLNyB2nK1M6/yeIl0GgDPO1TNWhevDlVZ+2QqXsXPIbRrE0DG5QmW Psa13B3FXTIMO7ouIA3gKx7cUFgISgxzsk45kar2pcjKQsahXBHhohc/LxhyI2Z+yB 5jcj42OQrPD2sTPVmXg2/cD7xnlE52BwviwEhK0U= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail51c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x2RC97D9017449; Wed, 27 Mar 2019 12:09:09 +0000 In-Reply-To: <77419a89-ce9f-919b-c221-c7a3b938587a@cs.ucla.edu> X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B0202.5C9B67E5.00B6, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=a8seC3aF c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=pR3iE-kgKxtimttQZTMA:9 a=CjuIK1q_8ugA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:234766 Archived-At: 27 mars 2019 kl. 03.10 skrev Paul Eggert : > > Thanks, I installed the attached patch to try to fix those issues. Thank you, that was quick! - (concat (nth 2 (or (assq footnote-style footnote-style-alist) - (nth 0 footnote-style-alist))) - "*")) + (let ((regexp (nth 2 (or (assq footnote-style footnote-style-alist) + (nth 0 footnote-style-alist))))) + (concat + ;; Hack to avoid repetition of repetition. + (if (string-match "[^\\]\\\\\\{2\\}*[*+?]\\'" regexp) + (substring regexp 0 -1) + regexp) + "*"))) The repetition-of-repetition check is useful and has caught several actual errors; this may be the first true false positive that has to be hacked around. We could suppress the complaint if the inner repetition is wrapped in brackets, like \(?:a+\)*, but it would reduce the error-finding power of the check. In this case I'm not sure the added * makes sense at all; there is always a single number within the footnote-{start,end}-tag pairs. Worse, the code goes on and adds yet another + later on, in footnote-refresh-footnotes, just in case. That makes even less sense. Likely, both the * and the extra + should go away. - ("^[ \t]*\\(:root\\)\\(?:[\n \t]*\\)*{" (1 'css-selector keep)) + ("^[ \t]*\\(:root\\)\\(?:[\n \t]*\\){" (1 'css-selector keep)) Those brackets around the [\n \t] could go away, too.