Subject: auto-revert doesn't revert file permissions as revert-buffer does

From: Barry OReilly <[email-masked]>
Date: Wed, 23 May 2012 19:40:08 -0400

To reproduce this bug minimally:

Use a .emacs with only:
(global-auto-revert-mode 1)
(setq revert-without-query (quote (".*")))

Create foo.py:
# aaa
# bbb

Set permissions on foo.py:
-r-xr-xr--  1 boreilly ccgoesr        13 May 22 09:12 foo.py

Open foo.py in Emacs.

In a terminal:
chmod u+w foo.py

Wait several seconds, inserting text yields error:
Buffer is read-only: #<buffer foo.py>

Open foo.py with vim and add text:
# aaa blah
# bbb

The blah string appears in Emacs.  Insertion still fails with error:
Buffer is read-only: #<buffer foo.py>

Do: M-x revert-buffer

Insertion now works.

I would think if revert-buffer updates permissions that auto-revert would too.

An information dump from report-emacs-bug follows.

In GNU Emacs 23.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
 of 2012-03-19 on [cut]
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--prefix=[cut]/sw/emacs-install' '--with-gif=no''

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.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Python

Minor modes in effect:
  global-auto-revert-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <down> <down> <down> i <help-echo>
<help-echo> <down-mouse-1> <drag-mouse-1> <down-mouse-1>
<mouse-movement> <mouse-movement> <drag-mouse-1> <help-echo>
<down-mouse-1> <mouse-1> M-x r e p o r t - e m a c
s - b u g <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Note: file is write protected
Buffer is read-only: #<buffer foo.py>

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 hex-util hashcash mail-utils emacsbug python-21 python easymenu
comint ring autorevert tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev loaddefs button minibuffer faces cus-face files text-properties
overlay md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)