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#75415: 31.0.50; quoted-printable-en/decode-region doesn't preserve end markers Date: Mon, 06 Jan 2025 23:24:15 -0500 Message-ID: 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="16654"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca To: 75415@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 07 05:25:36 2025 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 1tV19r-0004Ax-TA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jan 2025 05:25:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tV19O-00078n-Kn; Mon, 06 Jan 2025 23:25:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV19M-00076U-1k for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 23:25:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tV19L-0003nr-PC for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 23:25:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=7FkzHV6/7Uc1kWm5+slS+Fsor2V5xoITiOZ2YBmicZU=; b=WiMVKHp7kYp+w/kJvVa2kSheUv8VRtWJjdESUGHCWlP7JJQtLgd7MmSXrzKdMNWD2SaCYlzvcy36HLSjqBAz/spP6c/ANvcNTEK5i6VY1kXnPf+WrDlpw1W6sfdtlaNbT19m478IibT3lpoLYg5H4+E0Z7x+nPS7Dzf36Cu53QEJdrlyxjIrcr6nt2bbd6SmEHrqiLu6j8QvHZ/DPHcKrZyOlq8roo181n0iUfx9WsLcFnPP5bhuNuIi11rNuGq7dy+54O5wMuqhJzPabvDTjrg/su6FJoxSQ4OKjaURCX1Jn6e+QYyoALlqaKjZNGqqQbZLan3tYKa3eig6El9eew==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tV19K-0006Hh-KB; Mon, 06 Jan 2025 23:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2025 04:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75415 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: monnier@iro.umontreal.ca Original-Received: via spool by submit@debbugs.gnu.org id=B.173622387824112 (code B ref -1); Tue, 07 Jan 2025 04:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jan 2025 04:24:38 +0000 Original-Received: from localhost ([127.0.0.1]:41318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tV18w-0006Gq-6D for submit@debbugs.gnu.org; Mon, 06 Jan 2025 23:24:38 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:33488) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tV18s-0006Gc-3s for submit@debbugs.gnu.org; Mon, 06 Jan 2025 23:24:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV18m-00074T-Pm for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 23:24:28 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV18k-0003kV-7q for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 23:24:28 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 716A48056D for ; Mon, 6 Jan 2025 23:24:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1736223857; bh=dQOEZaLt6PIO7N2IXiS4eUSU6e2W3q7fn735+dGTkKc=; h=From:To:Subject:Date:From; b=TDLXHa9ye+PsGeli+h3FEMWzj8ljb4eAq0e2iopGaR8KqV5EzPmoJ8XMgVyydH6bi Bt/6j/ZUj5pEfsKxxb7OuOHJOUXREF4pjHRhCaf/P6OfrDuCSkuNgSVjKXyXzDpS5/ knSYoBH9sDDm/kCW7tz8Imx7dLT7J2FUajmRDqQj3uBXLVPY8RvS8D0mwdycynZBfg DZhTriaamTfrTTFAMhM8bSevl6sz5K/UHPB2qjttRcCc4W1+ZHvImOrCEoXWkfOIN7 ZYJbhFHeKMC9eten7I/yx238D3Dh8alZYtgmA6fQkWwQ4CvOhRTLtgzaf81ZeozXsB jjc/OTXCJEwJg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7E6EE801F1 for ; Mon, 6 Jan 2025 23:24:17 -0500 (EST) Original-Received: from pastel (69-165-162-104.dsl.teksavvy.com [69.165.162.104]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 60AD2120370 for ; Mon, 6 Jan 2025 23:24:17 -0500 (EST) Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298707 Archived-At: Package: Emacs Version: 31.0.50 In a fresh Emacs try: (with-temp-buffer (set-buffer-multibyte nil) (insert "\300\300") (encode-coding-region (point-min) (point) 'utf-8) (quoted-printable-encode-region (point-min) (point)) (insert "!!") (buffer-string)) It will likely return "=C0!!=C0" whereas it should return "=C0=C0!!". Found via a bug in VM: https://gitlab.com/emacs-vm/vm/-/issues/491 The same problem plagues `quoted-printable-decode-region`. I think we really need to introduce a `replace-region` primitive which takes care of preserving the position of markers instead of having to teach ELisp coders the delicate art of combining `insert(-before-markers)` and `delete` to best preserve markers. Stefan