unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
@ 2015-06-30 18:19 Mark Karpov
  2015-06-30 19:58 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 49+ messages in thread
From: Mark Karpov @ 2015-06-30 18:19 UTC (permalink / raw)
  To: 20943


***

I'm using ‘global-auto-revert-mode’ setting variable
‘global-auto-revert-non-file-buffers’ to t, like this:

  (setq global-auto-revert-non-file-buffers t)
  (global-auto-revert-mode                  1)

As far as I know, this is normal way to make Dired automatically
redisplay its buffer when contents of target directory are
changed. However, it doesn't always work. In some cases Dired buffer is
updated just fine, but there are also times when changes in target
directory don't cause redisplaying.

Is it a known problem? Can it be fixed? If it's a problem unique to my
machine (I doubt it, though) I can give your more information.

***



In GNU Emacs 25.0.50.13 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.4)
 of 2015-06-27 on arch
Repository revision: ff80437668dd0d5163c9e43f0c200b923b39166b
Windowing system distributor `The X.Org Foundation', version 11.0.11702000
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ε

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  rainbow-delimiters-mode: t
  flycheck-mode: t
  flyspell-mode: t
  whitespace-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  show-paren-mode: t
  minibuffer-electric-default-mode: t
  ido-vertical-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  global-auto-revert-mode: t
  global-aggressive-indent-mode: t
  aggressive-indent-mode: t
  display-time-mode: t
  delete-selection-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t
  auto-fill-mode: 1

Recent messages:
Truncate long lines enabled [2 times]
Tuesday, 30 June 2015
Truncate long lines enabled [2 times]
Compilation finished
Comint finished
user-error: No undo information in this buffer
next-line: End of buffer [11 times]
Truncate long lines enabled [2 times]
Mark set
Truncate long lines enabled [2 times]
Quit

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail smex misearch multi-isearch
tronesque-theme ace-window vc vc-dispatcher haskell-doc inf-haskell
haskell-decl-scan imenu shell pcomplete haskell haskell-completions
haskell-load haskell-commands highlight-uses-mode haskell-modules
haskell-sandbox haskell-repl haskell-debug haskell-interactive-mode
haskell-presentation-mode haskell-collapse haskell-navigate-imports
haskell-compile haskell-process haskell-session json haskell-indent
haskell-font-lock haskell-mode haskell-string haskell-sort-imports
haskell-align-imports haskell-compat haskell-complete-module flymake
dabbrev haskell-customize bookmark names edebug vc-git diff-mode
autoload lisp-mnt mm-archive url-http url-gw url-cache url-auth url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-handlers url-parse url-vars hl-line nndraft nnmh
nnfolder utf-7 epa-file epa derived epg gnutls network-stream nsm
auth-source starttls gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime
password-cache dig mailcap nntp gnus-cache gnus-sum gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source tls utf7 netrc nnoo
parse-time gnus-spec gnus-int gnus-range message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
gnus-ems nnheader gnus-util mail-utils mm-util help-fns mail-prsvr
wid-edit rainbow-delimiters flycheck-haskell haskell-cabal haskell-utils
flycheck find-func rx subr-x flyspell ispell whitespace mk-visual
solarized-dark-theme solarized mk-texinfo mk-tex mk-scheme mk-python
mk-prolog mk-org mk-markdown mk-man mk-magit mk-lisp slime-fancy
slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations bridge
slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-repl slime-parse slime
compile etags xref eieio eieio-core arc-mode archive-mode noutline
outline pp comint ansi-color ring hyperspec browse-url slime-autoloads
mk-ibuffer mk-haskell mk-gnus mk-eshell mk-erc mk-elisp mk-dired mk-diff
mk-clojure mk-calendar mk-c mk-bookmark mk-minor-modes
common-lisp-snippets yasnippet help-mode cl whole-line-or-region paren
minibuf-eldef ido-vertical-mode ido-ubiquitous ido-completing-read+
cl-macs gv ido autorevert filenotify cl-seq aggressive-indent easy-mmode
time delsel smartparens-config smartparens byte-opt thingatpt mk-global
edmacro kmacro ace-link avy mk-utils f dash s ucs-normalize mk-abbrev
misc server finder-inf tex-site fix-word info easymenu advice bytecomp
byte-compile cl-extra seq cl-loaddefs pcase cl-lib cconv package
epg-config time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind gfilenotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 494815 102093)
 (symbols 48 46299 0)
 (miscs 40 148 693)
 (strings 32 104873 65503)
 (string-bytes 1 2973069)
 (vectors 16 71619)
 (vector-slots 8 1951411 189879)
 (floats 8 618 1174)
 (intervals 56 2093 556)
 (buffers 976 26)
 (heap 1024 71280 9117))





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-06-30 18:19 bug#20943: 25.0.50; Dired buffers are not always auto-reverterd Mark Karpov
@ 2015-06-30 19:58 ` Eli Zaretskii
  2015-07-01  5:58   ` Michael Albinus
       [not found]   ` <87y4j0fj8m.fsf@openmailbox.org>
  2015-07-01  7:23 ` Mark Karpov
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 49+ messages in thread
From: Eli Zaretskii @ 2015-06-30 19:58 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Wed, 01 Jul 2015 00:19:36 +0600
> 
> I'm using ‘global-auto-revert-mode’ setting variable
> ‘global-auto-revert-non-file-buffers’ to t, like this:
> 
>   (setq global-auto-revert-non-file-buffers t)
>   (global-auto-revert-mode                  1)
> 
> As far as I know, this is normal way to make Dired automatically
> redisplay its buffer when contents of target directory are
> changed. However, it doesn't always work. In some cases Dired buffer is
> updated just fine, but there are also times when changes in target
> directory don't cause redisplaying.
> 
> Is it a known problem? Can it be fixed? If it's a problem unique to my
> machine (I doubt it, though) I can give your more information.

Does it happen with some specific type of directories, like those
mounted in some special way?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-06-30 19:58 ` Eli Zaretskii
@ 2015-07-01  5:58   ` Michael Albinus
  2015-07-01  7:15     ` Mark Karpov
       [not found]   ` <87y4j0fj8m.fsf@openmailbox.org>
  1 sibling, 1 reply; 49+ messages in thread
From: Michael Albinus @ 2015-07-01  5:58 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Mark Karpov <markkarpov@openmailbox.org>
>> Date: Wed, 01 Jul 2015 00:19:36 +0600
>> 
>> I'm using ‘global-auto-revert-mode’ setting variable
>> ‘global-auto-revert-non-file-buffers’ to t, like this:
>> 
>>   (setq global-auto-revert-non-file-buffers t)
>>   (global-auto-revert-mode                  1)
>> 
>> As far as I know, this is normal way to make Dired automatically
>> redisplay its buffer when contents of target directory are
>> changed. However, it doesn't always work. In some cases Dired buffer is
>> updated just fine, but there are also times when changes in target
>> directory don't cause redisplaying.
>> 
>> Is it a known problem? Can it be fixed? If it's a problem unique to my
>> machine (I doubt it, though) I can give your more information.
>
> Does it happen with some specific type of directories, like those
> mounted in some special way?

Furthermore, which kind of changes of the directory are you referring
to? Reading `dired-buffer-stale-p', the dired buffer shall be reverted
only if there is a new file in the directory, or a file is removed. Just
changing (the timestamp of) a file in the directory shall not revert the
dired buffer.

A second thought: auto-reverting dired buffers has been changed to use
file notifications. Does it make a difference, when you eval the form
(setq auto-revert-use-notify nil) ?

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-01  5:58   ` Michael Albinus
@ 2015-07-01  7:15     ` Mark Karpov
  2015-07-01  8:55       ` Michael Albinus
  2015-07-01 15:25       ` Eli Zaretskii
  0 siblings, 2 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-01  7:15 UTC (permalink / raw)
  To: Michael Albinus, 20943


> A second thought: auto-reverting dired buffers has been changed to use
> file notifications. Does it make a difference, when you eval the form
> (setq auto-revert-use-notify nil) ?

No, it doesn't make any difference.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-06-30 18:19 bug#20943: 25.0.50; Dired buffers are not always auto-reverterd Mark Karpov
  2015-06-30 19:58 ` Eli Zaretskii
@ 2015-07-01  7:23 ` Mark Karpov
  2015-07-02 10:49 ` Mark Karpov
  2015-07-09 13:24 ` bug#20943: 25.0.50; Dired buffers are not always auto-reverted Mark Karpov
  3 siblings, 0 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-01  7:23 UTC (permalink / raw)
  To: 20943


OK, I've spent an hour testing it, trying to find some way to reliably
reproduce the problem. It's quite random, but I've found a way to
reproduce it in about 50% of cases.

> Does it happen with some specific type of directories, like those
> mounted in some special way?

No, I can reproduce this in my home directory, which is not mounted in
any unusual way.

> Furthermore, which kind of changes of the directory are you referring
> to? Reading `dired-buffer-stale-p', the dired buffer shall be reverted
> only if there is a new file in the directory, or a file is
> removed. Just changing (the timestamp of) a file in the directory
> shall not revert the dired buffer.

By changes I mean deletion of files or creation of files, see below.

How to reproduce:

1. emacs -Q

2. Open some directory in Dired.

3. Invoke shell or Emacs shell. Now I think this bug is most likely
   happens when directory is changed in an automated way (maybe I'm
   mistaken). Personally I use a script that transforms some files
   (script written in Python, splits music files according to CUE file +
   some magic, but it doesn't really matter). That means that some files
   are created and old files are deleted.

4. Once I press C-m or Enter, there are two possible cases (each having
   about 50 % probability): either all changes are reflected in Dired
   buffer (that's in other window, window in Emacs sense of the word),
   or all the changes go invisible and I have to switch to Dired buffer
   and press g to see results.

That's pretty much all I can say. Not very helpful, but this is how I
can more or less reliably reproduce it.

> A second thought: auto-reverting dired buffers has been changed to use
> file notifications. Does it make a difference, when you eval the form
> (setq auto-revert-use-notify nil) ?

I'll test it as soon as I can.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-01  7:15     ` Mark Karpov
@ 2015-07-01  8:55       ` Michael Albinus
  2015-07-01  9:09         ` Mark Karpov
  2015-07-01 15:25       ` Eli Zaretskii
  1 sibling, 1 reply; 49+ messages in thread
From: Michael Albinus @ 2015-07-01  8:55 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

Mark Karpov <markkarpov@openmailbox.org> writes:

>> A second thought: auto-reverting dired buffers has been changed to use
>> file notifications. Does it make a difference, when you eval the form
>> (setq auto-revert-use-notify nil) ?
>
> No, it doesn't make any difference.

Just to be sure: You have evalled that form prior opening the dired
buffer, and setting it to auto-revert-mode?

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-01  8:55       ` Michael Albinus
@ 2015-07-01  9:09         ` Mark Karpov
  2015-07-01 15:38           ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-01  9:09 UTC (permalink / raw)
  To: Michael Albinus, 20943


> Just to be sure: You have evalled that form prior opening the dired
> buffer, and setting it to auto-revert-mode?

Yes, I added that to my configuration file and restarted Emacs. In my
config I have this:

  (global-auto-revert-mode 1)

so Dired is always in auto-revert-mode by default.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
       [not found]   ` <87y4j0fj8m.fsf@openmailbox.org>
@ 2015-07-01 15:24     ` Eli Zaretskii
  2015-07-02  8:02       ` Mark Karpov
  0 siblings, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-01 15:24 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

[Please keep the bug address on the CC list.]

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Wed, 01 Jul 2015 13:08:09 +0600
> 
> 
> 1. emacs -Q
> 
> 2. Open some directory in Dired.
> 
> 3. Invoke shell or Emacs shell. Now I think this bug is most likely
>    happens when directory is changed in an automated way (maybe I'm
>    mistaken). Personally I use a script that transforms some files
>    (script written in Python, splits music files according to CUE file +
>    some magic, but it doesn't really matter). That means that some files
>    are created and old files are deleted.
> 
> 4. Once I press C-m or Enter, there are two possible cases (each having
>    about 50 % probability): either all changes are reflected in Dired
>    buffer (that's in other window, window in Emacs sense of the word),
>    or all the changes go invisible and I have to switch to Dired buffer
>    and press g to see results.

Are all of the changes in the same directory?

Also, can you show the list of changes that script does in a single
invocation, in terms of how many files are created, how many deleted,
and in which order?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-01  7:15     ` Mark Karpov
  2015-07-01  8:55       ` Michael Albinus
@ 2015-07-01 15:25       ` Eli Zaretskii
  1 sibling, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-01 15:25 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943, michael.albinus

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Wed, 01 Jul 2015 13:15:54 +0600
> 
> > A second thought: auto-reverting dired buffers has been changed to use
> > file notifications. Does it make a difference, when you eval the form
> > (setq auto-revert-use-notify nil) ?
> 
> No, it doesn't make any difference.

You need to change that via customize-variable, because this option
has a non-trivial setting function.  Did you do that?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-01  9:09         ` Mark Karpov
@ 2015-07-01 15:38           ` Eli Zaretskii
  0 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-01 15:38 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943, michael.albinus

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Wed, 01 Jul 2015 15:09:25 +0600
> 
> > Just to be sure: You have evalled that form prior opening the dired
> > buffer, and setting it to auto-revert-mode?
> 
> Yes, I added that to my configuration file and restarted Emacs. In my
> config I have this:
> 
>   (global-auto-revert-mode 1)
> 
> so Dired is always in auto-revert-mode by default.

For the record, I can't reproduce any of this.  I tried both with file
notifications and without them, and I could never see a change that
was skipped.

When this happens to you, i.e. in those 50% of cases, did you try
waiting for some time for the changes to be reflected in the buffer?

Also, if you disable auto-revert-use-notify, reproduce the problem
(i.e. run the script and observe no changes), and then type the
following

  M-: (dired-directory-changed-p DIRNAME) RET

where DIRNAME is the absolute file name of the directory shown by
Dired, what does Emacs show?  If it shows nil, please step through the
body of dired-directory-changed-p, and see why it doesn't see the
directory as changed.  (It relies on the time stamp of the directory
-- does that somehow fail to change on your system?)





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-01 15:24     ` Eli Zaretskii
@ 2015-07-02  8:02       ` Mark Karpov
  2015-07-02 14:52         ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-02  8:02 UTC (permalink / raw)
  To: Eli Zaretskii, 20943


> Are all of the changes in the same directory?

Yes.

> Also, can you show the list of changes that script does in a single
> invocation, in terms of how many files are created, how many deleted,
> and in which order?

Typically it's something like this:

Initial state:

  Something.cue
  Something.ape

Changes:

  Created ‘01 Track Title.flac’
  Created ‘02 Another Track Title.flac’
  …
  Created ‘NN Track Title.flac’
  Deleted ‘Something.cue’
  Deleted ‘Something.ape’

> You need to change that via customize-variable, because this option
> has a non-trivial setting function.  Did you do that?

No, I didn't know that until now. See results of new experiments below.

> For the record, I can't reproduce any of this.  I tried both with file
> notifications and without them, and I could never see a change that
> was skipped.

It's sort of bug that is not easy to catch. I've noticed it some time
ago in different circumstances, but ignored it, because it seemed too
minor.

> When this happens to you, i.e. in those 50% of cases, did you try
> waiting for some time for the changes to be reflected in the buffer?

I don't know how long I'm supposed to wait, it certainly takes quite a
while. A couple days ago I started the script, then went away from my
laptop to do other things, then when I returned contents of directory
were still “frozen”. I don't think waiting can help here.

> Also, if you disable auto-revert-use-notify, reproduce the problem
> (i.e. run the script and observe no changes), and then type the
> following
>
>   M-: (dired-directory-changed-p DIRNAME) RET
>
> where DIRNAME is the absolute file name of the directory shown by
> Dired, what does Emacs show?  If it shows nil, please step through the
> body of dired-directory-changed-p, and see why it doesn't see the
> directory as changed.  (It relies on the time stamp of the directory
> -- does that somehow fail to change on your system?)

I've set ‘auto-revert-use-nofity’ like this:

  (custom-set-variables
   '(auto-revert-use-notify nil))

Then I managed to reproduce this behavior. After that, I evaluated

  (dired-directory-changed-p DIRNAME)

and result was t. Any ideas what's going on?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-06-30 18:19 bug#20943: 25.0.50; Dired buffers are not always auto-reverterd Mark Karpov
  2015-06-30 19:58 ` Eli Zaretskii
  2015-07-01  7:23 ` Mark Karpov
@ 2015-07-02 10:49 ` Mark Karpov
  2015-07-09 13:24 ` bug#20943: 25.0.50; Dired buffers are not always auto-reverted Mark Karpov
  3 siblings, 0 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-02 10:49 UTC (permalink / raw)
  To: Eli Zaretskii, 20943


> Are all of the changes in the same directory?

Yes.

> Also, can you show the list of changes that script does in a single
> invocation, in terms of how many files are created, how many deleted,
> and in which order?

Typically it's something like this:

Initial state:

  Something.cue
  Something.ape

Changes:

  Created ‘01 Track Title.flac’
  Created ‘02 Another Track Title.flac’
  …
  Created ‘NN Track Title.flac’
  Deleted ‘Something.cue’
  Deleted ‘Something.ape’

> You need to change that via customize-variable, because this option
> has a non-trivial setting function.  Did you do that?

No, I didn't know that until now. See results of new experiments below.

> For the record, I can't reproduce any of this.  I tried both with file
> notifications and without them, and I could never see a change that
> was skipped.

It's sort of bug that is not easy to catch. I've noticed it some time
ago in different circumstances, but ignored it, because it seemed too
minor.

> When this happens to you, i.e. in those 50% of cases, did you try
> waiting for some time for the changes to be reflected in the buffer?

I don't know how long I'm supposed to wait, it certainly takes quite a
while. A couple days ago I started the script, then went away from my
laptop to do other things, then when I returned contents of directory
were still “frozen”. I don't think waiting can help here.

> Also, if you disable auto-revert-use-notify, reproduce the problem
> (i.e. run the script and observe no changes), and then type the
> following
>
>   M-: (dired-directory-changed-p DIRNAME) RET
>
> where DIRNAME is the absolute file name of the directory shown by
> Dired, what does Emacs show?  If it shows nil, please step through the
> body of dired-directory-changed-p, and see why it doesn't see the
> directory as changed.  (It relies on the time stamp of the directory
> -- does that somehow fail to change on your system?)

I've set ‘auto-revert-use-nofity’ like this:

  (custom-set-variables
   '(auto-revert-use-notify nil))

Then I managed to reproduce this behavior. After that, I evaluated

  (dired-directory-changed-p DIRNAME)

and result was t. Any ideas what's going on?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-02  8:02       ` Mark Karpov
@ 2015-07-02 14:52         ` Eli Zaretskii
  2015-07-03  7:33           ` Mark Karpov
  0 siblings, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-02 14:52 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Thu, 02 Jul 2015 14:02:02 +0600
> 
> I've set ‘auto-revert-use-nofity’ like this:
> 
>   (custom-set-variables
>    '(auto-revert-use-notify nil))
> 
> Then I managed to reproduce this behavior. After that, I evaluated
> 
>   (dired-directory-changed-p DIRNAME)
> 
> and result was t. Any ideas what's going on?

The next step is to verify that the auto-revert-handler function is
called every 5 sec as expected.  Can you add to its beginning some
printout that, say, displays the value returned by
current-time-string, and see if that function gets invoked regularly?

If it does, then it should call buffer-stale-function, which Dired
sets to dired-buffer-stale-p, which should return non-nil, since you
say dired-directory-changed-p returns non-nil.  And then the buffer
should be reverted.

Please see which parts of this do not work in your case.

Thanks.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-02 14:52         ` Eli Zaretskii
@ 2015-07-03  7:33           ` Mark Karpov
  2015-07-03  8:18             ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-03  7:33 UTC (permalink / raw)
  To: Eli Zaretskii, 20943


OK, ‘auto-revert-handler’ is indeed called every 5 seconds, there is no
problem with that. However, see its source code and you will see lexical
variable called ‘revert’. This is always nil is my experiment. I checked
that ‘buffer-stale-function’ and ‘dired-directory-changed-p’ return t
after changes made by my script, however value of ‘revert’ doesn't
reflect this, it's always nil, so the rest of ‘auto-revert-handler’
(that is contained in (when revert ...)) doesn't undertake any actions
to revert the buffer. This is how it happens, I think. Any further
recommendations?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03  7:33           ` Mark Karpov
@ 2015-07-03  8:18             ` Eli Zaretskii
  2015-07-03  9:39               ` Mark Karpov
  0 siblings, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-03  8:18 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Fri, 03 Jul 2015 13:33:15 +0600
> 
> OK, ‘auto-revert-handler’ is indeed called every 5 seconds, there is no
> problem with that. However, see its source code and you will see lexical
> variable called ‘revert’. This is always nil is my experiment. I checked
> that ‘buffer-stale-function’ and ‘dired-directory-changed-p’ return t
> after changes made by my script, however value of ‘revert’ doesn't
> reflect this, it's always nil, so the rest of ‘auto-revert-handler’
> (that is contained in (when revert ...)) doesn't undertake any actions
> to revert the buffer. This is how it happens, I think. Any further
> recommendations?

Did you see all of this happening in "emacs -Q"?  If not, please try
with "emacs -Q", and see if the problem exists there as well.

Also, did you try loading autorevert.el by hand (the .el file, not the
.elc file), and if so, did that help?

Finally, when you say that 'revert's value doesn't reflect what it
should, did you actually insert 'message' printouts into the code, and
saw that happening?  If not, please try that, I'd like to see an
explicit evidence that assigning a value to that variable somehow
doesn't work there.

Thanks.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03  8:18             ` Eli Zaretskii
@ 2015-07-03  9:39               ` Mark Karpov
  2015-07-03 12:10                 ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-03  9:39 UTC (permalink / raw)
  To: Eli Zaretskii, 20943


Now with "emacs -Q"… This is what I evaluated before testing:

(custom-set-variables
 '(auto-revert-use-notify nil))

(defun auto-revert-handler ()
  "Revert current buffer, if appropriate.
This is an internal function used by Auto-Revert Mode."
  (message "invoked ‘auto-revert-handler’ at %s, for ‘%s’"
           (current-time-string)
           (buffer-name))
  (when (or auto-revert-tail-mode (not (buffer-modified-p)))
    (let* ((buffer (current-buffer)) size
           ;; Tramp caches the file attributes.  Setting
           ;; `remote-file-name-inhibit-cache' forces Tramp to reread
           ;; the values.
           (remote-file-name-inhibit-cache t)
           (revert
            (if buffer-file-name
                (and (or auto-revert-remote-files
                         (not (file-remote-p buffer-file-name)))
                     (or (not auto-revert-use-notify)
                         auto-revert-notify-modified-p)
                     (if auto-revert-tail-mode
                         (and (file-readable-p buffer-file-name)
                              (/= auto-revert-tail-pos
                                  (setq size
                                        (nth 7 (file-attributes
                                                buffer-file-name)))))
                       (funcall (or buffer-stale-function
                                    #'buffer-stale--default-function)
                                t)))
              (and (or auto-revert-mode
                       global-auto-revert-non-file-buffers)
                   (funcall (or buffer-stale-function
                                #'buffer-stale--default-function)
                            t))))
           eob eoblist)
      (message "dired-directory-changed => %s"
               (dired-directory-changed-p default-directory))
      (message "dired-buffer-stale-p => %s"
               (dired-buffer-stale-p))
      (message "buffer-stale-function => %s"
               (funcall buffer-stale-function))
      (message "revert => %s" revert)
      (setq auto-revert-notify-modified-p nil)
      (when revert
        (when (and auto-revert-verbose
                   (not (eq revert 'fast)))
          (message "Reverting buffer `%s'." (buffer-name)))
        ;; If point (or a window point) is at the end of the buffer,
        ;; we want to keep it at the end after reverting.  This allows
        ;; to tail a file.
        (when buffer-file-name
          (setq eob (eobp))
          (walk-windows
           (lambda (window)
             (and (eq (window-buffer window) buffer)
                  (= (window-point window) (point-max))
                  (push window eoblist)))
           'no-mini t))
        (if auto-revert-tail-mode
            (auto-revert-tail-handler size)
          ;; Bind buffer-read-only in case user has done C-x C-q,
          ;; so as not to forget that.  This gives undesirable results
          ;; when the file's mode changes, but that is less common.
          (let ((buffer-read-only buffer-read-only))
            (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)))
        (when buffer-file-name
          (when eob (goto-char (point-max)))
          (dolist (window eoblist)
            (set-window-point window (point-max)))))
      ;; `preserve-modes' avoids changing the (minor) modes.  But we
      ;; do want to reset the mode for VC, so we do it manually.
      (when (or revert auto-revert-check-vc-info)
        (vc-find-file-hook)))))

(global-auto-revert-mode 1)
(setq global-auto-revert-non-file-buffers t)

‘auto-revert-handler’ is slightly edited to print messages. And here is
the contents of *Messages*:

For information about GNU Emacs and the GNU system, type C-h C-a.
Deleting...done
Mark set
previous-line: Beginning of buffer [3 times]
next-line: End of buffer [9 times]
previous-line: Beginning of buffer [5 times]
Mark set
Quit
nil
next-line: End of buffer [13 times]
auto-revert-handler
t
Mark set
t
previous-line: Beginning of buffer [6 times]
next-line: End of buffer [14 times]
C-' is undefined
Quit [2 times]
Deleting...done
C-' is undefined
Quit [2 times]
auto-revert-handler
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:32 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:37 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:42 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:47 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:52 2015, for ‘ *Echo Area 1*’
Quit
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:15:57 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:02 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:07 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:12 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:17 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:22 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:27 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:32 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:37 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:42 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:47 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:52 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:16:57 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:02 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:07 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:12 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:17 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:17 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:22 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:27 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:32 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:32 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:32 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:32 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:32 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
previous-line: Beginning of buffer [29 times]
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘*scratch*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘flacize_tests’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘ *Minibuf-0*’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘ *code-conversion-work*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘ *Echo Area 0*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘ *Echo Area 1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘*Messages*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘2008, Hard Candy’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘ *Minibuf-1*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘*shell*’
invoked ‘auto-revert-handler’ at Fri Jul  3 15:17:37 2015, for ‘sh’
dired-directory-changed => nil
dired-buffer-stale-p => nil
buffer-stale-function => nil
revert => nil

So, I was wrong. Maybe I missed something. It doesn't even get to
messages that print return values of various functions. Buffer named
‘2008, Hard Candy’ was frozen during the experiment. Then I pressed ‘g’
— this refreshed it. Then I went to desktop environment (XFCE4), located
this folder and deleted a file — it was reflected in the buffer in a
second. To be honest working in "emacs -Q" is really painful, because
normally my Emacs is heavily customized… In principle if I'm the only
one to experience this thing, I don't think debugging is worth the
trouble. On the other hand my system setup is not that unique, so
theoretically many users might experience this. At any rate, I'm ready
to investigate it further, if you have some ideas.






^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03  9:39               ` Mark Karpov
@ 2015-07-03 12:10                 ` Eli Zaretskii
  2015-07-03 12:37                   ` Mark Karpov
  2015-07-03 13:02                   ` Mark Karpov
  0 siblings, 2 replies; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-03 12:10 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Fri, 03 Jul 2015 15:39:49 +0600
> 
> So, I was wrong. Maybe I missed something. It doesn't even get to
> messages that print return values of various functions. Buffer named
> ‘2008, Hard Candy’ was frozen during the experiment. Then I pressed ‘g’
> — this refreshed it. Then I went to desktop environment (XFCE4), located
> this folder and deleted a file — it was reflected in the buffer in a
> second. To be honest working in "emacs -Q" is really painful, because
> normally my Emacs is heavily customized… In principle if I'm the only
> one to experience this thing, I don't think debugging is worth the
> trouble. On the other hand my system setup is not that unique, so
> theoretically many users might experience this. At any rate, I'm ready
> to investigate it further, if you have some ideas.

Use this modified function in your customized Emacs and see what does
dired-buffer-stale-p return there, when you reproduce your problem.
Then let's take it from there -- if dired-buffer-stale-p returns nil,
the problem is inside that function, otherwise it's inside
auto-revert-handler.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03 12:10                 ` Eli Zaretskii
@ 2015-07-03 12:37                   ` Mark Karpov
  2015-07-03 13:02                   ` Mark Karpov
  1 sibling, 0 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-03 12:37 UTC (permalink / raw)
  To: Eli Zaretskii, 20943


When I manually evaluate ‘dired-buffer-stale-p’ (in «frozen» buffer) it
returns t, this function works OK. The problem is that control flow
doesn't reach second portion of messages when ‘auto-revert-handler’ is
called for Dired buffer in question. I think problem is here:

(when (or auto-revert-tail-mode (not (buffer-modified-p)))
  ...)

(or auto-revert-tail-mode (not (buffer-modified-p))) is obviously nil
when it shouldn't be nil. I don't know what ‘auto-revert-tail-mode’ is,
but its value is nil. So the problem lies in (buffer-modified-p). It's t
when it should be nil. I evaluated it for Dired buffer in question, it's
t, indeed. Is it correct behavior? What meaning does ‘buffer-modified-p’
have when current buffer is a Dired buffer? Should it ever be t in this
case?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03 12:10                 ` Eli Zaretskii
  2015-07-03 12:37                   ` Mark Karpov
@ 2015-07-03 13:02                   ` Mark Karpov
  2015-07-03 13:43                     ` Eli Zaretskii
  1 sibling, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-03 13:02 UTC (permalink / raw)
  To: Eli Zaretskii, 20943


Now I understand! What seemed to be random behavior is not that
random. Obviously, ‘buffer-modified-p’ returns t if user previously
modified directory, for example, if he deleted some files (I deleted
some files before invocations of my script). Thus, ‘auto-revert-handle’
thinks that buffer is modified that it doesn't revert it. Now, this is
good behavior for normal file buffers, but is it good enough for Dired
buffers too? If I edited a Dired buffer, want it to stay in sync
anyway. What do you think?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03 13:02                   ` Mark Karpov
@ 2015-07-03 13:43                     ` Eli Zaretskii
  2015-07-03 13:49                       ` Mark Karpov
  2015-07-03 16:08                       ` Mark Karpov
  0 siblings, 2 replies; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-03 13:43 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Fri, 03 Jul 2015 19:02:19 +0600
> 
> Now I understand! What seemed to be random behavior is not that
> random. Obviously, ‘buffer-modified-p’ returns t if user previously
> modified directory, for example, if he deleted some files (I deleted
> some files before invocations of my script).

Did you delete them from Dired, or did you delete them "by other
means"?

> Thus, ‘auto-revert-handle’ thinks that buffer is modified that it
> doesn't revert it. Now, this is good behavior for normal file
> buffers, but is it good enough for Dired buffers too? If I edited a
> Dired buffer, want it to stay in sync anyway. What do you think?

It seems we should disable that test for directories.  I suggest to
wait for a few days to let others come up with objections, and if none
do, make that change.

Meanwhile, I suggest that you make this change on your system, and see
if that has any adverse effects.

Thanks.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03 13:43                     ` Eli Zaretskii
@ 2015-07-03 13:49                       ` Mark Karpov
  2015-07-03 16:08                       ` Mark Karpov
  1 sibling, 0 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-03 13:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943


> Did you delete them from Dired, or did you delete them "by other
> means"?

Yes, I deleted it from Dired.
 
> It seems we should disable that test for directories.  I suggest to
> wait for a few days to let others come up with objections, and if none
> do, make that change.
> 
> Meanwhile, I suggest that you make this change on your system, and see
> if that has any adverse effects.
> 
> Thanks.

Great. That's what I'm going to do.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03 13:43                     ` Eli Zaretskii
  2015-07-03 13:49                       ` Mark Karpov
@ 2015-07-03 16:08                       ` Mark Karpov
  2015-07-04  8:31                         ` Eli Zaretskii
  2015-07-04  9:20                         ` Michael Albinus
  1 sibling, 2 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-03 16:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943


I want to report some ‘adverse effects’:

When I copy some files or create files, they are placed by Dired in
different positions than they would be placed normally (via ls call or
whatever Emacs uses internally). This is a separate problem, because of
this, I had to press ‘g’ in such cases, so every file gets in its proper
position. Now, however, autorevert does this for me. I know what is
happening, but for others this may look really confusing. Imagine, you
copied some files, and then they randomly jump in different positions
without your explicit command!

Not only confusing, but dangerous it may be, since some (really fast)
user may manage to delete wrong files (it's not difficult if your files
are moving!).

What I propose is to make sure that copied/created/added to current
directory by other means files are in the same positions as they would
be displayed by ls command (or whatever Emacs uses), so when user
presses ‘g’ order of files doesn't change.

This would be really good improvement. In simplest case, you can just
regenerate/revert buffer after commands that change contents of Dired
buffer adding new element into list of files.

If you decide to let ‘auto-revert-handler’ change edited directories
freely, you have to implement this change too. The both changes would be
quite useful.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03 16:08                       ` Mark Karpov
@ 2015-07-04  8:31                         ` Eli Zaretskii
  2015-07-04  8:49                           ` Mark Karpov
  2015-07-04  9:20                         ` Michael Albinus
  1 sibling, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-04  8:31 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

> From: Mark Karpov <markkarpov@openmailbox.org>
> Cc: 20943@debbugs.gnu.org
> Date: Fri, 03 Jul 2015 22:08:16 +0600
> 
> When I copy some files or create files, they are placed by Dired in
> different positions than they would be placed normally (via ls call or
> whatever Emacs uses internally).

Can you show a recipe for reproducing this?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-04  8:31                         ` Eli Zaretskii
@ 2015-07-04  8:49                           ` Mark Karpov
  0 siblings, 0 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-04  8:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943


> Can you show a recipe for reproducing this?

Sure.

1. emacs -Q

2. Evaluate the following:

(setq
 dired-dwim-target      t        ; guess target directory
 dired-listing-switches "-GAlh --group-directories-first")

3. Open two Dired buffers side-by-side.

4. Mark some files in the first buffer with ‘m’ key.

5. Press ‘C’ and confirm copying.

6. Files will be copied into another buffer. It's best if the buffer has
   some directories in it. My ‘dired-listing-switches’ tell ‘ls’ to list
   directories first. But chances are newly inserted files won't respect
   this. Thus we get situation that I've described in my previous
   message. For the sake of clarity press ‘g’ now and see how files are
   reordered. Moral here is that you generally cannot (I may be mistaken
   here, this is just my opinion) reliably guess true order of files
   without regeneration of Dired buffer. Well, I don't really know how
   it works in details, you could analyze ‘dired-listing-switches’ and
   try to emulate it, but is it worth the trouble?

I should note that concept of modified buffer is not really applicable
to Dired buffer, because it usually cannot contain anything that doesn't
exists in directory in your system. It's especially true if auto-revert
will work for modified buffers. Any time Dired buffer gets modified it
will be reverted by subsequent invocation of ‘auto-revert-handler’, thus
this state won't last longer than ‘auto-revert-interval’. I don't think
it's bad, but I think it's better to mention this consideration here.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-03 16:08                       ` Mark Karpov
  2015-07-04  8:31                         ` Eli Zaretskii
@ 2015-07-04  9:20                         ` Michael Albinus
  2015-07-04  9:32                           ` Eli Zaretskii
  2015-07-04 14:33                           ` Drew Adams
  1 sibling, 2 replies; 49+ messages in thread
From: Michael Albinus @ 2015-07-04  9:20 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

Mark Karpov <markkarpov@openmailbox.org> writes:

> When I copy some files or create files, they are placed by Dired in
> different positions than they would be placed normally (via ls call or
> whatever Emacs uses internally). This is a separate problem, because of
> this, I had to press ‘g’ in such cases, so every file gets in its proper
> position. 
>
> What I propose is to make sure that copied/created/added to current
> directory by other means files are in the same positions as they would
> be displayed by ls command (or whatever Emacs uses), so when user
> presses ‘g’ order of files doesn't change.

This is a feature of dired. It doesn't want to regenerate the whole
dired buffer; instead it adds the new entry at the position the cursor
is pointing to. This is because reverting the dired buffer could be
expensive. Think about a remote directory, think about many inserted
subdirectories.

Good or bad, if we want to change this behavour we would need a customer
option which would trigger the regeneration of the dired buffer
automatically.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-04  9:20                         ` Michael Albinus
@ 2015-07-04  9:32                           ` Eli Zaretskii
  2015-07-04 14:35                             ` Drew Adams
  2015-07-04 14:33                           ` Drew Adams
  1 sibling, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-04  9:32 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 20943, markkarpov

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: Eli Zaretskii <eliz@gnu.org>,  20943@debbugs.gnu.org
> Date: Sat, 04 Jul 2015 11:20:56 +0200
> 
> Mark Karpov <markkarpov@openmailbox.org> writes:
> 
> > When I copy some files or create files, they are placed by Dired in
> > different positions than they would be placed normally (via ls call or
> > whatever Emacs uses internally). This is a separate problem, because of
> > this, I had to press ‘g’ in such cases, so every file gets in its proper
> > position. 
> >
> > What I propose is to make sure that copied/created/added to current
> > directory by other means files are in the same positions as they would
> > be displayed by ls command (or whatever Emacs uses), so when user
> > presses ‘g’ order of files doesn't change.
> 
> This is a feature of dired. It doesn't want to regenerate the whole
> dired buffer; instead it adds the new entry at the position the cursor
> is pointing to. This is because reverting the dired buffer could be
> expensive. Think about a remote directory, think about many inserted
> subdirectories.

But then we should set some flag that this kind of change has been
done, and let autorevert test that flag and decide to revert the
buffer even though its modified flag is set.

> Good or bad, if we want to change this behavour we would need a customer
> option which would trigger the regeneration of the dired buffer
> automatically.

I think if the user invoked auto-revert-mode in the Dired buffer, she
already communicated that intent to us, no?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-04  9:20                         ` Michael Albinus
  2015-07-04  9:32                           ` Eli Zaretskii
@ 2015-07-04 14:33                           ` Drew Adams
  1 sibling, 0 replies; 49+ messages in thread
From: Drew Adams @ 2015-07-04 14:33 UTC (permalink / raw)
  To: Michael Albinus, Mark Karpov; +Cc: 20943

> This is a feature of dired. It doesn't want to regenerate the whole
> dired buffer; instead it adds the new entry at the position the
> cursor is pointing to. This is because reverting the dired buffer
> could be expensive. Think about a remote directory, think about many
> inserted subdirectories.

Dunno whether performance was the only reason for doing this, but
another benefit I see to the current behavior is that, because the
change is shown next to point, *you see it*, even if `g' reordering
might place it far way or even off-screen.  It is important that
users have feedback about changs.  And when the changed/new file
is somehow derived from the file at point (e.g., it is a copy),
seeing the two right next to each other means you can immediately
compare the names etc. 

This keep-it-right-here-for-now behavior is quite important, (to me
at least). When I copy a file to the same directory, for instance,
and give the copy a name with a prefix (e.g. 2015-07-04) that might
make it sort far away, I can nevertheless see it right there.

This is about the same reason that we highlight new files (e.g.,
copies) specially, so you notice them easily.

This gives users control over when to re-sort (using, e.g., `g').
We should not assume that re-sorting automatically is what a user
wants.

If we were to change this, I would very much like the changed
behavior to be only an option, and not the default behavior.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverterd
  2015-07-04  9:32                           ` Eli Zaretskii
@ 2015-07-04 14:35                             ` Drew Adams
  0 siblings, 0 replies; 49+ messages in thread
From: Drew Adams @ 2015-07-04 14:35 UTC (permalink / raw)
  To: Eli Zaretskii, Michael Albinus; +Cc: 20943, markkarpov

> I think if the user invoked auto-revert-mode in the Dired buffer,
> she already communicated that intent to us, no?

My bad in my previous reply.  I did not notice that this is about
auto-reversion.  (I don't use that.)  I thought the request was to,
in effect, auto-revert on each change (without `auto-revert-mode').





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-06-30 18:19 bug#20943: 25.0.50; Dired buffers are not always auto-reverterd Mark Karpov
                   ` (2 preceding siblings ...)
  2015-07-02 10:49 ` Mark Karpov
@ 2015-07-09 13:24 ` Mark Karpov
  2015-07-09 14:47   ` Eli Zaretskii
  3 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-09 13:24 UTC (permalink / raw)
  To: 20943


Any update/decision on this issue? I'm using this for almost a week now
and it feels all right. Dired now is much more interactive, the problem
of staled buffers is gone.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 13:24 ` bug#20943: 25.0.50; Dired buffers are not always auto-reverted Mark Karpov
@ 2015-07-09 14:47   ` Eli Zaretskii
  2015-07-09 15:30     ` Mark Karpov
  2015-07-09 15:40     ` Mark Karpov
  0 siblings, 2 replies; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-09 14:47 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

> From: Mark Karpov <markkarpov@openmailbox.org>
> Date: Thu, 09 Jul 2015 19:24:42 +0600
> 
> 
> Any update/decision on this issue? I'm using this for almost a week now
> and it feels all right. Dired now is much more interactive, the problem
> of staled buffers is gone.

We need to come up with a way of telling auto-revert that although the
buffer was modified by the commands you mentioned, it's okay to revert
it.  Can you suggest a change along those lines?





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 14:47   ` Eli Zaretskii
@ 2015-07-09 15:30     ` Mark Karpov
  2015-07-09 18:41       ` Michael Albinus
  2015-07-09 15:40     ` Mark Karpov
  1 sibling, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-09 15:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943


> We need to come up with a way of telling auto-revert that although the
> buffer was modified by the commands you mentioned, it's okay to revert
> it.  Can you suggest a change along those lines?

I propose two changes:

1. In ‘auto-revert-handler’, autorevert modified files if current buffer
is a Dired buffer:

(defun auto-revert-handler ()
  "Revert current buffer, if appropriate.
This is an internal function used by Auto-Revert Mode."
  (when (or auto-revert-tail-mode
            (eq major-mode dired-mode)
            (not (buffer-modified-p)))
    ...))

This removes «freezing» of modified buffers (‘auto-revert-buffer’ is
only called when auto-revert mode is enabled right? this should not
affect users who don't use auto-revert). This is what I currently
use. Control flow goes into body of ‘when’ and for Dired buffers this
boils down to conditions that check if current buffer is stale, and if
it is, then the function revert it.

2. To eliminate adverse effects (reordering of files because of
auto-revert mode), we need to write down all functions (commands) that
can insert new elements out of order in Dired buffer, then at the end of
every such a command, add:

(when auto-revert-mode
  (revert-buffer nil t t)) ;; not sure about the collection of args

This should be done only for Dired-specific commands (that are used only
in Dired mode, if there is uncertainty, add additional condition to test
that current major mode is ‘dired-mode’), of course.

In principle, a macro can be written for this set of functions, but I
don't think it's a good idea for Elisp, given such limited use case.

The only thing I cannot do myself from this is form full list of
functions that should call ‘revert-buffer’ when ‘auto-revert-mode’ is
enabled. You should be able to do it better than me.

These functions should contain reverting code in themselves because
‘auto-revert-handler’ cannot help here — its period is too long.

Maybe I don't see some corner cases? If you disagree with this plan,
let's discuss it.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 14:47   ` Eli Zaretskii
  2015-07-09 15:30     ` Mark Karpov
@ 2015-07-09 15:40     ` Mark Karpov
  1 sibling, 0 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-09 15:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943


No, at the end of inserting function should be the following:

(when auto-revert-mode
  (auto-revert-handler))

That's it. This will also check if user wants to autorevert non-file
buffers (according to ‘global-auto-revert-non-file-buffers’) and all the
stuff. Since such functions edit directory, buffer will be recognized as
stale and this will revert it. This is simple, even elegant, I
think. This is how I would do it.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 15:30     ` Mark Karpov
@ 2015-07-09 18:41       ` Michael Albinus
  2015-07-09 19:42         ` Mark Karpov
  2015-07-09 19:50         ` Mark Karpov
  0 siblings, 2 replies; 49+ messages in thread
From: Michael Albinus @ 2015-07-09 18:41 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

Mark Karpov <markkarpov@openmailbox.org> writes:

> 1. In ‘auto-revert-handler’, autorevert modified files if current buffer
> is a Dired buffer:
>
> (defun auto-revert-handler ()
>   "Revert current buffer, if appropriate.
> This is an internal function used by Auto-Revert Mode."
>   (when (or auto-revert-tail-mode
>             (eq major-mode dired-mode)
>             (not (buffer-modified-p)))
>     ...))

I fear this is the wrong direction to fix it. `auto-revert-handler' shall
not know about major modes. All what a buffer has to say to
`auto-revert-handler' must be in `buffer-stale-function', which is set to
`dired-buffer-stale-p' here.

What happens, if you remove the test for `buffer-read-only' from that
function?

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 18:41       ` Michael Albinus
@ 2015-07-09 19:42         ` Mark Karpov
  2015-07-10  5:46           ` Eli Zaretskii
  2015-07-09 19:50         ` Mark Karpov
  1 sibling, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-09 19:42 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 20943


Michael Albinus <michael.albinus@gmx.de> writes:

> I fear this is the wrong direction to fix it. `auto-revert-handler' shall
> not know about major modes. All what a buffer has to say to
> `auto-revert-handler' must be in `buffer-stale-function', which is set to
> `dired-buffer-stale-p' here.

I can understand the desire for abstraction. The thing is that as
currently written ‘auto-revert-handler’ won't get to that part where it
calls ‘buffer-stale-function’. The ‘when’ statement cut it too early
with (not (buffer-modified-p)).

What we actually need to decide is whether this behavior will be unique
to Dired or not. I feel like it's quite unique. Dired buffer is not like
normal file buffer or anything else. So, in some way we have to check in
‘auto-revert-handler’ if we are in Dired buffer or not.

Frankly, you have three concepts that control behavior of
‘auto-revert-mode’:

* buffer associated with file (this may be used as «fourth notion»,
  although I don't know which buffers else are not associated with
  files, chances are the new behavior is not very good for anything
  other than Dired),

* modified buffer,

* stale buffer.

This is not enough to implement this new behavior, you need more
information about buffer now. So, you need fourth notion that would tell
you if current buffer is such that you can revert it even if it's
modified.

Now, if you like to keep it on more abstract level, you can introduce
some notion for this sort of buffers, buffers that should be reverted by
‘auto-revert-mode’ even when they are modified.

You can introduce a list that will enumerate major modes that define
such buffers, or implement it in some other way. Then you can have a
predicate that will tell you what if you're in such a special buffer or
not.

> What happens, if you remove the test for `buffer-read-only' from that
> function?

Sorry, I don't know which function you mean. Please be explicit, because
my knowledge of internal workings of Emacs is somewhat limited and thus
I'm bad at guessing. If you mean ‘auto-revert-handler’, it doesn't
matter, because you need to insert new condition here:

(when (or auto-revert-tail-mode
          <insert predicate here>
          (not (buffer-modified-p)))
 ...)

This is my point of view, I don't know if it's helpful.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 18:41       ` Michael Albinus
  2015-07-09 19:42         ` Mark Karpov
@ 2015-07-09 19:50         ` Mark Karpov
  2015-07-10  5:43           ` Eli Zaretskii
  1 sibling, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-09 19:50 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 20943


Currently I'm happy with my version of ‘auto-revert-buffer’. If you
think it gets too hairy. I can just create a package that fixes all this
stuff, so Dired can be really interactive and put it on MELPA for
example.

But as a user, I'm telling you that current standard behavior is really
confusing. If you set something to auto-revert your Dired buffer (and
this is something many people expect from utility to browse
directories), than when it works sometimes, but cease to work when you
made changes (probably having no idea that the buffer now considered
«modified») — this ain't good.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 19:50         ` Mark Karpov
@ 2015-07-10  5:43           ` Eli Zaretskii
  2015-07-10  6:20             ` Mark Karpov
  0 siblings, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-10  5:43 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943, michael.albinus

> From: Mark Karpov <markkarpov@openmailbox.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  20943@debbugs.gnu.org
> Date: Fri, 10 Jul 2015 01:50:48 +0600
> 
> 
> Currently I'm happy with my version of ‘auto-revert-buffer’. If you
> think it gets too hairy. I can just create a package that fixes all this
> stuff, so Dired can be really interactive and put it on MELPA for
> example.
> 
> But as a user, I'm telling you that current standard behavior is really
> confusing. If you set something to auto-revert your Dired buffer (and
> this is something many people expect from utility to browse
> directories), than when it works sometimes, but cease to work when you
> made changes (probably having no idea that the buffer now considered
> «modified») — this ain't good.

No one's disputing that.  The only issue we need to resolve is how to
let Dired buffers auto-revert even when the user actually edits the
directory, without causing unnecessary re-reads of the directory (for
the sake of remote directories).





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-09 19:42         ` Mark Karpov
@ 2015-07-10  5:46           ` Eli Zaretskii
  2015-07-10  6:01             ` Michael Albinus
  0 siblings, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-10  5:46 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943, michael.albinus

> From: Mark Karpov <markkarpov@openmailbox.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  20943@debbugs.gnu.org
> Date: Fri, 10 Jul 2015 01:42:38 +0600
> 
> Frankly, you have three concepts that control behavior of
> ‘auto-revert-mode’:
> 
> * buffer associated with file (this may be used as «fourth notion»,
>   although I don't know which buffers else are not associated with
>   files, chances are the new behavior is not very good for anything
>   other than Dired),
> 
> * modified buffer,
> 
> * stale buffer.
> 
> This is not enough to implement this new behavior, you need more
> information about buffer now. So, you need fourth notion that would tell
> you if current buffer is such that you can revert it even if it's
> modified.
> 
> Now, if you like to keep it on more abstract level, you can introduce
> some notion for this sort of buffers, buffers that should be reverted by
> ‘auto-revert-mode’ even when they are modified.
> 
> You can introduce a list that will enumerate major modes that define
> such buffers, or implement it in some other way. Then you can have a
> predicate that will tell you what if you're in such a special buffer or
> not.

How about instead introducing a buffer-local variable, say
auto-revert-when-modified, which Dired will set to a non-nil value,
and auto-revert will test?  Then, when this variable is non-nil,
auto-revert could disregard the modified status, and revert the
buffer, if stale, anyway.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  5:46           ` Eli Zaretskii
@ 2015-07-10  6:01             ` Michael Albinus
  2015-07-10  7:10               ` Eli Zaretskii
  2015-07-14 16:28               ` Michael Albinus
  0 siblings, 2 replies; 49+ messages in thread
From: Michael Albinus @ 2015-07-10  6:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943, Mark Karpov

Eli Zaretskii <eliz@gnu.org> writes:

> How about instead introducing a buffer-local variable, say
> auto-revert-when-modified, which Dired will set to a non-nil value,
> and auto-revert will test?  Then, when this variable is non-nil,
> auto-revert could disregard the modified status, and revert the
> buffer, if stale, anyway.

I believe we could use the existing <foo>-stale-p mechanism for that
purpose. dired-stale-p shall decide to return a proper value, even if
the dired buffer is modified. It will follow the same logic as you have
proposed above. And we could implement different logic, depending
whether default-directory is a remote file name.

auto-revert-handler shall not cease to work unconditionally, when
buffer-modified-p is non-nil. This check shall be done only for buffers
with a related file (buffer-file-name is non-nil). For all other
buffers, <foo>-stale-p shall decide, whether buffer-modified-p must be
taken into account.

Thinking about, we might even extract a new function
auto-revert-buffer-with-file-stale-p from auto-revert-handler. This
would handle the case for buffers with a non-nil buffer-file-name.
auto-revert-handler would call always the buffer-local <foo>-stale-p
function; the code would be cleaner.

I will try to write such a patch if nobody beats me. Unfortunately, it
will take time; I'm still suffering from my health problems.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  5:43           ` Eli Zaretskii
@ 2015-07-10  6:20             ` Mark Karpov
  2015-07-10  7:13               ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-10  6:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943, michael.albinus


Eli Zaretskii <eliz@gnu.org> writes:

> No one's disputing that.  The only issue we need to resolve is how to
> let Dired buffers auto-revert even when the user actually edits the
> directory, without causing unnecessary re-reads of the directory (for
> the sake of remote directories).

Those who need to work with remote directories could disable this
feature (‘auto-revert-mode’ or ‘global-auto-revert-non-file-buffers’).

This feature certainly requires more re-reads by definition.

There will be no “unnecessary” re-reads, however:

* ‘auto-revert-handler’ will re-read directory only if it's stale;

* other editing functions will call ‘auto-revert-handler’ sooner than it
  would be normally called, but number of re-reads remains the same
  (after call of ‘auto-revert-handler’ buffer will be no longer stale).





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  6:01             ` Michael Albinus
@ 2015-07-10  7:10               ` Eli Zaretskii
  2015-07-10  8:46                 ` Michael Albinus
  2015-07-14 16:28               ` Michael Albinus
  1 sibling, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-10  7:10 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 20943, markkarpov

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: Mark Karpov <markkarpov@openmailbox.org>,  20943@debbugs.gnu.org
> Date: Fri, 10 Jul 2015 08:01:48 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > How about instead introducing a buffer-local variable, say
> > auto-revert-when-modified, which Dired will set to a non-nil value,
> > and auto-revert will test?  Then, when this variable is non-nil,
> > auto-revert could disregard the modified status, and revert the
> > buffer, if stale, anyway.
> 
> I believe we could use the existing <foo>-stale-p mechanism for that
> purpose. dired-stale-p shall decide to return a proper value, even if
> the dired buffer is modified.

What Mark was trying to tell you is that dired-stale-p is not even
called when buffer-modified-p returns non-nil.  So what you suggest is
impossible without a thorough rewrite of the beginning of
auto-revert-handler.

My suggestion was intended to allow much less invasive changes in that
complicated logic.

> It will follow the same logic as you have proposed above. And we
> could implement different logic, depending whether default-directory
> is a remote file name.

Why is such a different logic a good idea?  If the user requests
auto-reverts in a remote directory, she should get what she asked for,
IMO.  It would be confusing to have different results depending on
whether the directory is local or not.

> auto-revert-handler shall not cease to work unconditionally, when
> buffer-modified-p is non-nil. This check shall be done only for buffers
> with a related file (buffer-file-name is non-nil). For all other
> buffers, <foo>-stale-p shall decide, whether buffer-modified-p must be
> taken into account.

Again, you are talking about inverting the current logic.  If you are
certain this won't produce unintended consequences, by all means go
ahead.  But I still don't understand why your suggestion is better
than mine.  You didn't point out any downsides in my suggestion.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  6:20             ` Mark Karpov
@ 2015-07-10  7:13               ` Eli Zaretskii
  2015-07-10  7:46                 ` Mark Karpov
  0 siblings, 1 reply; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-10  7:13 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943, michael.albinus

> From: Mark Karpov <markkarpov@openmailbox.org>
> Cc: michael.albinus@gmx.de, 20943@debbugs.gnu.org
> Date: Fri, 10 Jul 2015 12:20:47 +0600
> 
> This feature certainly requires more re-reads by definition.

Which is why I used "unnecessary".

> There will be no “unnecessary” re-reads, however:

Yes, there could be: the ideal solution of the conundrum with using
Copy, Delete, and Rename commands in the Dired buffer would be to
re-read the directory, instead of leaving the modified files near
point.  But the price is the need to re-read remote directories, and
we want to avoid that price, if possible.

That is what I alluded to, nothing else.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  7:13               ` Eli Zaretskii
@ 2015-07-10  7:46                 ` Mark Karpov
  2015-07-10  8:03                   ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-10  7:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943, michael.albinus


You're saying:

> Why is such a different logic a good idea?  If the user requests
> auto-reverts in a remote directory, she should get what she asked for,
> IMO.  It would be confusing to have different results depending on
> whether the directory is local or not.

From this I understand that you are in favor of “dynamic”
auto-revert-mode for remote directories. This makes sense, if user
chooses to auto-revert Dired buffers, ‘she should get what she asked
for’ — that's right.

> But the price is the need to re-read remote directories, and we want
> to avoid that price, if possible.

But this is not possible. This contradicts with the previous
quotation. Let it be re-read. User can disable it anyway. If revertion
of buffers is slow, chances are user won't even enable it if he works
with remote directories. If it's slow/better to be avoided, don't use
it, use good ol' Dired without auto-revert magic. If you're expecting
Dired buffers to be “dynamic”, this is your choice — you will have to
re-read directories more often. It's as simple as that (at least for
me).





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  7:46                 ` Mark Karpov
@ 2015-07-10  8:03                   ` Eli Zaretskii
  0 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2015-07-10  8:03 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943, michael.albinus

> From: Mark Karpov <markkarpov@openmailbox.org>
> Cc: michael.albinus@gmx.de, 20943@debbugs.gnu.org
> Date: Fri, 10 Jul 2015 13:46:43 +0600
> 
> 
> You're saying:
> 
> > Why is such a different logic a good idea?  If the user requests
> > auto-reverts in a remote directory, she should get what she asked for,
> > IMO.  It would be confusing to have different results depending on
> > whether the directory is local or not.
> 
> >From this I understand that you are in favor of “dynamic”
> auto-revert-mode for remote directories. This makes sense, if user
> chooses to auto-revert Dired buffers, ‘she should get what she asked
> for’ — that's right.
> 
> > But the price is the need to re-read remote directories, and we want
> > to avoid that price, if possible.
> 
> But this is not possible. This contradicts with the previous
> quotation.

Only because you take my quotation out of its context.  What we want
to avoid is the price of re-reading the directory when the user copies
or deletes or renames a file via Dired commands, _as-an_immediate_result_
of these commands.  We cannot possibly avoid re-reading it when the
time comes to check if the buffer is stale and needs to be reverted.

IOW, the directory _will_ be re-read, but only when the notification
about some changes comes in or the 5-sec timer for checking whether
the directory is stale expires.  it will _not_ be re-read as result of
your copying or deleting a file.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  7:10               ` Eli Zaretskii
@ 2015-07-10  8:46                 ` Michael Albinus
  2015-07-16 18:12                   ` Michael Albinus
  0 siblings, 1 reply; 49+ messages in thread
From: Michael Albinus @ 2015-07-10  8:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943, markkarpov

Eli Zaretskii <eliz@gnu.org> writes:

>> > How about instead introducing a buffer-local variable, say
>> > auto-revert-when-modified, which Dired will set to a non-nil value,
>> > and auto-revert will test?  Then, when this variable is non-nil,
>> > auto-revert could disregard the modified status, and revert the
>> > buffer, if stale, anyway.
>> 
>> I believe we could use the existing <foo>-stale-p mechanism for that
>> purpose. dired-stale-p shall decide to return a proper value, even if
>> the dired buffer is modified.
>
> What Mark was trying to tell you is that dired-stale-p is not even
> called when buffer-modified-p returns non-nil.  So what you suggest is
> impossible without a thorough rewrite of the beginning of
> auto-revert-handler.

That's why I have proposed to remove the buffer-modified-p check from
auto-revert-handler. It shall be checked in <foo>-stale-p, if desired.

>> It will follow the same logic as you have proposed above. And we
>> could implement different logic, depending whether default-directory
>> is a remote file name.
>
> Why is such a different logic a good idea?  If the user requests
> auto-reverts in a remote directory, she should get what she asked for,
> IMO.  It would be confusing to have different results depending on
> whether the directory is local or not.

I haven't said that we must do this. But it would be possible.

>> auto-revert-handler shall not cease to work unconditionally, when
>> buffer-modified-p is non-nil. This check shall be done only for buffers
>> with a related file (buffer-file-name is non-nil). For all other
>> buffers, <foo>-stale-p shall decide, whether buffer-modified-p must be
>> taken into account.
>
> Again, you are talking about inverting the current logic.  If you are
> certain this won't produce unintended consequences, by all means go
> ahead.  But I still don't understand why your suggestion is better
> than mine.  You didn't point out any downsides in my suggestion.

Avoiding spaghetti code. The existing interface with <foo>-stale-p is
sufficient, I believe. Adding an additional interface (setting
buffer-local auto-revert-when-modified) would introduce another
interface, maybe in concurrency to <foo>-stale-p.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  6:01             ` Michael Albinus
  2015-07-10  7:10               ` Eli Zaretskii
@ 2015-07-14 16:28               ` Michael Albinus
  1 sibling, 0 replies; 49+ messages in thread
From: Michael Albinus @ 2015-07-14 16:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943, Mark Karpov

Michael Albinus <michael.albinus@gmx.de> writes:

> I will try to write such a patch if nobody beats me. Unfortunately, it
> will take time; I'm still suffering from my health problems.

As a first step, I have committed a new file for ert tests
test/automated/auto-revert-tests.el. Dired buffers are not reverted yet
when they are modified, see auto-revert-test02-auto-revert-mode-dired.

This shall be changed in the next step.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-10  8:46                 ` Michael Albinus
@ 2015-07-16 18:12                   ` Michael Albinus
  2015-07-17 20:40                     ` Mark Karpov
  0 siblings, 1 reply; 49+ messages in thread
From: Michael Albinus @ 2015-07-16 18:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20943, markkarpov

Michael Albinus <michael.albinus@gmx.de> writes:

>> What Mark was trying to tell you is that dired-stale-p is not even
>> called when buffer-modified-p returns non-nil.  So what you suggest is
>> impossible without a thorough rewrite of the beginning of
>> auto-revert-handler.
>
> That's why I have proposed to remove the buffer-modified-p check from
> auto-revert-handler. It shall be checked in <foo>-stale-p, if desired.

I've committed a patch to the trunk which implements
it. auto-revert-tests.el seems to be happy with this (no surprise, it's
written by me :-)

Mark, could you check whether this is sufficient for you? There is still
a check in dired-buffer-stale-p:

	 ;; Do not auto-revert when the dired buffer can be currently
	 ;; written by the user as in `wdired-mode'.
	 buffer-read-only

Don't know whether it affects your use case.

And likely, doc/emacs/arevert-xtra.texi must be adapted too, haven't done
this yet. I'm waiting, whether the fix flies.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-16 18:12                   ` Michael Albinus
@ 2015-07-17 20:40                     ` Mark Karpov
  2015-07-18 10:37                       ` Michael Albinus
  0 siblings, 1 reply; 49+ messages in thread
From: Mark Karpov @ 2015-07-17 20:40 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 20943

Michael Albinus <michael.albinus@gmx.de> writes:

> Mark, could you check whether this is sufficient for you?

This works. Please note that files still “jump” when you copy files from
one Dired buffer into another. They are initially inserted at cursor
position, and then next invocation of ‘auto-revert-handler’ reverts the
buffer and files get reordered. I guess it's undesirable (although I
like current behavior more than the original one, jumping files are OK
compared with the frozen ones :-D).





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-17 20:40                     ` Mark Karpov
@ 2015-07-18 10:37                       ` Michael Albinus
  2015-07-18 18:20                         ` Mark Karpov
  0 siblings, 1 reply; 49+ messages in thread
From: Michael Albinus @ 2015-07-18 10:37 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 20943

Mark Karpov <markkarpov@openmailbox.org> writes:

> This works. Please note that files still “jump” when you copy files from
> one Dired buffer into another. They are initially inserted at cursor
> position, and then next invocation of ‘auto-revert-handler’ reverts the
> buffer and files get reordered. I guess it's undesirable (although I
> like current behavior more than the original one, jumping files are OK
> compared with the frozen ones :-D).

Well, I don't want to touch dired sources; I'm not familiar with
them. If you agree, I would close this bug.

The sort problem of (auto-)reverted dired buffers might be handled in
another bug report, if it is important enough for you.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 49+ messages in thread

* bug#20943: 25.0.50; Dired buffers are not always auto-reverted
  2015-07-18 10:37                       ` Michael Albinus
@ 2015-07-18 18:20                         ` Mark Karpov
  0 siblings, 0 replies; 49+ messages in thread
From: Mark Karpov @ 2015-07-18 18:20 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 20943-done


Michael Albinus <michael.albinus@gmx.de> writes:

> Well, I don't want to touch dired sources; I'm not familiar with
> them. If you agree, I would close this bug.

Now I'm beginning to like this “feature”. This is like animation: it
shows you inserted files and then automatically reorders them. Now I
consider a it feature, not a bug. So, personally I won't open bug report
for this.

Thanks for your work, Michael.

I'm closing this (‘20943-done’ prefix should work… let's see).





^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2015-07-18 18:20 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30 18:19 bug#20943: 25.0.50; Dired buffers are not always auto-reverterd Mark Karpov
2015-06-30 19:58 ` Eli Zaretskii
2015-07-01  5:58   ` Michael Albinus
2015-07-01  7:15     ` Mark Karpov
2015-07-01  8:55       ` Michael Albinus
2015-07-01  9:09         ` Mark Karpov
2015-07-01 15:38           ` Eli Zaretskii
2015-07-01 15:25       ` Eli Zaretskii
     [not found]   ` <87y4j0fj8m.fsf@openmailbox.org>
2015-07-01 15:24     ` Eli Zaretskii
2015-07-02  8:02       ` Mark Karpov
2015-07-02 14:52         ` Eli Zaretskii
2015-07-03  7:33           ` Mark Karpov
2015-07-03  8:18             ` Eli Zaretskii
2015-07-03  9:39               ` Mark Karpov
2015-07-03 12:10                 ` Eli Zaretskii
2015-07-03 12:37                   ` Mark Karpov
2015-07-03 13:02                   ` Mark Karpov
2015-07-03 13:43                     ` Eli Zaretskii
2015-07-03 13:49                       ` Mark Karpov
2015-07-03 16:08                       ` Mark Karpov
2015-07-04  8:31                         ` Eli Zaretskii
2015-07-04  8:49                           ` Mark Karpov
2015-07-04  9:20                         ` Michael Albinus
2015-07-04  9:32                           ` Eli Zaretskii
2015-07-04 14:35                             ` Drew Adams
2015-07-04 14:33                           ` Drew Adams
2015-07-01  7:23 ` Mark Karpov
2015-07-02 10:49 ` Mark Karpov
2015-07-09 13:24 ` bug#20943: 25.0.50; Dired buffers are not always auto-reverted Mark Karpov
2015-07-09 14:47   ` Eli Zaretskii
2015-07-09 15:30     ` Mark Karpov
2015-07-09 18:41       ` Michael Albinus
2015-07-09 19:42         ` Mark Karpov
2015-07-10  5:46           ` Eli Zaretskii
2015-07-10  6:01             ` Michael Albinus
2015-07-10  7:10               ` Eli Zaretskii
2015-07-10  8:46                 ` Michael Albinus
2015-07-16 18:12                   ` Michael Albinus
2015-07-17 20:40                     ` Mark Karpov
2015-07-18 10:37                       ` Michael Albinus
2015-07-18 18:20                         ` Mark Karpov
2015-07-14 16:28               ` Michael Albinus
2015-07-09 19:50         ` Mark Karpov
2015-07-10  5:43           ` Eli Zaretskii
2015-07-10  6:20             ` Mark Karpov
2015-07-10  7:13               ` Eli Zaretskii
2015-07-10  7:46                 ` Mark Karpov
2015-07-10  8:03                   ` Eli Zaretskii
2015-07-09 15:40     ` Mark Karpov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).