Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#9364: 23.3.50; inconsistent behavior of M-s o in regex isearch

1 view
Skip to first unread message

Eric Hanchrow

unread,
Aug 24, 2011, 4:26:36 PM8/24/11
to 93...@debbugs.gnu.org
I started emacs like this: /usr/local/src/emacs23/src/emacs -Q

I then typed C-h r to being up the Emacs manual.

I then typed M-C-s ^ SPC permission. This did what I expected: it moved
point forward until it was just after the word "Permission" on line 23.

I then typed M-s o. I saw a message in the echo area:

Searched 1 buffer; no matches for `^ permission'

This is not what I expected: I instead expected to see an "*Occur*"
buffer appear, showing something like this:

1 match for "^ permission" in buffer: *info*
23: Permission is granted to copy, distribute and/or modify this

Now, if I repeat my little repro scenario above, but search instead for
^ SPC + permission -- i.e., if I add a + character after my SPC --
everything works as I expect.

In GNU Emacs 23.3.50.1 (x86_64-unknown-linux-gnu)
of 2011-08-12 on rampage.sea
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure '--with-x-toolkit=no''

Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: C
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t

Recent input:
C-h i C-v C-v C-v M-< C-h r C-u C-u C-n C-u C-n C-f
C-f C-f M-< C-M-s ^ SPC p e r m i s s i o n C-s M-s
o C-a C-h r d C-x k <return> C-h r C-v M-v C-l M-<
M-x r e p o e <backspace> r t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Composing main Info directory...done
Mark set [2 times]
Searched 1 buffer; no matches for `^ permission'
Mark saved where search started
Mark set

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 hex-util hashcash mail-utils emacsbug multi-isearch info easymenu
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
font-setting tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind system-font-setting
font-render-setting x multi-tty emacs)

Glenn Morris

unread,
Aug 24, 2011, 4:35:04 PM8/24/11
to Eric Hanchrow, 93...@debbugs.gnu.org
Eric Hanchrow wrote:

> I then typed M-C-s ^ SPC permission. This did what I expected: it moved
> point forward until it was just after the word "Permission" on line 23.
>
> I then typed M-s o. I saw a message in the echo area:
>
> Searched 1 buffer; no matches for `^ permission'

isearch-forward-regexp says:

In regexp incremental searches, a space or spaces normally matches
any whitespace (the variable `search-whitespace-regexp' controls
precisely what that means).

occur does not have this feature.

Glenn Morris

unread,
Aug 24, 2011, 4:43:22 PM8/24/11
to Eric Hanchrow, 93...@debbugs.gnu.org

I guess for consistency isearch-occur should bind search-spaces-regexp
to search-whitespace-regexp.


Juri Linkov

unread,
Aug 25, 2011, 4:49:02 PM8/25/11
to Glenn Morris, 9364...@debbugs.gnu.org, Eric Hanchrow
> I guess for consistency isearch-occur should bind search-spaces-regexp
> to search-whitespace-regexp.

Thank you for the suggestion. I tested it and installed the fix.

Juri Linkov

unread,
Oct 24, 2011, 1:57:56 AM10/24/11
to 93...@debbugs.gnu.org
It occurred to me that `isearch-occur' should bind `search-spaces-regexp'
to `search-whitespace-regexp' only when `isearch-regexp' is non-nil
because regexp-based `occur' should output the same matches
as in non-regexp isearch that doesn't use `search-spaces-regexp'.
So now I fixed this accordingly.



0 new messages