From 121f8c95b2925f9bb4d65a7076c8024d474adb11 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 28 Aug 2013 19:33:02 +0300 Subject: [PATCH] * lisp/isearch.el (isearch-search): Change regexp error message for non-regexp searches. Fixes: debbugs:15166 --- lisp/ChangeLog | 5 +++++ lisp/isearch.el | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 31533b92a99..efd6d7b3fac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-08-28 Juri Linkov + + * isearch.el (isearch-search): Change regexp error message for + non-regexp searches. (Bug#15166) + 2013-08-28 Paul Eggert * Makefile.in (SHELL): Now @SHELL@, not /bin/sh, diff --git a/lisp/isearch.el b/lisp/isearch.el index 32de931954f..58f50eb9054 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2784,10 +2784,18 @@ update the match data, and return point." (invalid-regexp (setq isearch-error (car (cdr lossage))) - (if (string-match - "\\`Premature \\|\\`Unmatched \\|\\`Invalid " - isearch-error) - (setq isearch-error "incomplete input"))) + (cond + ((string-match + "\\`Premature \\|\\`Unmatched \\|\\`Invalid " + isearch-error) + (setq isearch-error "incomplete input")) + ((and (not isearch-regexp) + (string-match "\\`Regular expression too big" isearch-error)) + (cond + (isearch-word + (setq isearch-error "Too many words")) + ((and isearch-lax-whitespace search-whitespace-regexp) + (setq isearch-error "Too many spaces for whitespace matching")))))) (search-failed (setq isearch-success nil) -- 2.39.2