From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#20943: 25.0.50; Dired buffers are not always auto-reverted Date: Fri, 10 Jul 2015 10:46:50 +0200 Message-ID: <87pp40z9fp.fsf@gmx.de> 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> <83lheobi8x.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436518109 22301 80.91.229.3 (10 Jul 2015 08:48:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2015 08:48:29 +0000 (UTC) Cc: 20943@debbugs.gnu.org, markkarpov@openmailbox.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 10 10:48:18 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 1ZDTyg-0002Ii-2r for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jul 2015 10:48:14 +0200 Original-Received: from localhost ([::1]:43662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTyf-0008SL-8x for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jul 2015 04:48:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTyY-0008SC-6v for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 04:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDTyU-0007zv-81 for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 04:48:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTyU-0007zp-4A for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 04:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZDTyT-0005g6-SE for bug-gnu-emacs@gnu.org; Fri, 10 Jul 2015 04:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jul 2015 08:48:01 +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.143651802121731 (code B ref 20943); Fri, 10 Jul 2015 08:48:01 +0000 Original-Received: (at 20943) by debbugs.gnu.org; 10 Jul 2015 08:47:01 +0000 Original-Received: from localhost ([127.0.0.1]:45912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDTxU-0005eK-U9 for submit@debbugs.gnu.org; Fri, 10 Jul 2015 04:47:01 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:62205) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDTxS-0005e5-7z for 20943@debbugs.gnu.org; Fri, 10 Jul 2015 04:46:59 -0400 Original-Received: from detlef.gmx.de ([93.209.80.73]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MZlEg-1ZRImL1DLC-00LWOq; Fri, 10 Jul 2015 10:46:51 +0200 In-Reply-To: <83lheobi8x.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Jul 2015 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fwHaU= 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:104882 Archived-At: 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. That's why I have proposed to remove the buffer-modified-p check from auto-revert-handler. It shall be checked in -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, -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 -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 -stale-p. Best regards, Michael.