From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Karpov Newsgroups: gmane.emacs.bugs Subject: bug#20943: 25.0.50; Dired buffers are not always auto-reverted Date: Fri, 10 Jul 2015 01:42:38 +0600 Message-ID: <87io9t3yoh.fsf@openmailbox.org> References: <87y4j1oy87.fsf@openmailbox.org> <87pp41cvl1.fsf@openmailbox.org> <83615tv14o.fsf@gnu.org> <874mldtkl9.fsf@openmailbox.org> <874mld18cx.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1436471248 2599 80.91.229.3 (9 Jul 2015 19:47:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2015 19:47:28 +0000 (UTC) Cc: 20943@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 09 21:47:14 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 1ZDHmp-0001Ui-HM for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Jul 2015 21:47:11 +0200 Original-Received: from localhost ([::1]:41560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDHmo-0000Oy-QU for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Jul 2015 15:47:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDHml-0000Ol-HI for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 15:47:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDHmg-0001Ac-9v for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 15:47:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDHmg-0001AY-6C for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 15:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZDHmf-0003Vi-Lg for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 15:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Karpov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Jul 2015 19:47: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.143647118313434 (code B ref 20943); Thu, 09 Jul 2015 19:47:01 +0000 Original-Received: (at 20943) by debbugs.gnu.org; 9 Jul 2015 19:46:23 +0000 Original-Received: from localhost ([127.0.0.1]:45503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDHm2-0003UZ-9E for submit@debbugs.gnu.org; Thu, 09 Jul 2015 15:46:22 -0400 Original-Received: from smtp26.openmailbox.org ([62.4.1.60]:59861) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDHlz-0003UQ-Jo for 20943@debbugs.gnu.org; Thu, 09 Jul 2015 15:46:20 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.openmailbox.org (Postfix) with ESMTP id 449802E007D; Thu, 9 Jul 2015 21:46:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openmailbox.org; h=content-transfer-encoding:content-type:content-type :mime-version:user-agent:message-id:in-reply-to:date:date :references:subject:subject:from:from:received; s=openmailbox; t=1436471176; bh=xZQHaID6IQIV62p/hnbH2FLneREGu9EK7uRlyRsfLWc=; b= RRqsXj4ktZQtr435mWaL55kJROICoW1Ak/SLxx+wTQnqElB6Yu1hrhQ1JB5JCzf0 V0nOyPSwoMu+eTcLGU/plENZYq3AHFkDbJEwgF2fLnoAOBWvPLFmtL8Jfhc/de1r 4oFP8rqKR6aUEgDss1ed3tx5suJeX3AyaeAWjm5dqNg= X-Virus-Scanned: amavisd-new at openmailbox.org Original-Received: from mail.openmailbox.org ([62.4.1.34]) by localhost (mail.openmailbox.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Sf2XkHcnLddO; Thu, 9 Jul 2015 21:46:16 +0200 (CEST) In-Reply-To: <874mld18cx.fsf@gmx.de> (Michael Albinus's message of "Thu, 09 Jul 2015 20:41:50 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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:104863 Archived-At: Michael Albinus 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 =E2=80=98auto-revert-handler=E2=80=99 won't get to that p= art where it calls =E2=80=98buffer-stale-function=E2=80=99. The =E2=80=98when=E2=80=99 s= tatement 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 =E2=80=98auto-revert-handler=E2=80=99 if we are in Dired buffer or not. Frankly, you have three concepts that control behavior of =E2=80=98auto-revert-mode=E2=80=99: * buffer associated with file (this may be used as =C2=ABfourth notion=C2= =BB, 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 =E2=80=98auto-revert-mode=E2=80=99 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 =E2=80=98auto-revert-handler=E2=80=99, it = doesn't matter, because you need to insert new condition here: (when (or auto-revert-tail-mode (not (buffer-modified-p))) ...) This is my point of view, I don't know if it's helpful.