From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#12925: 24.1; string-make-unibyte instead of string-as-unibyte Date: Tue, 01 Jun 2021 09:45:07 -0400 Message-ID: References: <87wqxi24b3.fsf@betacantrips.com> <87lf7udq4q.fsf@gnus.org> <83fsy123yg.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25267"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 12925@debbugs.gnu.org, ethan.glasser.camp@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 01 15:46:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo4ih-0006ON-GJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 15:46:11 +0200 Original-Received: from localhost ([::1]:39172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo4ig-000208-BP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 09:46:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo4iY-0001za-7d for bug-gnu-emacs@gnu.org; Tue, 01 Jun 2021 09:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lo4iX-000451-U1 for bug-gnu-emacs@gnu.org; Tue, 01 Jun 2021 09:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lo4iX-0008Ri-Qf for bug-gnu-emacs@gnu.org; Tue, 01 Jun 2021 09:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Jun 2021 13:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12925 X-GNU-PR-Package: emacs Original-Received: via spool by 12925-submit@debbugs.gnu.org id=B12925.162255511832404 (code B ref 12925); Tue, 01 Jun 2021 13:46:01 +0000 Original-Received: (at 12925) by debbugs.gnu.org; 1 Jun 2021 13:45:18 +0000 Original-Received: from localhost ([127.0.0.1]:36018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lo4hp-0008Qa-Ny for submit@debbugs.gnu.org; Tue, 01 Jun 2021 09:45:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lo4hn-0008QG-Lp for 12925@debbugs.gnu.org; Tue, 01 Jun 2021 09:45:16 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id EAB91808A3; Tue, 1 Jun 2021 09:45:09 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5BBF180497; Tue, 1 Jun 2021 09:45:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622555108; bh=z1AtmWBSUdGKA6cksUFeHiIfm024rQPZ0eFy5IlnLmM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Kll/xML0C3FYTjHkb/Fyp8lI3awnblhgW7Axt7qGlfrrlseQ0WWum4rffOfVDfjrT I11v/nCOytXJ7EmT/36psdZ2eeMx+2xzdQNlqwvK/B/BVv6zcYmNoB4olFy2sL0R3k nTnJN+J5YwcmKFCV3yuRcedDnwPdOE6Q34rFJEH90749SIVIR3erm2ji/7d75rcFE3 m7HccvLZ8aO2fgBIBt2DcA5utioj3vrVJFX7VYEk/TBfebLyUpp/45y/d8Uz91u8d4 UJ2cXGIyTyBdBnPK1f2MsAgUq6OUJ1jZMxXoOCLe/NHaUwcObPxAI0Vt9eLtXzOXWV 4z9qkn1/bgnqA== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 23E1712001E; Tue, 1 Jun 2021 09:45:08 -0400 (EDT) In-Reply-To: <83fsy123yg.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 01 Jun 2021 14:56:39 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207775 Archived-At: > Why not make both methods do the same: insert the bytes of the > multibyte text into the unibyte buffer? AFAIK it's rather unusual to need to insert a text that's multibyte into a buffer that's unibyte. And in those cases, the right behavior is not always the same (sometimes it should covert using something like locale-coding-system, sometimes it should preserve the actual byte-sequence used internally, sometimes it should signal an error, ...). So I think, as much as possible, we should refrain from guessing and rather request that the coder call `encode-coding-string` or something like that explicitly to say what they want. > Making the buffer unibyte after insertion is a PITA, because it could > be very slow if the text in the buffer is long. Agreed. In my book `set-buffer-multibyte` should signal an error if the buffer is not empty (yes, I know it's not going to happen, but I think it's the direction we should be headed). Stefan