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 10:25:17 -0400 Message-ID: References: <87wqxi24b3.fsf@betacantrips.com> <87lf7udq4q.fsf@gnus.org> <83fsy123yg.fsf@gnu.org> <83zgw9znp2.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="38934"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, 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 16:26:34 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 1lo5Lj-0009tM-7w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 16:26:31 +0200 Original-Received: from localhost ([::1]:50892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo5Li-0005US-7W for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 10:26:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo5LG-00058d-Ah for bug-gnu-emacs@gnu.org; Tue, 01 Jun 2021 10:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lo5LF-0004Sd-Vy for bug-gnu-emacs@gnu.org; Tue, 01 Jun 2021 10:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lo5LF-0001LE-QS for bug-gnu-emacs@gnu.org; Tue, 01 Jun 2021 10:26: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 14:26: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.16225575285107 (code B ref 12925); Tue, 01 Jun 2021 14:26:01 +0000 Original-Received: (at 12925) by debbugs.gnu.org; 1 Jun 2021 14:25:28 +0000 Original-Received: from localhost ([127.0.0.1]:37495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lo5Kh-0001KJ-Na for submit@debbugs.gnu.org; Tue, 01 Jun 2021 10:25:28 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lo5Kg-0001K6-3E for 12925@debbugs.gnu.org; Tue, 01 Jun 2021 10:25:26 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id ABE71808A3; Tue, 1 Jun 2021 10:25:20 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CDABB80497; Tue, 1 Jun 2021 10:25:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622557518; bh=85btVWOxuvJ2mXVqR0WF25WWYEObwTU/amIT406j6bU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=juXoquWizyRThtc+t1UXhRxQhyGGkLrMegB7/ZHJl1Tt8mlVuBMIrx97qimHMPleX OURUBq/ntZb5K8Ygf1CIR/Wvu31PZXFoq0oWTnUCDb6phFvHCTrjaD8mkOL2Ej/hJw FeD0eIQ4rRsa6QWeyO6f8WKkAyySxaKmIvmm+l/5l5GF5LPFLPmPtL/8SHh2xAB7OF 8GEYUuYykIY2/EkA05WRqsd4zp65+/3Kxl1TkvLOip4MsfJ7BZyeSiPlZLq04mSrXA gczwt/2jTIc1+5xxhtgu2DGpNQleTNmogZGb+SkGY9vRaGD+nORsFTnvsKNEPNbF10 C+SlPI0F6cIQQ== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 88F581201CC; Tue, 1 Jun 2021 10:25:18 -0400 (EDT) In-Reply-To: <83zgw9znp2.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 01 Jun 2021 17:03:53 +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:207779 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. > Most possibly, people don't know the text is multibyte. > Or don't care. If they don't know or don't care, then the best we can do is signal an error to try and wake them up: they *should* know and they *should* care, otherwise it's a bit like inserting in "any buffer you like, I don't care". >> 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, >> ...). > What I mean is: if we think the current behavior is broken, then what > I suggest is at least less broken (and sometimes might just be TRT). I doubt it's less broken: sometimes it will be TRT, other times it will be worse than what we have. > At the very least what I suggest is reversible, whereas neither the > current behavior nor what you suggest is. My point is that we shouldn't even get into the position of having to make such arbitrary choices: we should signal an error before we get there. Stefan