[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: |
Mon, 14 Dec 2015 17:52:31 +0200 |
> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Sun, 13 Dec 2015 23:25:28 -0500
>
> > 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.
>
> But if (inserted > 0) and the buffer was not empty beforehand, how can
> the subsequent code know (after we've called
> bset_enable_multibyte_characters) that it has to decode the earlier
> buffer's content (since bset_enable_multibyte_characters has thrown away
> the information that the earlier buffer's content was multibyte)?
adjust_after_insert (which is the code I alluded to above) doesn't do
any such decoding, it never did. IOW, I just returned the situation
in this particular case to what it was before. The unconditional call
to Fset_buffer_multibyte erroneously caused the gap and ZV adjustments
to be done twice when inserted is positive; this commit fixed that.
Feel free to make more changes there, I don't claim I understand this
code better than you do. (I asked for comments, but no one
responded.) Just make sure the two test cases, viz.:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-12/msg00171.html
http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-12/msg00442.html
both still work correctly.
Thanks.