all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug: 22.1.50.3; re-search-backward disobeys greedy regexps
@ 2007-08-15 22:44 Unknown
  2007-08-16  0:49 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Unknown @ 2007-08-15 22:44 UTC (permalink / raw)
  To: emacs-pretest-bug

Hi

The funcion re-search-backward does not search greedy regexps (if
non-greedy are matching).

Test case:

1. $ emacs -q
2. type "bbbbb" and ENTER
3. M-x re-search-backward b+ ENTER

Result: the point goes before the last b

Expected: the point should go to the beginning of the match, ithat is,
before the bbbbb.

The result is the same with the RE "b+?"

The counterpart function re-search-forward behaves normally in both cases.

Miguel Frasson.



In GNU Emacs 22.1.50.3 (i686-pc-linux-gnu, GTK+ Version 2.10.11)
 of 2007-08-15 on edf
Windowing system distributor `The X.Org Foundation', version 11.0.70200000
configured using `configure  '--with-gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  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: pt_BR.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  server-mode: t
  pc-selection-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<down-mouse-1> <mouse-1> M-x e m a c s - v e r <tab> 
<return> a b b b b <backspace> <backspace> <backspace> 
<backspace> <backspace> A b b b b b b <home> <delete> 
<down> <return> <return> <return> <return> <up> <up> 
<up> <up> <down> <down> <down> b b b b b b <up> <up> 
<return> <delete> <return> <up> p <backspace> P M-x 
r e - s e a r <tab> f o r <tab> <return> b + <return> 
<up> <up> M-x r e - s e a r <tab> b a c k <tab> <return> 
b + <return> <down> <down> C-h f r e - s e a <tab> 
b a <tab> <return> C-x 1 M-x r e - s e <tab> f o <tab> 
<return> b + ? <return> <up> <up> M-x r e - s e <tab> 
b a <tab> <return> b + ? <return> <home> <return> <up> 
<delete> <down> <down> <down> <down> <up> <up> <up> 
<down> M-x e m <tab> a <tab> C-g <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <menu-bar> <help-menu> <report-emacs-b
ug>

Recent messages:
Loading paren...done
Loading diary-lib...done
Loading /home/frasson/.session...done
For information about the GNU system and GNU/Linux, type C-h C-p.
GNU Emacs 22.1.50.3 (i686-pc-linux-gnu, GTK+ Version 2.10.11) of 2007-08-15 on edf
line-move-1: End of buffer
Type C-x 1 to remove help window.  
Making completion list...
Quit
Loading emacsbug...done

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: 22.1.50.3; re-search-backward disobeys greedy regexps
  2007-08-15 22:44 Bug: 22.1.50.3; re-search-backward disobeys greedy regexps Unknown
@ 2007-08-16  0:49 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2007-08-16  0:49 UTC (permalink / raw)
  To: Miguel Frasson; +Cc: emacs-pretest-bug

> The funcion re-search-backward does not search greedy regexps (if
> non-greedy are matching).

Yes and no.  It's a known problem: regexp search is split into 2 parts:
search and match.  While the "search" can be done in both directions, the
"match" part is only implemented forward.  Which is why `looking-at' (which
only does "match" without any "search") only exists forward (and
looking-back-at is just an attempt to simulate the backward "match" but only
works correctly in specific circumstances).


        Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-16  0:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 22:44 Bug: 22.1.50.3; re-search-backward disobeys greedy regexps Unknown
2007-08-16  0:49 ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.