From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Change in `revert-buffer' behavior [28.0.50] Date: Tue, 27 Jul 2021 17:28:14 +0200 Message-ID: <87lf5rg4j5.fsf@telefonica.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23263"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:7JW2zX9OwJXa0yazuMd08TPCwws= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 27 17:29:10 2021 Return-path: Envelope-to: ged-emacs-devel@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 1m8P12-0005tI-Vi for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jul 2021 17:29:08 +0200 Original-Received: from localhost ([::1]:51976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8P12-00086Q-1t for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jul 2021 11:29:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8P0N-0007Mq-8X for emacs-devel@gnu.org; Tue, 27 Jul 2021 11:28:27 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:39780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8P0L-00056B-BZ for emacs-devel@gnu.org; Tue, 27 Jul 2021 11:28:27 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1m8P0I-0004jm-P3 for emacs-devel@gnu.org; Tue, 27 Jul 2021 17:28:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271700 Archived-At: Kaushal Modi writes: > Hello, > > I use the `revert-buffer' function frequently and after a recent rebuild of > emacs from master after about a month, I noticed a big difference in its > behavior. > > When I change the read-onlyness of a file from the disk, M-x revert-buffer > doesn't reflect that change any more. This is really important as I am > working in a centralized VCS where the files have to be "checked out" i.e. > make writable before I can modify them. > > Now when the commands in the terminal check in and check out the file, the > read-only/writable status doesn't update when I revert-buffer in Emacs. > > *Earlier M-x revert-buffer always showed the correct read-only state. Now, > I need to kill the buffer and reopen to see the correct status.* > > I believe it is kind of related to this commit: > https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fcae435f598471a2911641412125c5ac4f73559f I think that the author was trying to preserve the user's decision about the read-only-ness of the buffer, assuming that the file's permissions did not change since last visit. AFAIK currently we have no method for distinguising if the buffer was made read-only/writable by the user or because Emacs reflected the file system's permissions.