all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#9458: 24.0.50; Searching in binary buffers
@ 2011-09-07 12:50 Helmut Eller
  2011-09-07 16:09 ` Andreas Schwab
  2011-09-07 16:51 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Helmut Eller @ 2011-09-07 12:50 UTC (permalink / raw)
  To: 9458

search-forward seems to work strangely in binary/unibyte buffers.
Create a file test.el containing this code:

(defvar test-string (unibyte-string #xce))

(with-temp-file "test.txt"
  (set-buffer-multibyte nil)
  (setq buffer-file-coding-system 'binary)
  (insert test-string))

(with-current-buffer (get-buffer-create "test.txt")
  (set-buffer-multibyte nil)
  (setq buffer-file-coding-system 'binary)
  (erase-buffer)
  (insert-file-contents "test.txt")
  (search-forward test-string))

Executing this with: emacs -Q -batch -l test.el
prints: 
Search failed: "Î"
[Exit 255]


The Lisp code creates a file test.txt for a single character ?\xce.  As
expected, hexdump -C test.txt prints: 
00000000  ce                                                |Î|
00000001


Opening and searching that character with Emacs fails.  That's
definitely not what I was expecting.  What's the proper way to search
those characters?






In GNU Emacs 24.0.50.4 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2011-09-05 on ix
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure  '--enable-asserts' '--enable-checking' '--with-gif=no' '--with-gnutls=no' 'CFLAGS=-g3 -O0''






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

* bug#9458: 24.0.50; Searching in binary buffers
  2011-09-07 12:50 bug#9458: 24.0.50; Searching in binary buffers Helmut Eller
@ 2011-09-07 16:09 ` Andreas Schwab
  2011-09-07 16:51 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2011-09-07 16:09 UTC (permalink / raw)
  To: Helmut Eller; +Cc: 9458

ELISP> (let ((s "\xce"))
  (with-temp-buffer
    (set-buffer-multibyte nil)
    (save-excursion (insert s))
    (and (looking-at s) (search-forward s))))
*** Eval error ***  Search failed: "\316"

Likely a bug in boyer_moore.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#9458: 24.0.50; Searching in binary buffers
  2011-09-07 12:50 bug#9458: 24.0.50; Searching in binary buffers Helmut Eller
  2011-09-07 16:09 ` Andreas Schwab
@ 2011-09-07 16:51 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2011-09-07 16:51 UTC (permalink / raw)
  To: Helmut Eller; +Cc: 9458-done

Fixed on emacs-23 branch.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

end of thread, other threads:[~2011-09-07 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-07 12:50 bug#9458: 24.0.50; Searching in binary buffers Helmut Eller
2011-09-07 16:09 ` Andreas Schwab
2011-09-07 16:51 ` Andreas Schwab

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.