[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] emacs-25 25e461c 1/2: Fix visiting files with raw-text
From: |
Eli Zaretskii |
Subject: |
Re: [Emacs-diffs] emacs-25 25e461c 1/2: Fix visiting files with raw-text |
Date: |
Sun, 13 Dec 2015 22:46:24 +0200 |
> From: Stefan Monnier <address@hidden>
> Cc: Eli Zaretskii <address@hidden>
> Date: Sun, 13 Dec 2015 15:25:33 -0500
>
> > - Fset_buffer_multibyte (Qnil);
> > + if (inserted > 0)
> > + bset_enable_multibyte_characters (current_buffer, Qnil);
> > + else
> > + Fset_buffer_multibyte (Qnil);
>
> Hmm... IIUC if (inserted > 0) we need bset_enable_multibyte_characters
> because Fset_buffer_multibyte would try to convert the chars we
> just inserted.
>
> And IIUC we recently switched to Fset_buffer_multibyte in order to
> handle the case where the buffer was not empty when we started (in
> which case we need to convert the content that was present before we
> started insertion).
>
> So, IIUC if the buffer was not empty to start with *and* (inserted > 0),
> then we have a problem because neither function is right.
>
> Or did I miss something?
If inserted is positive, there's code after that which takes care of
adjusting the buffer's gap etc. So it's only needed when nothing was
inserted.