From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] emacs-25 25e461c 1/2: Fix visiting files with raw-text
Date: Sun, 13 Dec 2015 23:25:28 -0500 [thread overview]
Message-ID: <jwvy4cxhfhw.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <83k2oi3wm7.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 13 Dec 2015 22:46:24 +0200")
>> > - 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.
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)?
Stefan
next prev parent reply other threads:[~2015-12-14 4:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20151213195208.12085.93274@vcs.savannah.gnu.org>
[not found] ` <E1a8Cgi-00039X-Ic@vcs.savannah.gnu.org>
2015-12-13 20:25 ` [Emacs-diffs] emacs-25 25e461c 1/2: Fix visiting files with raw-text Stefan Monnier
2015-12-13 20:46 ` Eli Zaretskii
2015-12-14 4:25 ` Stefan Monnier [this message]
2015-12-14 15:52 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy4cxhfhw.fsf-monnier+emacsdiffs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.