unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* \t not correctly processed in query-replace-regexp
@ 2004-09-16 11:41 Paul vL
  2004-09-16 15:27 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Paul vL @ 2004-09-16 11:41 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers 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.

In GNU Emacs 21.3.1 (i386-mingw-nt5.0.2195)
 of 2004-03-10 on NYAUMO
configured using `configure --with-gcc (3.2)'
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: ENU
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

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

when using a character class with \t, the \t is not recognised:
[ \t]+ will not match a sequence of spaces and tabs.
using C-q to insert a literal tab character does work;
[  ]+ will match a sequence of spaces and tabs.

it is stated in the "syntax
of regular expressions" section of the emacs manual/info file that :
" `\"' stands for a double-quote as part of
the regexp, `\\' for a backslash as part of the regexp, `\t' for a tab,
and `\n' for a newline. "
and it even gives an example which uses \t for tabs:
"[.?!][]\"')]*\\($\\| $\\|\t\\|  \\)[ \t\n]*"

Regards,
Paul


Recent input:
n n n n n n n n n n n n n n n n n n n n n q <down-mouse-1> 
<mouse-movement> <mouse-movement> <mouse-movement> 
<mouse-movement> <mouse-movement> <mouse-movement> 
<mouse-movement> <mouse-movement> <mouse-movement> 
<mouse-movement> <mouse-movement> <mouse-1> <mouse-wheel> 
<mouse-wheel> <mouse-wheel> <mouse-wheel> <mouse-wheel> 
<mouse-wheel> <mouse-wheel> <mouse-wheel> <mouse-wheel> 
<mouse-wheel> <mouse-wheel> <mouse-wheel> <mouse-wheel> 
<mouse-wheel> <mouse-wheel> <mouse-wheel> <help-echo> 
u <up> <return> <down-mouse-1> <mouse-movement> <mouse-movement> 
<mouse-movement> <mouse-movement> <mouse-movement> 
<mouse-movement> <mouse-movement> <mouse-1> C-M-% t 
e x t [ SPC C-` <tab> ] + n o c a s e <return> <return> 
y y y y y y y y y y y ! C-x C-s <menu-bar> <help-menu> 
<report-emacs-bug>

Recent messages:
query-replace-regexp: Quit
Mark set
Replaced 0 occurrences
Loading phexl...done
Mark set
Replaced 0 occurrences
Mark set
Replaced 14 occurrences
Wrote c:/project/rhapsody/archive/nasm2c/nasm.c3po
Loading emacsbug...done

-- 
_______________________________________________
Graffiti.net free e-mail @ www.graffiti.net
Check out our value-added Premium features, such as a 1 GB mailbox for just US$9.95 per year!


Powered by Outblaze

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

* Re: \t not correctly processed in query-replace-regexp
  2004-09-16 11:41 \t not correctly processed in query-replace-regexp Paul vL
@ 2004-09-16 15:27 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2004-09-16 15:27 UTC (permalink / raw)
  Cc: bug-gnu-emacs

"Paul vL" <litter@graffiti.net> writes:

> when using a character class with \t, the \t is not recognised:
> [ \t]+ will not match a sequence of spaces and tabs.

`[ \t]+' is a regexp that matches a sequence of SPC, backslash and `t'.

> using C-q to insert a literal tab character does work;
> [  ]+ will match a sequence of spaces and tabs.
>
> it is stated in the "syntax
> of regular expressions" section of the emacs manual/info file that :
> " `\"' stands for a double-quote as part of
> the regexp, `\\' for a backslash as part of the regexp, `\t' for a tab,
> and `\n' for a newline. "
> and it even gives an example which uses \t for tabs:
> "[.?!][]\"')]*\\($\\| $\\|\t\\|  \\)[ \t\n]*"

Here is the complete quote:

    In Lisp syntax, the string constant begins and ends with a
    double-quote.  `\"' stands for a double-quote as part of the regexp,
    `\\' for a backslash as part of the regexp, `\t' for a tab, and `\n'
    for a newline.

Note that it starts with "In Lisp syntax, the string constant ...",
ie. the paragraph talks about string syntax in Lisp, not about regexp
syntax.  The Lisp reader transforms this string constant according to the
quoted rules, and this transformed string is then interpreted by the
regexp engine.  The transformation of \t to TAB is only performed at the
Lisp level.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

end of thread, other threads:[~2004-09-16 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-16 11:41 \t not correctly processed in query-replace-regexp Paul vL
2004-09-16 15:27 ` Andreas Schwab

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).