From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20806: 25.0.50; `string-match' is confused??? Date: Sun, 14 Jun 2015 09:40:33 -0400 Message-ID: References: <557BF8E9.9040007@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1434289285 26148 80.91.229.3 (14 Jun 2015 13:41:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Jun 2015 13:41:25 +0000 (UTC) Cc: 20806@debbugs.gnu.org To: Vaidheeswaran C Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 14 15:41:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Z489x-0002YD-Gm for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jun 2015 15:41:13 +0200 Original-Received: from localhost ([::1]:58729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z489w-0007Mo-Mn for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jun 2015 09:41:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z489s-0007Lu-Tg for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2015 09:41:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z489n-0002lo-GX for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2015 09:41:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z489n-0002le-7h for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2015 09:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z489m-0002VV-SK for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2015 09:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jun 2015 13:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20806 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20806-submit@debbugs.gnu.org id=B20806.14342892459602 (code B ref 20806); Sun, 14 Jun 2015 13:41:02 +0000 Original-Received: (at 20806) by debbugs.gnu.org; 14 Jun 2015 13:40:45 +0000 Original-Received: from localhost ([127.0.0.1]:53331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z489T-0002Um-6M for submit@debbugs.gnu.org; Sun, 14 Jun 2015 09:40:44 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:40139) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z489N-0002UQ-9q; Sun, 14 Jun 2015 09:40:38 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t5EDeXs7004305; Sun, 14 Jun 2015 09:40:34 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 44A5A66234; Sun, 14 Jun 2015 09:40:33 -0400 (EDT) In-Reply-To: <557BF8E9.9040007@gmail.com> (Vaidheeswaran C.'s message of "Sat, 13 Jun 2015 15:03:29 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5337=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5337> : inlines <3196> : streams <1455305> : uri <1958811> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103933 Archived-At: tags 20806 notabug thanks > Is an empty string a prefix of all strings or not? Yes, but that's unrelated to the uncaught signal you show, nor to the two string-match calls you show. > Welcome to the Emacs shell > /tmp $ (string-match "\\(.*\\)" "") > 0 Yup, we can find a trivial match for "\\(.*\\)" in the empty string. > /tmp $ (string-match "foo" "") And "foo" can't be found in the empty string. > Here is how I ended up with this bug. > Debugger entered--Lisp error: (error "Regexp cannot match an empty string") [...] > command-execute(highlight-regexp) And this is "not a bug but a feature". This could arguably be improved. E.g. it should probably call `user-error'. But highlight-regexp is simply telling you that it's not a good idea to try to highlight all the empty strings in your buffer: not only there are many (e.g. as many as point-max), but you wouldn't notice that they're highlighted anyway. Stefan