From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50560: 28.0.50; 'insert-file-contents-literally' on multibyte buffers Date: Mon, 13 Sep 2021 14:52:00 +0300 Message-ID: <83pmtcelr3.fsf@gnu.org> References: <87zgshotc1.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30183"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50560@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 13 13:54:53 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 1mPkY0-0007iS-1x for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Sep 2021 13:54:52 +0200 Original-Received: from localhost ([::1]:47544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPkXy-0006iN-HY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Sep 2021 07:54:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPkWE-0004OA-9s for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 07:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPkWE-0002ON-0z for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 07:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPkWD-0005ko-Th for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 07:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Sep 2021 11:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50560 X-GNU-PR-Package: emacs Original-Received: via spool by 50560-submit@debbugs.gnu.org id=B50560.163153393822053 (code B ref 50560); Mon, 13 Sep 2021 11:53:01 +0000 Original-Received: (at 50560) by debbugs.gnu.org; 13 Sep 2021 11:52:18 +0000 Original-Received: from localhost ([127.0.0.1]:44513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPkVV-0005jd-TB for submit@debbugs.gnu.org; Mon, 13 Sep 2021 07:52:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPkVT-0005jP-O4 for 50560@debbugs.gnu.org; Mon, 13 Sep 2021 07:52:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33750) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPkVO-0001o7-D3; Mon, 13 Sep 2021 07:52:10 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3881 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPkVK-0006S7-7J; Mon, 13 Sep 2021 07:52:10 -0400 In-Reply-To: <87zgshotc1.fsf@gmail.com> (message from Augusto Stoffel on Mon, 13 Sep 2021 08:58:06 +0200) 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:214215 Archived-At: > From: Augusto Stoffel > Date: Mon, 13 Sep 2021 08:58:06 +0200 > > I thought 'insert-file-contents-literally' literally just inserted the > file contents, as bytes, but I noticed that in the following code > > (create-image > (with-temp-buffer > (set-buffer-multibyte nil) > (insert-file-contents-literally "picure.jpg") > (buffer-substring-no-properties (point-min) (point-max))) > nil t) > > the call to 'set-buffer-multibyte' is really essential. It is only essential for some very specific uses of the resulting buffer, but definitely not for all.