all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7267: 23.1; regexp backslash-B matches word
@ 2010-10-22 18:54 Thibault Kruse
  2010-10-23  2:49 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Thibault Kruse @ 2010-10-22 18:54 UTC (permalink / raw
  To: 7267


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

According to emacs manual, \B matches the empty string, but it does not.

start emacs with emacs -q --no-site-file
move point over word in the splash screen.
M-:
(looking-at "\\B")
minibuffer says: T, should say nil

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.1/etc/DEBUG for instructions.


In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-03-29 on rothera, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

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: en_US.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  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
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<right> M-: <up> ( l o o k i n g - a t SPC " " <left> 
\ \ B <right> ) <return> <left> M-: <up> <return> <right> 
<help-echo> M-x r e p o <tab> r t - e <tab> <retur
n>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
goto-history-element: Beginning of history; no preceding item
t
nil
Making completion list...
-- 
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome





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

* bug#7267: 23.1; regexp backslash-B matches word
  2010-10-22 18:54 bug#7267: 23.1; regexp backslash-B matches word Thibault Kruse
@ 2010-10-23  2:49 ` Glenn Morris
  2010-10-23  9:00   ` Thibault Kruse
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2010-10-23  2:49 UTC (permalink / raw
  To: Thibault Kruse; +Cc: 7267

"Thibault Kruse" wrote:

> According to emacs manual, \B matches the empty string, but it does not.

The elisp manual says:

Backslash Constructs in Regular Expressions
[...]

`\B'
     matches the empty string, but _not_ at the beginning or end of a
     word, nor at the beginning or end of the buffer (or string).

> start emacs with emacs -q --no-site-file
> move point over word in the splash screen.
> M-:
> (looking-at "\\B")
> minibuffer says: T, should say nil

Why do you think it should return nil?

This construct matches the empty string inside words.
It only returns nil at word boundaries. Try

(looking-at "\\B")

with point at the start, middle, and end of a word.
It returns nil, t, nil, as it should.

The empty string is _empty_, ie length zero, not whitespace or
anything like that.






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

* bug#7267: 23.1; regexp backslash-B matches word
  2010-10-23  2:49 ` Glenn Morris
@ 2010-10-23  9:00   ` Thibault Kruse
  0 siblings, 0 replies; 3+ messages in thread
From: Thibault Kruse @ 2010-10-23  9:00 UTC (permalink / raw
  To: Glenn Morris

sorry, I misunderstood. But I now understand it means it always returns t except for the noted cases, as any string contains the empty string.

-------- Original-Nachricht --------
> Datum: Fri, 22 Oct 2010 22:49:27 -0400
> Von: Glenn Morris <rgm@gnu.org>
> An: "Thibault Kruse" <thibault.kruse@gmx.de>
> CC: 7267@debbugs.gnu.org
> Betreff: Re: bug#7267: 23.1; regexp backslash-B matches word

> "Thibault Kruse" wrote:
> 
> > According to emacs manual, \B matches the empty string, but it does not.
> 
> The elisp manual says:
> 
> Backslash Constructs in Regular Expressions
> [...]
> 
> `\B'
>      matches the empty string, but _not_ at the beginning or end of a
>      word, nor at the beginning or end of the buffer (or string).
> 
> > start emacs with emacs -q --no-site-file
> > move point over word in the splash screen.
> > M-:
> > (looking-at "\\B")
> > minibuffer says: T, should say nil
> 
> Why do you think it should return nil?
> 
> This construct matches the empty string inside words.
> It only returns nil at word boundaries. Try
> 
> (looking-at "\\B")
> 
> with point at the start, middle, and end of a word.
> It returns nil, t, nil, as it should.
> 
> The empty string is _empty_, ie length zero, not whitespace or
> anything like that.
> 

-- 
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome





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

end of thread, other threads:[~2010-10-23  9:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 18:54 bug#7267: 23.1; regexp backslash-B matches word Thibault Kruse
2010-10-23  2:49 ` Glenn Morris
2010-10-23  9:00   ` Thibault Kruse

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.