help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: `write-region' writes different bytes than passed to it?


From: Stefan Monnier
Subject: Re: `write-region' writes different bytes than passed to it?
Date: Sun, 10 Feb 2019 17:25:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 1. Signal an error whenever Emacs attempts to encode a unibyte string
> and the encoding isn't "raw-text" or "no-conversion"

Sounds good to me.  I have similar extra checks in my local Emacs hacks
(as well as signaling errors when trying to decode a multibyte string).
They've helped me track down encoding problems in Gnus.

They rarely trigger nowadays, but it's likely because I've fixed most
occurrences in the Elisp code I happen to use.  I'd be surprised if
there aren't any such problems lurking in many other places.

Often the corresponding code "works" in practice (i.e. circumstances
make it do the right thing even though in general it may break), and
fixing it so it doesn't trigger the check requires non-trivial changes.
IOW the tradeoff is not very good when it comes to motivating the
package's maintainer to fix his code (non-trivial rework which will
likely introduce new bugs in order to fix mostly hypothetical old bugs).


        Stefan




reply via email to

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