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#55205: 28.1.50; completion--replace illegally mutates completion candidates Date: Mon, 02 May 2022 17:18:47 -0400 Message-ID: References: <4d1b8687-20f2-137a-2739-7bba28828991@daniel-mendler.de> <87wnf5mpt4.fsf@gnus.org> <835ymp78hl.fsf@gnu.org> <834k276gyd.fsf@gnu.org> <8335hr6g1n.fsf@gnu.org> <8f18460c-269f-40fb-bc69-a9c51671899a@daniel-mendler.de> <83zgjz511n.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="7179"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Daniel Mendler , larsi@gnus.org, 55205@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 02 23:20:14 2022 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 1nldSo-0001fF-AL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 May 2022 23:20:14 +0200 Original-Received: from localhost ([::1]:36802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nldSn-0006aB-Cq for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 May 2022 17:20:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nldSc-0006Zw-OC for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 17:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nldSc-0000AH-EX for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 17:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nldSc-0006Uf-B2 for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 17:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 May 2022 21:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55205 X-GNU-PR-Package: emacs Original-Received: via spool by 55205-submit@debbugs.gnu.org id=B55205.165152634424884 (code B ref 55205); Mon, 02 May 2022 21:20:02 +0000 Original-Received: (at 55205) by debbugs.gnu.org; 2 May 2022 21:19:04 +0000 Original-Received: from localhost ([127.0.0.1]:38192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nldRf-0006TG-NE for submit@debbugs.gnu.org; Mon, 02 May 2022 17:19:03 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nldRd-0006Sh-K0; Mon, 02 May 2022 17:19:01 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0B30E4425B3; Mon, 2 May 2022 17:18:56 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A28E14425AF; Mon, 2 May 2022 17:18:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1651526334; bh=7x1fxrbJi5J6hSSSqRxWXeXyD71G6ETvtdrxCJzOn2g=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jbtoociekjGFY+9hZjqgU3dIZJGepr4mt4NbqF8QUo6QQgNKgwvZTjw54bpm0wNny V/WQGJNSHQ9iD+s2uo1uNOKcfpOSusevhS1ZiTZoUZrEMZvGIV+p1oXrlmTCyfxrk/ ozoIyhj7YBWdH7H3ajZILWF/u8n3jRBB6igRr95co7oVVNZW9MPY07HUT6po41J0fH LG5c0TV6N+6QfkGscC8qaBvQO1ScdeEdJea3dnhwS+53VUWgkxQ+h6oDnuqXtCxER+ XkKa9vLv/LLqx4C1Ly5NBsGDP/sMGN7e6ZPKm6E5eO69oM5RXHWRNEQRabXF2QiFEt Pe+exzMp+7Sag== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 93A2B120680; Mon, 2 May 2022 17:18:54 -0400 (EDT) In-Reply-To: <83zgjz511n.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 May 2022 19:53:08 +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:231284 Archived-At: Eli Zaretskii [2022-05-02 19:53:08] wrote: > Why is it justified in this case? How is this case different from any > other case? I don't think it's different from any other. It's generally considered a bug when a function uses things like `sort`, `nconc, or `nreverse on a list it received as argument (unless the docstring explicitly mentions that the arg may be modified destructively). When a user reports this behavior as unexpected the answer is almost always to fix the funciton so it doesn't have this side-effect any more. The same usually holds for text properties on strings. The fact that `completion--replace` is a function used in the completion machinery was largely irrelevant to the decision of how to fix the problem. Its docstring says: "Replace the buffer text between BEG and END with NEWTEXT. Moves point to the end of the new text." and nowhere does it warn that NEWTEXT might be modified along the way, so removing properties on that string was just a plain and simple bug. Stefan