From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#50431: revert-buffer doesn't preserve read-onlyness Date: Wed, 08 Sep 2021 23:07:35 -0400 Message-ID: References: <87mtopkj2a.fsf@mail.linkov.net> <3ny289k6bd.fsf@fencepost.gnu.org> <87pmtkbcy4.fsf@gnus.org> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7417"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rgm@gnu.org, 50431@debbugs.gnu.org, juri@linkov.net To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 09 05:08:17 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 1mOAQD-0001m7-LF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Sep 2021 05:08:17 +0200 Original-Received: from localhost ([::1]:45732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOAQC-0005xS-0H for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Sep 2021 23:08:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOAPy-0005tM-5Q for bug-gnu-emacs@gnu.org; Wed, 08 Sep 2021 23:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOAPx-0008EW-TF for bug-gnu-emacs@gnu.org; Wed, 08 Sep 2021 23:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mOAPx-0004Ly-Jl for bug-gnu-emacs@gnu.org; Wed, 08 Sep 2021 23:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Sep 2021 03:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50431 X-GNU-PR-Package: emacs Original-Received: via spool by 50431-submit@debbugs.gnu.org id=B50431.163115686516712 (code B ref 50431); Thu, 09 Sep 2021 03:08:01 +0000 Original-Received: (at 50431) by debbugs.gnu.org; 9 Sep 2021 03:07:45 +0000 Original-Received: from localhost ([127.0.0.1]:33836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOAPg-0004LT-Rd for submit@debbugs.gnu.org; Wed, 08 Sep 2021 23:07:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOAPf-0004LD-OJ for 50431@debbugs.gnu.org; Wed, 08 Sep 2021 23:07:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42854) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOAPZ-0007sk-Dw; Wed, 08 Sep 2021 23:07:37 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mOAPX-0005Wx-VA; Wed, 08 Sep 2021 23:07:36 -0400 In-Reply-To: <87pmtkbcy4.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 07 Sep 2021 17:52:19 +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:213870 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > Making revert-buffer preserve user-initiated readedness changes isn't > trivial. We'd need to record whether the buffer is read-only because it > was read from a read-only file (and vice versa), and then use that data > point in revert-buffer (to see whether we should respect the current > readedness state or not). How about just this: keep buffer-read-only unchanged? If it differs from the file's permissions, almost certainly the user changed it and will beglad of revert-buffer preserves it. The other case is that the file permissions have been changed since visiting the file. But users won't be shocked if revert-buffer fails to change buffer-read-only in that case, and they will know what to do. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)