emacs-devel
[Top][All Lists]
Advanced

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

Re: buffer-swap-text and multibyteness


From: Eli Zaretskii
Subject: Re: buffer-swap-text and multibyteness
Date: Sat, 31 Jan 2009 21:03:42 +0200

> From: Stefan Monnier <address@hidden>
> Cc: Kenichi Handa <address@hidden>,  address@hidden
> Date: Sat, 31 Jan 2009 12:12:55 -0500
> 
> > set-buffer-multibyte jumps through the hoops to DTRT.
> > By contrast, in buffer-swap-text we do just this:
> 
> >   swapfield (enable_multibyte_characters, Lisp_Object);
> 
> > Could this cause trouble, e.g. if one of the buffers whose text is
> > swapped contains eight-bit characters?
> 
> Why would it?  The text is swapped along with the
> enable_multibyte_characters field, so they should stay consistent.

I don't know, perhaps I was just confused.  It's hard not to be, with
all that mind-boggling swapping that goes on in Rmail between a
unibyte buffer and a multibyte one.  A horrible design, if you ask me.
It's little surprise to me that I found so many bugs in Rmail due to
this (and more are still there): one needs constantly to track the
current state of the ``swappiness'', or else all bets are off.
(Quick: if you are currently in rmail-view-buffer, and
rmail-buffers-swapped-p returns non-nil, is the text unibyte or
multibyte?)

We should have simply used 2 separate buffers.




reply via email to

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