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

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

bad interaction between set-buffer-multibyte and narrowing


From: Dave Love
Subject: bad interaction between set-buffer-multibyte and narrowing
Date: Fri, 30 May 2003 18:27:35 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (gnu/linux)

This is cut down from a real example in a Gnus bug report.  Note how
the buffer-string is truncated.

Making the buffer unibyte leaves point-max unchanged and it gets
reduced when the buffer is made multibyte again.  You can see this by
just making a narrowed buffer unibyte which contains Japanese.  The
effect is present in both the released and development code.

(with-temp-buffer
  (insert "From: ニシキノネット FC事業部
Content-Type: text/plain; charset=ISO-2022-JP\n\n")
  (narrow-to-region (point-min) (1- (point-max)))
  (set-buffer-multibyte nil)
  (set-buffer-multibyte t)
  (buffer-string))
  => "From: ニシキノネット FC事業部
Content-Type: text/plain"




reply via email to

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