From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#24914: 24.5; isearch-regexp: wrong error message Date: Mon, 4 Dec 2017 19:15:42 -0800 (PST) Message-ID: References: <7c208ac0-8aa2-4db8-a38d-760f91c50500@default> <87h8t7ix7m.fsf@users.sourceforge.net> <87d13visrh.fsf@users.sourceforge.net> <87shcrgg8g.fsf@users.sourceforge.net> <87h8t6gegl.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1512443838 18499 195.159.176.226 (5 Dec 2017 03:17:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Dec 2017 03:17:18 +0000 (UTC) Cc: 24914@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 05 04:17:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eM3jJ-0004Nz-7k for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Dec 2017 04:17:09 +0100 Original-Received: from localhost ([::1]:46180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eM3jQ-0006n8-6t for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Dec 2017 22:17:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eM3jF-0006f1-M4 for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2017 22:17:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eM3jC-0004UH-EB for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2017 22:17:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eM3jC-0004UB-92 for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2017 22:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eM3jB-0004XU-Ua for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2017 22:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Dec 2017 03:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24914 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 24914-submit@debbugs.gnu.org id=B24914.151244376717379 (code B ref 24914); Tue, 05 Dec 2017 03:17:01 +0000 Original-Received: (at 24914) by debbugs.gnu.org; 5 Dec 2017 03:16:07 +0000 Original-Received: from localhost ([127.0.0.1]:46233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eM3iJ-0004WF-9W for submit@debbugs.gnu.org; Mon, 04 Dec 2017 22:16:07 -0500 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:41750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eM3iH-0004VS-8E for 24914@debbugs.gnu.org; Mon, 04 Dec 2017 22:16:05 -0500 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.21/8.16.0.21) with SMTP id vB53C6kO005885; Tue, 5 Dec 2017 03:15:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=02BZPAQ4+wjTGtevqLhseuToEfmXYHsFK37QgmKv6Ng=; b=CLLTtWyH0dCPMZTM9i5xufMhJFD9c9JS2Clfv+rZf6m1qGm6GNZWcCfcZmA3eUFZ2RYU NdA5BvHiZW/tL959/aOIKEabrZKNMYcGpetGHh5wb8uDG0IWsmmtzCQ0BCapRixXN9E8 qYcgqF0RApZxe5fnrNS+E1Xz0HA3KIBGDGE4057j9WYZ594AAKK+2Sxw5UVjXH/kZMRV mmb2yjf5L3ZFJEutUQ8o2vJqc461z48d4u+IwMoyvB0onl9Mt0apTnFo8ETMWcgo+jr+ WJa9ua4UKwOSmE3eA88KWPsrXPhDFd3AkhCMiv8+IzXTIFGCBlKf/9BH2IUs7XvSdplb LQ== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2enc2g11pr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Dec 2017 03:15:58 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vB53FvOC023358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Dec 2017 03:15:58 GMT Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vB53FvKf005701; Tue, 5 Dec 2017 03:15:57 GMT In-Reply-To: <87h8t6gegl.fsf@users.sourceforge.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4615.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8735 signatures=668637 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712050045 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140713 Archived-At: > > What I cited are cases where we do flag _particular kinds_ > > of invalid regexps, and so tailor the error msg. >=20 > I'm not sure if you're citing actual code we have right now, or just > some hypotheticals. In isearch.el, we pretty much do the opposite of > tailor the error message. I was citing what I thought were such cases in the current isearch.el code - cases where we do not just say "Invalid Regexp". We say things like this: Too many words Too many spaces for whitespace matching Unmatched [ or [^ Granted, the last is used only in `isearch-query-replace. My point was that in some existing cases (not many, admittedly), we do try to give a more precise error message when signal `invalid-regexp' is detected. But I'm not sure what you're arguing, if you are arguing. Certainly we don't tailor the message _much_ for the kind of `invalid-regexp'. But we do make some effort to do that, even now, AFAICT. > >> Actually, I'm wondering what's the point of isearch showing > >> "incomplete" instead of the actual regexp invalid error. > >> I.e., why not instead of > >> > >> \ [incomplete] > >> \{ [incomplete] > >> \{4 [incomplete] > >> \{4000 [incomplete] > >> \{4000\ [incomplete] > >> \{4000\} > >> > >> show this: > >> > >> \ [Trailing backslash] > >> \{ [Unmatched \{] > >> \{4 [Unmatched \{] > >> \{4000 [Unmatched \{] > >> \{4000\ [Trailing backslash] > >> \{4000\} >=20 > I meant just the following patch, you can try it out easily: > (invalid-regexp > (setq isearch-error (car (cdr lossage))) > (cond > - ((string-match > -=09"\\`Premature \\|\\`Unmatched \\|\\`Invalid " > -=09isearch-error) > - (setq isearch-error "incomplete input")) > ((and (not isearch-regexp) > =09 (string-match "\\`Regular expression too big" isearch-error)) > (cond You mean show "[Invalid content of \{\}]" in all cases? _Never_ show "[incomplete input]"? Why would that be better? Anyway, I don't have a strong opinion about that. I do think that in the case reported it's too bad that we say "[incomplete input]". But I don't think it follows that it would be more helpful to most users to show the invalid-regexp description in cases where Emacs can really tell that the input is necessarily incomplete. I suspect that it is quite common for that "incomplete input" message to be helpful.