GNU bug report logs - #56693
29.0.50; write-file does not respect uniquify.el

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Gabriel <gabriel376@HIDDEN>; Keywords: moreinfo; dated Fri, 22 Jul 2022 05:36:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 56693 <at> debbugs.gnu.org:


Received: (at 56693) by debbugs.gnu.org; 23 Jul 2022 06:30:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 23 02:30:21 2022
Received: from localhost ([127.0.0.1]:42989 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oF8eb-0005SQ-Ig
	for submit <at> debbugs.gnu.org; Sat, 23 Jul 2022 02:30:21 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47056)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oF8eW-0005Rs-CQ
 for 56693 <at> debbugs.gnu.org; Sat, 23 Jul 2022 02:30:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=LyyjfOXz4zuhyBb9B7PXNYIPAfZyk/RhCn5zMqWKKkU=; b=bqBgNoPZivAESNMOs0X+hajzLb
 3cVNClx5sDw9RiwCAbbDbc7tzYiDgAxQwgLRRWXtzgoAARoKvEoI2VTF+EJvjVvtR/doWmktsN+Ip
 6NsG4VOHSnXsNPRGKUgaNlYlQFwabE8gdNBmUk0GGpjyV4tLV5swOVMKiZ3fpWwu/xYc=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oF8eM-0007jc-MU; Sat, 23 Jul 2022 08:30:08 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Gabriel <gabriel376@HIDDEN>
Subject: Re: bug#56693: 29.0.50; write-file does not respect uniquify.el
In-Reply-To: <SJ0PR06MB86097B4797BE29E0E56F18338B909@HIDDEN>
 (Gabriel's message of "Fri, 22 Jul 2022 02:30:01 -0300")
References: <SJ0PR06MB86097B4797BE29E0E56F18338B909@HIDDEN>
X-Now-Playing: Rival Consoles's _Kid Velo_: "Into The Heart II"
Date: Sat, 23 Jul 2022 08:30:04 +0200
Message-ID: <87zgh05ok3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Gabriel <gabriel376@HIDDEN> writes: > But it seems to
 be an unnecessary change,
 since `rename-bufer' calls > `uniquify--rename-buffer-advice'.
 The root-cause might be related to > `rename-buffer' passing the result of
 `generate-new-buff [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56693
Cc: Stefan Monnier <monnier@HIDDEN>, 56693 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Gabriel <gabriel376@HIDDEN> writes:

> But it seems to be an unnecessary change, since `rename-bufer' calls
> `uniquify--rename-buffer-advice'. The root-cause might be related to
> `rename-buffer' passing the result of `generate-new-buffer-name' (that
> generates "x<2>") to `uniquify--rename-buffer-advice'.

The code in rename-buffer was added in:

commit 1a724cc2d2e7f08b9fcad569c8cacf126ad55791
Author:     Stefan Monnier <monnier@HIDDEN>
AuthorDate: Mon Dec 27 19:47:23 2021 -0500

I've added Stefan to the CCs; perhaps he has some comments here.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56693; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Jul 2022 05:35:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 22 01:35:32 2022
Received: from localhost ([127.0.0.1]:39879 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oElK0-0002ol-Dq
	for submit <at> debbugs.gnu.org; Fri, 22 Jul 2022 01:35:32 -0400
Received: from lists.gnu.org ([209.51.188.17]:55222)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabriel376@HIDDEN>) id 1oElJn-0002oQ-4j
 for submit <at> debbugs.gnu.org; Fri, 22 Jul 2022 01:35:30 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33104)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriel376@HIDDEN>)
 id 1oElJl-0000Xj-7l
 for bug-gnu-emacs@HIDDEN; Fri, 22 Jul 2022 01:35:18 -0400
Received: from mail-mw2nam12olkn20830.outbound.protection.outlook.com
 ([2a01:111:f400:fe5a::830]:44128
 helo=NAM12-MW2-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gabriel376@HIDDEN>)
 id 1oElJi-0003nD-Lc
 for bug-gnu-emacs@HIDDEN; Fri, 22 Jul 2022 01:35:16 -0400
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bw/AJLjpBSHvdNhBXLYu/FoABDcqg3JHbjB2hMVAGxmrWBMWzFHHyrDPIsLqYB58jKwBMgYaFNb3b4UUa/iSFZaD6oi6BtJcTcuPWDhs49gdISo4+moRPcJHQ2pGkjy1NjzSi5LvMTngmvvxubRm8QgJjv5YOf4Oq97XktrykwsEeryNAg3rKx2OgbRi/FdXNKnAD3g1bwAWtEmtMjzQjp0Pp0vzGTUOeZZfQOxKfxpkwWDppumJU2wJkWTgYVLx0+LdN85l/zyp0w0czt7np9WQ3mIf80H0sr2MxDMqQN+92sq0/86w8xslcTQ9IurzSFD+3sACmA8x5ECoYvix1A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6CfAIpDho+OdXvjmtNUxI3so+xtzWVAZWnE3aCD1I2E=;
 b=Hl6G6HwlIGhU4PM6m5J0uZ2oxUM/+TfWKxa08SAKIKsxoSt4cJionFKV+/+uuDc+zbqjMyGz4CHbIu/8SYpBJuiog1Z1LP5mPxTw9202I5EGFGSMModqVQrGu95CpOqHGaPaCVzh2K4tpbbgaq9zadWlDzAe8YIGsKA2tuPP4kDx6nbgh/I/DEIsGT9zfmpbubPtwxtJCIZK8WBSCsZ5U79Al9Ca2P5HziN6RsFdV39UuxSe4xouOM4iaZoEGMJ9WPsbGL6dpDnrCb4jBNdZhF1B6k6z2CaDWhQ/p3CxENiloxhLNb+MjYT/uS9Stz3BcIeS2DouzfI0NwZdGn858g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6CfAIpDho+OdXvjmtNUxI3so+xtzWVAZWnE3aCD1I2E=;
 b=d0olFI/xoTFd0RzZZdd06JhKMANloXkJRIQ6pw2BJJ6zva46gnNtcWUBTrEky+4OcgEeg8Cg/dz/qlnQQB1gw7GTaUvICE9VfEgIrzceHn0xvbL3A6U8Wz8ugls9zh4U4atygHgsUb1l/4FznUJTQDmUTfxnbvl6ibbbKw5e18dvikvNjfGIP0TX6Y7JqVkjp5Xx4N47FQxw3JAabdnirJ7tm9goME7C5M1QYW8eXXSlqJ1AYFOcxMJ49VYXMAGnSXP/7U0I4Y3JTOaoGBVwHFN834VCOzox55X4ad446kmbHDz+XQtmZJ87xlaYJ6rsguTC3kR2UB1vYfHsxRkWwA==
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com (2603:10b6:a03:40c::11)
 by DM6PR06MB6602.namprd06.prod.outlook.com (2603:10b6:5:254::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.20; Fri, 22 Jul
 2022 05:30:08 +0000
Received: from SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::c63:ccef:b16f:f28f]) by SJ0PR06MB8609.namprd06.prod.outlook.com
 ([fe80::c63:ccef:b16f:f28f%5]) with mapi id 15.20.5438.024; Fri, 22 Jul 2022
 05:30:08 +0000
From: Gabriel <gabriel376@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; write-file does not respect uniquify.el
Date: Fri, 22 Jul 2022 02:30:01 -0300
Message-ID: <SJ0PR06MB86097B4797BE29E0E56F18338B909@HIDDEN>
Content-Type: text/plain
X-TMN: [L79h2ip2PkfDQDVgu8TE+gI2AtdHRZANThobrvMFodzASLtrzJZfckzt/6emlkX8]
X-ClientProxiedBy: CP3P284CA0105.BRAP284.PROD.OUTLOOK.COM
 (2603:10d6:103:6f::20) To SJ0PR06MB8609.namprd06.prod.outlook.com
 (2603:10b6:a03:40c::11)
X-Microsoft-Original-Message-ID: <87mtd14sva.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 2ecbd9be-1199-44ae-cdf0-08da6ba33d9f
X-MS-TrafficTypeDiagnostic: DM6PR06MB6602:EE_
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: NtUYsJou09RzupsoLbgMnvVHHuBjFnsj3wPo8Y7v3Ry/Uk8qoXy9pvj0sHX9aSBPZ+DbGc2MXeDjiV/j64kX10x8OLp3aZgIFe9sRLrzrnFcpUhf7oV+HUhVQvmz6LL/NfJa0Bz8LqZrhpKqVZMh3YrnBb0uxzLdeSis8UIHhYtO/8j07mnXP2W+OwH9uwQ3ActEF/Kat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wo6TXaYMQ+QOslO2o2WTJnqfuJjBp7zZzQjBG?=
 =?us-ascii?Q?R0WB6XhIjhh2TAUXud/TD760PaRTScGsbM49ToC2n2lrtw=3D=3D?=
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-89723.templateTenant
X-MS-Exchange-CrossTenant-Network-Message-Id: 2ecbd9be-1199-44ae-cdf0-08da6ba33d9f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR06MB8609.namprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2022 05:30:08.8913 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR06MB6602
Received-SPF: pass client-ip=2a01:111:f400:fe5a::830;
 envelope-from=gabriel376@HIDDEN;
 helo=NAM12-MW2-obe.outbound.protection.outlook.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 2.8 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: Description: The `write-file' command (C-x C-w) does not
 respect
 `uniquify.el'. Steps to reproduce (correct case): 1) emacs -Q 2) eval (setopt
 uniquify-buffer-name-style 'forward) 3) C-x C-f "~/tmp/a/x" 4) C-x C-f
 "~/tmp/b/x"
 5) The buffers are renamed are expected: "a/x" and "b/ [...] 
 Content analysis details:   (2.8 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (gabriel376[at]hotmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (gabriel376[at]hotmail.com)
 1.5 SPOOFED_FREEMAIL       No description available.
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

Description:
The `write-file' command (C-x C-w) does not respect `uniquify.el'.

Steps to reproduce (correct case):
1) emacs -Q
2) eval (setopt uniquify-buffer-name-style 'forward)
3) C-x C-f "~/tmp/a/x"
4) C-x C-f "~/tmp/b/x"
5) The buffers are renamed are expected: "a/x" and "b/x"

Steps to reproduce (bug case):
1) emacs -Q
2) eval (setopt uniquify-buffer-name-style 'forward)
3) C-x C-f "~/tmp/a/x"
4) C-x C-f "~/tmp/b/y"
5) C-x C-w "~/tmp/b/x"
6) The buffers are not named correctly: "x" and "x<2>"

I did not have time to look deep into this problem, but the following
patch seems to work as expected:
From 3e2ef93862ad13650854a34982c320aaafbf2b6f Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376@HIDDEN>
Date: Fri, 22 Jul 2022 01:14:11 -0300
Subject: [PATCH 1/1] * files.el (set-visited-file-name): Respect uniquify.el

---
 lisp/files.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/files.el b/lisp/files.el
index bc74dfa738..2051cc0f95 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4714,7 +4714,7 @@ set-visited-file-name
          ;; If new-name == old-name, renaming would add a spurious <2>
          ;; and it's considered as a feature in rename-buffer.
          (or (string= new-name (buffer-name))
-             (rename-buffer new-name t))))
+             (uniquify--rename-buffer-advice new-name t))))
     (setq buffer-backed-up nil)
     (or along-with-file
        (clear-visited-file-modtime))
--
2.34.1

But it seems to be an unnecessary change, since `rename-bufer' calls
`uniquify--rename-buffer-advice'. The root-cause might be related to
`rename-buffer' passing the result of `generate-new-buffer-name' (that
generates "x<2>") to `uniquify--rename-buffer-advice'.

---
Gabriel


In GNU Emacs 29.0.50 (build 27, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
 of 2022-07-21 built on 4BQPCJ3
Repository revision: 46e07d0a4bdb19b0aed26917227d7846bdb0f43c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Ubuntu 22.04 LTS




Acknowledgement sent to Gabriel <gabriel376@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#56693; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 23 Jul 2022 06:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.