all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: monnier@iro.umontreal.ca, 12925@debbugs.gnu.org,
	ethan.glasser.camp@gmail.com
Subject: bug#12925: 24.1; string-make-unibyte instead of string-as-unibyte
Date: Tue, 01 Jun 2021 14:56:39 +0300	[thread overview]
Message-ID: <83fsy123yg.fsf@gnu.org> (raw)
In-Reply-To: <87lf7udq4q.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue,  01 Jun 2021 09:02:13 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 01 Jun 2021 09:02:13 +0200
> Cc: 12925@debbugs.gnu.org, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>
> 
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> >> Why does inserting multibyte text into a unibyte buffer corrupt it
> >> like this?
> >
> > Because the right thing (i.e. signaling an error) was not backward
> > compatible with broken code that assumed that chars can be presented
> > with 8bit (i.e. code written in the glory days of latin-N, koi-8, ...).
> >
> > We could/should probably try to do the right thing now, since such
> > broken code is probably much less common.
> 
> (Now eight years later.)
> 
> So the suggestion is to make inserting multibyte strings into a unibyte
> buffer signal an error (instead of inserting the lower byte of
> characters).
> 
> Has anybody experimented with doing this and seeing whether this signals
> a lot of errors in daily usage?

Why not make both methods do the same: insert the bytes of the
multibyte text into the unibyte buffer?

Making the buffer unibyte after insertion is a PITA, because it could
be very slow if the text in the buffer is long.  That's why people may
wish to do it the other way around: making an empty buffer unibyte is
a snap.





  reply	other threads:[~2021-06-01 11:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-18 17:45 bug#12925: 24.1; string-make-unibyte instead of string-as-unibyte Ethan Glasser-Camp
2012-11-19  2:27 ` Stefan Monnier
2021-06-01  7:02   ` Lars Ingebrigtsen
2021-06-01 11:56     ` Eli Zaretskii [this message]
2021-06-01 13:45       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-01 14:03         ` Eli Zaretskii
2021-06-01 14:25           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-01 15:26             ` Eli Zaretskii
2021-06-02  5:07       ` Lars Ingebrigtsen
2021-06-02 12:07         ` Eli Zaretskii
2021-06-02 13:09           ` Lars Ingebrigtsen
2021-06-02 13:36             ` 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=83fsy123yg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=12925@debbugs.gnu.org \
    --cc=ethan.glasser.camp@gmail.com \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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.