Subject: 23.1.50; can't search 8-bit byte on unibyte buffer

From: Taiki SUGAWARA <[email-masked]>
Date: Sun, 12 Jul 2009 00:34:14 +0900

I wrote code for search 8-bit byte on unibyte buffer like a
followings. but emacs says `search failed'. It's a bug?

    (with-temp-buffer
      (set-buffer-multibyte nil)
      (insert (make-string 1 ?\xff))
      (goto-char (point-min))
      (search-forward (make-string 1 ?\xff)))

In GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.16.1)
 of 2009-07-08 on pastel
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--prefix=/opt/emacs23''

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: ja_JP.UTF-8
  value of $XMODIFIERS: @im=uim
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

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
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-e q <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> M-x e m a c s C-g M-h v C-g 
C-/ <f1> v s m t p <tab> C-g M-x a p r o SPC [ s <backspace> 
<backspace> <return> s m t p <return> M-x s e n d C-g 
M-x a p r o SPC <return> b u g s <return> M-x a M-p 
RET b u g <return> C-x o C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-v C-v C-s s e n d RET C-x o M-x s 
e n d SPC e m a SPC C-a C-k s e n d - <tab> <tab> C-a 
C-k C-g C-x o C-s s e n d C-s C-s C-a C-x o M-x e m 
a c s <tab> <tab> C-g M-x r e p o r SPC e m a SPC SPC 
<return> c a n ' t SPC s e a r c h SPC b y t e SPC 
o n SPC u n i b y t e SPC b u f f e r RET C-p C-n C-x 
1 <next> <up> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <next> <next> 
<prior> <prior> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> M-x M-p C-g C-n <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <down> <down> 
<down> <down> <down> <down> C-x k RET C-n C-n C-n C-x 
C-v RET C-n C-n C-n C-n C-e C-x C-e q M-m <down-mouse-1> 
<mouse-1> M-x r e p o <tab> r <tab> <return>

Recent messages:
Mark saved where search started
Quit
Making completion list...
Quit
call-interactively: End of buffer
Quit
Auto-saving...
Entering debugger...
Back to top level.
Making completion list...