GNU bug report logs - #17533
24.4.50; Word Isearch bug

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Tue, 20 May 2014 08:31:02 UTC

Severity: normal

Found in version 24.4.50

Done: Dani Moncayo <dmoncayo <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17533 in the body.
You can then email your comments to 17533 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17533; Package emacs. (Tue, 20 May 2014 08:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dani Moncayo <dmoncayo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 20 May 2014 08:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: 24.4.50; Word Isearch bug
Date: Tue, 20 May 2014 10:30:31 +0200
From "emacs -Q":
  f o o RET - > f o o C-s M-s w - > f o o

Expected: Only the string "->foo" is matched.

Observed: There are two (quite strange) matches:
1. From the final dot in the *scratch* buffer to the end of the first
   "foo".
2. From the end of the first "foo" to the end of the second "foo".


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-04-21 on LEG570
Repository revision: 117001 dancol <at> dancol.org-20140421012855-xu7gwqdl59pgkgur
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'

Configured features:
XPM JPEG TIFF GIF PNG RSVG NOTIFY ACL GNUTLS LIBXML2 ZLIB

Important settings:
  value of $LANG: ESN
  locale-coding-system: cp1252

-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17533; Package emacs. (Tue, 20 May 2014 21:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 17533 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 17533 <at> debbugs.gnu.org
Subject: Re: bug#17533: 24.4.50; Word Isearch bug
Date: Wed, 21 May 2014 00:21:48 +0300
> From "emacs -Q":
>   f o o RET - > f o o C-s M-s w - > f o o
>
> Expected: Only the string "->foo" is matched.
>
> Observed: There are two (quite strange) matches:
> 1. From the final dot in the *scratch* buffer to the end of the first
>    "foo".
> 2. From the end of the first "foo" to the end of the second "foo".

In word search mode, non-word characters are interpreted as whitespace.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17533; Package emacs. (Wed, 21 May 2014 10:09:02 GMT) Full text and rfc822 format available.

Message #11 received at 17533 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 17533 <at> debbugs.gnu.org
Subject: Re: bug#17533: 24.4.50; Word Isearch bug
Date: Wed, 21 May 2014 12:07:53 +0200
> In word search mode, non-word characters are interpreted as whitespace.

IMO, that rule should have an exception: the characters in the current
search string should be interpreted as word characters (for the
purpose of the search), because IMO, what the user wants is to search
for occurrences of _that_ string (regardless of the type of its
characters), where the _surrounding_ characters are non-words.


-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17533; Package emacs. (Wed, 21 May 2014 10:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 17533 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 17533 <at> debbugs.gnu.org
Subject: Re: bug#17533: 24.4.50; Word Isearch bug
Date: Wed, 21 May 2014 12:50:17 +0200
On Wed, May 21, 2014 at 12:07 PM, Dani Moncayo <dmoncayo <at> gmail.com> wrote:
>> In word search mode, non-word characters are interpreted as whitespace.
>
> IMO, that rule should have an exception: the characters in the current
> search string should be interpreted as word characters (for the
> purpose of the search), because IMO, what the user wants is to search
> for occurrences of _that_ string (regardless of the type of its
> characters), where the _surrounding_ characters are non-words.

Though admittedly, it's a bit odd to put non-word characters in a
word-type Isearch.

My use case is this: I was editing a C source code file, which had
things like: "pointer->foo", "pointer->foobar", and also stand-alone
variables "foo" and "foobar".

I wanted to find only the occurrences of "pointer->foo", so I tried to
do a word-type Isearch with "->foo" as search string.

Therefore, I think that I intuitively expected the following behavior
for word-type Isearch: find matches of (literally) the search string
which have a "change in type of character" in its boundaries, i.e.:

1. If the first character in my search string is word-type, its
previous character in the buffer must be non-word-type (and vice-versa).

2. If the last character in my search string is word-type, its
following character in the buffer must be non-word-type (and vice-versa).



-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17533; Package emacs. (Wed, 21 May 2014 13:08:01 GMT) Full text and rfc822 format available.

Message #17 received at 17533 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 17533 <at> debbugs.gnu.org
Subject: Re: bug#17533: 24.4.50; Word Isearch bug
Date: Wed, 21 May 2014 15:07:08 +0200
> Therefore, I think that I intuitively expected the following behavior
> for word-type Isearch: find matches of (literally) the search string
> which have a "change in type of character" in its boundaries, i.e.:
>
> 1. If the first character in my search string is word-type, its
> previous character in the buffer must be non-word-type (and vice-versa).
>
> 2. If the last character in my search string is word-type, its
> following character in the buffer must be non-word-type (and vice-versa).

Mmmm... perphaps the "vice-versa"s above should be removed.


-- 
Dani Moncayo




Reply sent to Dani Moncayo <dmoncayo <at> gmail.com>:
You have taken responsibility. (Wed, 21 May 2014 16:00:03 GMT) Full text and rfc822 format available.

Notification sent to Dani Moncayo <dmoncayo <at> gmail.com>:
bug acknowledged by developer. (Wed, 21 May 2014 16:00:06 GMT) Full text and rfc822 format available.

Message #22 received at 17533-done <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 17533-done <at> debbugs.gnu.org
Subject: Re: bug#17533: 24.4.50; Word Isearch bug
Date: Wed, 21 May 2014 17:59:33 +0200
> In word search mode, non-word characters are interpreted as whitespace.

Indeed, I now remember the philosophy behind word-type Isearch: you
can search for "foo, bar" (with punctuation between the words) and
you'll find that sequence of words, regardless of the whitespace or
punctuation between the words.

So my expectations were wrong.

I'm closing the bug report.  Sorry for the noise.

-- 
Dani Moncayo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 19 Jun 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.