From: Chong Yidong <cyd@stupidchicken.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 4209@debbugs.gnu.org
Subject: bug#4209: 23.1; Emacs 23.1 regression in re-search-forward
Date: Wed, 27 Jan 2010 11:43:30 -0500 [thread overview]
Message-ID: <87zl3z4hxp.fsf@stupidchicken.com> (raw)
In-Reply-To: <jwviqanliww.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 27 Jan 2010 09:34:38 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> The preceding comment keeps me puzzled. I thought that we only ever
> matched re_patterns and buffers of the same multibyteness, i.e. if
> a unibyte regexp is matched against a multibyte buffer it should first
> be turned into a multibyte regexp and then re_compiled, so the case of:
>
> /* For the case of matching this unibyte regex
> against multibyte, we must set a leading code of
> the corresponding multibyte character. */
>
> should never happen in analyse_first. Yet, if your patch fixes the bug,
> that indicates that apparently it *does* happen.
I observe that in the original bug recipe:
(set-buffer (get-buffer-create "*Test Buffer*"))
(insert "\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A")
(goto-char (point-min))
(message "looking-at: %s" (looking-at "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A"))
(message "re-search-forward: %s"
(re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t))
If we replace
(re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t))
with
(re-search-forward (string-to-multibyte
"\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A") 100 t))
then the regexp match takes places correctly. I'm not sure why the
looking-at call works, tho.
next prev parent reply other threads:[~2010-01-27 16:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-20 0:50 bug#4209: 23.1; Emacs 23.1 regression in re-search-forward Christopher J. Madsen
2010-01-26 20:38 ` Chong Yidong
2010-01-27 3:43 ` Kenichi Handa
2010-01-27 5:41 ` Kenichi Handa
2010-01-27 14:34 ` Stefan Monnier
2010-01-27 16:43 ` Chong Yidong [this message]
2010-01-28 1:18 ` Kenichi Handa
2010-01-28 19:01 ` Stefan Monnier
2010-01-29 6:15 ` Kenichi Handa
-- strict thread matches above, loose matches on Subject: below --
2009-12-02 0:21 Matthew Dempsky
2009-12-07 3:30 Christopher J. Madsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zl3z4hxp.fsf@stupidchicken.com \
--to=cyd@stupidchicken.com \
--cc=4209@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.