From: Andrey Kotlarski <m00naticus@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 16286@debbugs.gnu.org
Subject: bug#16286: 24.3.50; insert-file-contents may bring invisible garbage
Date: Sun, 05 Jan 2014 00:42:39 +0200 [thread overview]
Message-ID: <87ob3rqsgw.fsf@gmail.com> (raw)
In-Reply-To: <83y52yxs61.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Jan 2014 18:30:30 +0200")
Thanks a lot for the hints and pointers.
[ 2 януари 2014, 18:30 +0200, четвъртък ] Eli Zaretskii:
> What vlf does is strange and IMO not the best possible solution to
> this issue:
> ...
> This seems to have a subtle misfeature of not supporting files with
> inconsistent encoding, or files with binary data, because there _all_
> characters will belong to the eight-bit charset.
There had been changes meanwhile which hopefully address these (no
special treatment of eight-bit) along other issues (vlf-base.el).
> More to the point, I'm not sure whether inserting raw bytes in
> insert-file-contents when a portion of a multibyte sequence was read
> (i.e. go back to what Emacs 24.3 did) will be good for vlf. It sounds
> to me much better if Emacs would only return complete characters read
> from the file, so that applications will not need to remove those
> stray bytes.
I agree. It would be ideal for vlf if insert-file-contents would also
report the number of stray bytes at the end that haven't been utilized.
> Finally, it would seem a better design for vlf to always read a few
> more bytes than was requested into some scratch buffer, and then
> decode them manually to determine just how many to copy to the main
> buffer.
I see that vlf somehow works only by some accident with current trunk
(and --enable-checking disabled), so I'm on it. My initial attempt at
naively combining insert-file-contents-literally with
decode-coding-inserted-region though often produces wrong decoding where
insert-file-contents would be good.
next prev parent reply other threads:[~2014-01-04 22:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-29 14:05 bug#16286: 24.3.50; insert-file-contents may bring invisible garbage Andrey Kotlarski
2014-01-02 16:30 ` Eli Zaretskii
2014-01-04 22:42 ` Andrey Kotlarski [this message]
2014-01-26 0:36 ` Paul Eggert
2014-01-27 15:01 ` K. Handa
2014-01-27 17:01 ` Paul Eggert
2014-01-29 13:40 ` K. Handa
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ob3rqsgw.fsf@gmail.com \
--to=m00naticus@gmail.com \
--cc=16286@debbugs.gnu.org \
--cc=eliz@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).