help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: search-forward in emacs23 lisp


From: Johan Bockgård
Subject: Re: search-forward in emacs23 lisp
Date: Mon, 29 Mar 2010 01:00:45 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

rasmith@tamu.edu writes:

> If I move to the buffer that contains the data to be parsed (which has
> its multibyte flag set to nil), then 
> (search-forward (unibyte-string ?\377)) behaves as above.  However, in
> that same buffer, a keyboard isearch-forward for \377 finds a \377
> with no problem.

There does seem to be a bug regarding search in unibyte buffers,

    ;; This works
    (let ((case-fold-search nil)) (search-forward "\377"))

    ;; This actually matches \277 instead!
    (let ((case-fold-search t)) (search-forward "\377"))


Isearch works, by luck, since it binds case-fold-search to nil because
of this strange behavior of `downcase' in a unibyte context,

    (let ((default-enable-multibyte-characters nil))
      (with-temp-buffer
        (downcase 255)))  ; worked correctly in Emacs 22
    => 4194303




reply via email to

[Prev in Thread] Current Thread [Next in Thread]