unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: 24914@debbugs.gnu.org
Subject: bug#24914: 24.5; isearch-regexp: wrong error message
Date: Sun, 03 Dec 2017 11:37:49 -0500	[thread overview]
Message-ID: <87h8t7ix7m.fsf@users.sourceforge.net> (raw)
In-Reply-To: <7c208ac0-8aa2-4db8-a38d-760f91c50500@default> (Drew Adams's message of "Wed, 9 Nov 2016 14:29:45 -0800 (PST)")

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

Drew Adams <drew.adams@oracle.com> writes:

> 3. C-M-s \(.\|^J\)\{,40000\}
>
> That shows the error message: [incomplete input], which is wrong, IMO.

The reason it doesn't work is because the number of repitions is limited
to 32767 (#x7fff).  Obviously that should be documented in the manual.

As to the error message itself, there isn't really a way to distinguish
between incomplete and invalid input, so the only thing I can see to do
is to change the message to [incomplete or invalid input].


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1697 bytes --]

From f7bb728281408170cfe79005b03d2b382a84cdbd Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Sat, 2 Dec 2017 19:01:54 -0500
Subject: [PATCH] Document limitation of regexp repetition (Bug#24914)

* doc/lispref/searching.texi (Regexp Backslash): Explain that \{m,n\}
may only use numbers up to 32767.
* lisp/isearch.el (isearch-search): Update error message to include
invalid input possibility.
---
 doc/lispref/searching.texi | 3 ++-
 lisp/isearch.el            | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 755fa554bb..92b7e6d17e 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -639,7 +639,8 @@ Regexp Backslash
 is a more general postfix operator that specifies repetition with a
 minimum of @var{m} repeats and a maximum of @var{n} repeats.  If @var{m}
 is omitted, the minimum is 0; if @var{n} is omitted, there is no
-maximum.
+maximum.  For both forms, @var{m} and @var{n}, if specified, may be no
+larger than 32767.
 
 For example, @samp{c[ad]\@{1,2\@}r} matches the strings @samp{car},
 @samp{cdr}, @samp{caar}, @samp{cadr}, @samp{cdar}, and @samp{cddr}, and
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 13fa97ea71..dfc5f9f3f7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2853,7 +2853,7 @@ isearch-search
       ((string-match
 	"\\`Premature \\|\\`Unmatched \\|\\`Invalid "
 	isearch-error)
-       (setq isearch-error "incomplete input"))
+       (setq isearch-error "incomplete or invalid input"))
       ((and (not isearch-regexp)
 	    (string-match "\\`Regular expression too big" isearch-error))
        (cond
-- 
2.11.0


  reply	other threads:[~2017-12-03 16:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 22:29 bug#24914: 24.5; isearch-regexp: wrong error message Drew Adams
2017-12-03 16:37 ` Noam Postavsky [this message]
2017-12-03 18:00   ` Drew Adams
2017-12-03 18:13     ` Noam Postavsky
2017-12-03 18:56       ` Drew Adams
2017-12-04  6:27         ` Noam Postavsky
2017-12-04 14:52           ` Drew Adams
2017-12-05  1:18             ` Noam Postavsky
2017-12-05  3:15               ` Drew Adams
2017-12-05  3:51                 ` Noam Postavsky
2017-12-05  4:52                   ` Drew Adams
2017-12-05 13:27                     ` Noam Postavsky
2017-12-05 15:31                       ` Drew Adams
2017-12-06  2:52                         ` Noam Postavsky
2017-12-08  9:48               ` Eli Zaretskii
2017-12-08 13:32                 ` Noam Postavsky
2017-12-08 14:35                   ` Eli Zaretskii
2017-12-10  2:18                     ` Noam Postavsky
2017-12-10  6:49                       ` Eli Zaretskii
2018-01-27  2:05                         ` Noam Postavsky
2017-12-04 15:18           ` Eli Zaretskii

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=87h8t7ix7m.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=24914@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).