unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
To: 20806@debbugs.gnu.org
Subject: bug#20806: 25.0.50;  `string-match' is confused???
Date: Sun, 14 Jun 2015 00:29:18 +0530	[thread overview]
Message-ID: <557C7D86.9070902@gmail.com> (raw)
In-Reply-To: <557BF8E9.9040007@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

On Saturday 13 June 2015 03:03 PM, Vaidheeswaran C wrote:

> Here is how I ended up with this bug.
> 
> Debugger entered--Lisp error: (error "Regexp cannot match an empty string")
>   signal(error ("Regexp cannot match an empty string"))
>   error("Regexp cannot match an empty string")
>   hi-lock-regexp-okay("\\(.*\\)")
>   byte-code("\300\301\302\303\"!\304 D\207" [hi-lock-regexp-okay
> read-regexp "Regexp to highlight" regexp-history-last
> hi-lock-read-face-name] 4)
>   call-interactively(highlight-regexp nil nil)
>   command-execute(highlight-regexp)
> 


The attached patch solves the above issue.  I hope it is OK.

(Stupid me got the title wrong.  Apologies.)

[-- Attachment #2: 0001-lisp-hi-lock.el-hi-lock-regexp-okay-Minor-change.patch --]
[-- Type: text/x-patch, Size: 683 bytes --]

From dd0786d3caa8ca83276dbc8ecd363c590cbccdbb Mon Sep 17 00:00:00 2001
From: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
Date: Sat, 13 Jun 2015 15:48:10 +0530
Subject: [PATCH] * lisp/hi-lock.el (hi-lock-regexp-okay): Minor change

---
 lisp/hi-lock.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 0255585..deb827c 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -658,7 +658,7 @@ not suitable."
   (cond
    ((null regexp)
     (error "Regexp cannot match nil"))
-   ((string-match regexp "")
+   ((string= regexp "")
     (error "Regexp cannot match an empty string"))
    (t regexp)))
 
-- 
1.7.10.4


  reply	other threads:[~2015-06-13 18:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13  9:33 bug#20806: 25.0.50; `string-match' is confused??? Vaidheeswaran C
2015-06-13 18:59 ` Vaidheeswaran C [this message]
2015-06-14 20:18   ` Stefan Monnier
2015-06-13 19:21 ` Andreas Schwab
2015-06-13 22:58 ` Michael Heerdegen
2015-06-14 13:40 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=557C7D86.9070902@gmail.com \
    --to=vaidheeswaran.chinnaraju@gmail.com \
    --cc=20806@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).