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#66546: 30.0.50; save-buffer to write-protected file without backup fails Date: Sun, 15 Oct 2023 12:54:18 +0300 Message-ID: <83ttqsp5x1.fsf@gnu.org> References: <83h6mtq9t7.fsf@gnu.org> <8734ydx7x3.fsf@sappc2.fritz.box> <83cyxgqwjm.fsf@gnu.org> <87lec4cjqe.fsf@sappc2.fritz.box> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38524"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66546@debbugs.gnu.org To: Jens Schmidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 15 11:55:53 2023 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 1qrxqi-0009mT-RG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Oct 2023 11:55:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrxqX-0006ZY-FS; Sun, 15 Oct 2023 05:55:41 -0400 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 1qrxqV-0006V5-9n for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 05:55:39 -0400 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 1qrxqU-0004lu-WE for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 05:55:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrxqt-0005DG-2b for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 05:56:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Oct 2023 09:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66546 X-GNU-PR-Package: emacs Original-Received: via spool by 66546-submit@debbugs.gnu.org id=B66546.169736370819944 (code B ref 66546); Sun, 15 Oct 2023 09:56:03 +0000 Original-Received: (at 66546) by debbugs.gnu.org; 15 Oct 2023 09:55:08 +0000 Original-Received: from localhost ([127.0.0.1]:51227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrxpz-0005Bc-RO for submit@debbugs.gnu.org; Sun, 15 Oct 2023 05:55:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrxpx-0005B4-56 for 66546@debbugs.gnu.org; Sun, 15 Oct 2023 05:55:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrxpT-0004R2-9A; Sun, 15 Oct 2023 05:54:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6Jfi3pCa+cK4tDR8mdupOg7T8ZFPDVrmuvn8JcpfR18=; b=Li+q5a6EvFJJ mpwS0ynPNaFLgg8ouHLIsAh5WhoXgI2XBW8hoQBuO2pAIRTs8KqJiOlyE6FbXdUTYxBwN/hf0P+D5 na46AebLoJGSW4gSJ3dMA8vRnBxBkmM+s/eEVudVpB1oWIRo46CP7VbU8nDcTk1AUmH5mquMTb7rg cvluZSqrNwmqUuyMGVVZF+ZRcMjHBlOQtOD/APVF4y9nMaTidFXVSKJ84saf1i+2GCTkuoT5JLlQZ 3DN1UUX3SQhrc9APOwEgOOVCR0v2PXQxt5560QUFrMrp3kcsq2kLItCzqp4B1ctHETm6yRCIM1W3e 6ryc1flLeC2eDbGpeyxnAQ==; In-Reply-To: <87lec4cjqe.fsf@sappc2.fritz.box> (message from Jens Schmidt on Sun, 15 Oct 2023 11:34:17 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272495 Archived-At: > From: Jens Schmidt > Cc: 66546@debbugs.gnu.org > Date: Sun, 15 Oct 2023 11:34:17 +0200 > > Now the Emacs 29 code. We simplify that in the assumption, that the > extended attribute calls always succeed, and that we do not need the > regular calls: > > (setq setmodes (list (file-extended-attributes buffer-file-name) > buffer-file-name)) > (set-file-extended-attributes buffer-file-name > (nth 0 setmodes)) > > The pseudo-code here looks like this: > > setmodes = file-extended-attributes (buffer-file-name); > set-file-extended-attributes (setmodes); That's not what the code does, since it does call (set-file-modes buffer-file-name (logior (car setmodes) 128)) But I think I can guess what you wanted to say: you wanted to say that set-file-modes is called _only_ if set-file-extended-attributes fails, and it doesn't fail in this scenario. Is that what you wanted to say?