GNU bug report logs - #17148
Revert buffer menu-item and file permission changes

Previous Next

Package: emacs;

Reported by: Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov>

Date: Mon, 31 Mar 2014 15:45:02 UTC

Severity: minor

Found in version 23.1

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17148 in the body.
You can then email your comments to 17148 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Mon, 31 Mar 2014 15:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 31 Mar 2014 15:45:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; Revert Buffer
Date: Mon, 31 Mar 2014 13:33:23 GMT
A buffer has been loaded with a file.  It is initially unwritable.  A chmod is performed in a shell window to make it writable.  Going into the File menu pulldown, the Revert Buffer stays gray-ed out, and the file is still listed as unwritable.  


In GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.18.9)
 of 2011-02-01 on x86-003.build.bos.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.60900000
configured using `configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.iso88591
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t

Major mode: Tcl

Minor modes in effect:
  text-scale-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
nd-emacs-bug-report>

Recent messages:
Cannot write backup file; backing up in /home/jcamaion/%backup%~
Wrote /home/vobadm/bin/AR_QA_pkg.exp
Saving file /home/vobadm/bin/AR_QA_pkg.exp...
Wrote /home/vobadm/bin/AR_QA_pkg.exp
Note: file is write protected
Mark saved where search started
Note: file is write protected
Buffer is read-only: #<buffer AP_QA_tar.exp>
Mark saved where search started
call-interactively: Text is read-only




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 01 Apr 2014 07:07:02 GMT) Full text and rfc822 format available.

Message #8 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Tue, 01 Apr 2014 09:06:32 +0200
Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov> writes:

> A buffer has been loaded with a file.  It is initially unwritable.  A chmod is performed in a shell window to make it writable.  Going into the File menu pulldown, the Revert Buffer stays gray-ed out, and the file is still listed as unwritable.

Emacs is not notified, when a file changes its state outside Emacs. Only
prior to writing to a file Emacs checks, whether a file has changed on disk.

The upcoming Emacs 24.4 has implemented file notifications on systems
which support it (mainly GNU/Linux and MS Windows). This could be used
for this kind of checks.

For Emacs 23, I don't regard this as a bug.

Best regards, Michael.




Added tag(s) notabug. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Tue, 01 Apr 2014 07:09:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 17148 <at> debbugs.gnu.org and Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov> Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Tue, 01 Apr 2014 07:15:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 01 Apr 2014 15:55:02 GMT) Full text and rfc822 format available.

Message #15 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Tue, 01 Apr 2014 11:54:08 -0400
Michael Albinus wrote:

> Emacs is not notified, when a file changes its state outside Emacs. Only
> prior to writing to a file Emacs checks, whether a file has changed on disk.

Why can't the revert-buffer menu-item check the file mode bits match,
the same way it verifies the modtime? IMO it should just call
file-attributes once, and use that to check time and permissions.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 01 Apr 2014 18:05:01 GMT) Full text and rfc822 format available.

Message #18 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Tue, 01 Apr 2014 20:04:28 +0200
tags 17148 - notabug
fixed 17148 24.4
thanks

Glenn Morris <rgm <at> gnu.org> writes:

> Michael Albinus wrote:
>
>> Emacs is not notified, when a file changes its state outside Emacs. Only
>> prior to writing to a file Emacs checks, whether a file has changed on disk.
>
> Why can't the revert-buffer menu-item check the file mode bits match,
> the same way it verifies the modtime? IMO it should just call
> file-attributes once, and use that to check time and permissions.

Hmm, I wanted to implement something with file notifications.

However, surprisingly this problem is reproducible in Emacs 23, but it
is NOT reproducible with Emacs 24.3.50. This is because
`revert-buffer-function' is set to `revert-buffer--default' since last
year.

My analysis was wrong, but the result (not a bug) is somehow right for
Emacs 24.3. We shall changed that to "Fixed in 24.4", 'tho.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 01 Apr 2014 18:31:01 GMT) Full text and rfc822 format available.

Message #21 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Tue, 01 Apr 2014 14:30:34 -0400
Michael Albinus wrote:

> However, surprisingly this problem is reproducible in Emacs 23, but it
> is NOT reproducible with Emacs 24.3.50. This is because
> `revert-buffer-function' is set to `revert-buffer--default' since last
> year.

So the result is basically now that the "Revert Buffer" menu item is
always enabled, which may not be precisely what the OP wanted.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 01 Apr 2014 18:42:02 GMT) Full text and rfc822 format available.

Message #24 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Tue, 01 Apr 2014 20:40:49 +0200
Glenn Morris <rgm <at> gnu.org> writes:

>> However, surprisingly this problem is reproducible in Emacs 23, but it
>> is NOT reproducible with Emacs 24.3.50. This is because
>> `revert-buffer-function' is set to `revert-buffer--default' since last
>> year.
>
> So the result is basically now that the "Revert Buffer" menu item is
> always enabled, which may not be precisely what the OP wanted.

Yes. Maybe Stefan could explain the reasoning behind.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 01 Apr 2014 19:02:02 GMT) Full text and rfc822 format available.

Message #27 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Tue, 01 Apr 2014 15:01:17 -0400
Michael Albinus wrote:

>> So the result is basically now that the "Revert Buffer" menu item is
>> always enabled, which may not be precisely what the OP wanted.
>
> Yes. Maybe Stefan could explain the reasoning behind.

I'm going to guess it is an unintended consequence of changing the
default value of revert-buffer-function (and
revert-buffer-insert-file-contents-function) to be non-nil (which was
probably for the purpose of advice).

This change has no NEWS entry and no documentation updates.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 01 Apr 2014 20:15:02 GMT) Full text and rfc822 format available.

Message #30 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Tue, 01 Apr 2014 16:14:04 -0400
>> Emacs is not notified, when a file changes its state outside Emacs. Only
>> prior to writing to a file Emacs checks, whether a file has changed on disk.
> Why can't the revert-buffer menu-item check the file mode bits match,
> the same way it verifies the modtime? IMO it should just call
> file-attributes once, and use that to check time and permissions.

Because revert-buffer is meant to handle the file's content, not its
read-only setting.
E.g. maybe the buffer is read-only because the user hit C-x C-q.

Maybe we should use a 3rd setting for buffer-read-only which says "obey
the file's writability".


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Wed, 02 Apr 2014 06:46:02 GMT) Full text and rfc822 format available.

Message #33 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Wed, 02 Apr 2014 02:45:38 -0400
Stefan Monnier wrote:

> Because revert-buffer is meant to handle the file's content, not its
> read-only setting.

File permission bits can be viewed as just another form of content.

> E.g. maybe the buffer is read-only because the user hit C-x C-q.

Personally I would not mind seeing a non-greyed-out menu-item for Revert
Buffer in such a case. I have modified the buffer ('s meta-data)
compared to how it is on disk, so I might want to revert it.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 02 Apr 2014 06:56:02 GMT) Full text and rfc822 format available.

Changed bug title to 'Revert buffer menu-item and file permission changes' from '23.1; Revert Buffer' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 02 Apr 2014 06:56:02 GMT) Full text and rfc822 format available.

Removed tag(s) notabug. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 02 Apr 2014 06:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Wed, 02 Apr 2014 13:04:01 GMT) Full text and rfc822 format available.

Message #42 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Wed, 02 Apr 2014 09:03:14 -0400
>>> So the result is basically now that the "Revert Buffer" menu item is
>>> always enabled, which may not be precisely what the OP wanted.
>> Yes. Maybe Stefan could explain the reasoning behind.
> I'm going to guess it is an unintended consequence of changing the
> default value of revert-buffer-function (and
> revert-buffer-insert-file-contents-function) to be non-nil (which was
> probably for the purpose of advice).

Right.

> This change has no NEWS entry and no documentation updates.

It seemed "internal" enough.  But I guess I was wrong.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Wed, 02 Apr 2014 13:12:01 GMT) Full text and rfc822 format available.

Message #45 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: 23.1; Revert Buffer
Date: Wed, 02 Apr 2014 09:04:16 -0400
> Personally I would not mind seeing a non-greyed-out menu-item for Revert
> Buffer in such a case. I have modified the buffer ('s meta-data)
> compared to how it is on disk, so I might want to revert it.

I can agree, but only if revert-buffer indeed changes buffer-read-only.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 22 Feb 2022 14:46:01 GMT) Full text and rfc822 format available.

Message #48 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov>
Cc: 17148 <at> debbugs.gnu.org
Subject: Re: bug#17148: Revert buffer menu-item and file permission changes
Date: Tue, 22 Feb 2022 15:45:03 +0100
Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov> writes:

> A buffer has been loaded with a file.  It is initially unwritable.  A
> chmod is performed in a shell window to make it writable.  Going into
> the File menu pulldown, the Revert Buffer stays gray-ed out, and the
> file is still listed as unwritable.

I've now fixed this in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 17148 <at> debbugs.gnu.org and Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 22 Feb 2022 14:46:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 22 Feb 2022 16:54:01 GMT) Full text and rfc822 format available.

Message #53 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 17148 <at> debbugs.gnu.org, jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov
Subject: Re: bug#17148: Revert buffer menu-item and file permission changes
Date: Tue, 22 Feb 2022 18:53:36 +0200
> Resent-From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
> Resent-CC: bug-gnu-emacs <at> gnu.org
> Resent-Sender: help-debbugs <at> gnu.org
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 22 Feb 2022 15:45:03 +0100
> Cc: 17148 <at> debbugs.gnu.org
> 
> Joe Camaioni <jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov> writes:
> 
> > A buffer has been loaded with a file.  It is initially unwritable.  A
> > chmod is performed in a shell window to make it writable.  Going into
> > the File menu pulldown, the Revert Buffer stays gray-ed out, and the
> > file is still listed as unwritable.
> 
> I've now fixed this in Emacs 29.

Did you forget to push, by chance?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17148; Package emacs. (Tue, 22 Feb 2022 17:57:01 GMT) Full text and rfc822 format available.

Message #56 received at 17148 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 17148 <at> debbugs.gnu.org, jcamaion <at> tbfmdev1.ctasdev.tc.faa.gov
Subject: Re: bug#17148: Revert buffer menu-item and file permission changes
Date: Tue, 22 Feb 2022 18:56:25 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> Did you forget to push, by chance?

Indeed.  Now pushed.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 23 Mar 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 115 days ago.

Previous Next


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