From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20943: 25.0.50; Dired buffers are not always auto-reverted Date: Fri, 10 Jul 2015 10:10:22 +0300 Message-ID: <83lheobi8x.fsf@gnu.org> References: <87y4j1oy87.fsf@openmailbox.org> <87pp41cvl1.fsf@openmailbox.org> <83615tv14o.fsf@gnu.org> <874mldtkl9.fsf@openmailbox.org> <874mld18cx.fsf@gmx.de> <87io9t3yoh.fsf@openmailbox.org> <83r3ogbm4s.fsf@gnu.org> <87vbdszh2r.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1436512283 23716 80.91.229.3 (10 Jul 2015 07:11:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2015 07:11:23 +0000 (UTC) Cc: 20943@debbugs.gnu.org, markkarpov@openmailbox.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 10 09:11:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZDSSl-0004HI-Ow for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jul 2015 09:11:11 +0200 Original-Received: from localhost ([::1]:43337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDSSk-0003EL-VJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jul 2015 03:11:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDSSg-0003EF-UJ for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 03:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDSSc-00015U-S0 for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 03:11:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDSSc-00015M-OM for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 03:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZDSSc-0003B0-4l for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 03:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jul 2015 07:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20943 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20943-submit@debbugs.gnu.org id=B20943.143651223512164 (code B ref 20943); Fri, 10 Jul 2015 07:11:02 +0000 Original-Received: (at 20943) by debbugs.gnu.org; 10 Jul 2015 07:10:35 +0000 Original-Received: from localhost ([127.0.0.1]:45878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDSS9-0003A6-QM for submit@debbugs.gnu.org; Fri, 10 Jul 2015 03:10:34 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:56089) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDSS6-00039n-QQ for 20943@debbugs.gnu.org; Fri, 10 Jul 2015 03:10:32 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NR900N00FA8X000@mtaout24.012.net.il> for 20943@debbugs.gnu.org; Fri, 10 Jul 2015 10:01:53 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NR900HCXFJ5QU70@mtaout24.012.net.il>; Fri, 10 Jul 2015 10:01:53 +0300 (IDT) In-reply-to: <87vbdszh2r.fsf@gmx.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104877 Archived-At: > From: Michael Albinus > Cc: Mark Karpov , 20943@debbugs.gnu.org > Date: Fri, 10 Jul 2015 08:01:48 +0200 > > Eli Zaretskii 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 -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, -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.