From: Mark Karpov <markkarpov@openmailbox.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 20943@debbugs.gnu.org
Subject: bug#20943: 25.0.50; Dired buffers are not always auto-reverted
Date: Fri, 10 Jul 2015 01:42:38 +0600 [thread overview]
Message-ID: <87io9t3yoh.fsf@openmailbox.org> (raw)
In-Reply-To: <874mld18cx.fsf@gmx.de> (Michael Albinus's message of "Thu, 09 Jul 2015 20:41:50 +0200")
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.
next prev parent reply other threads:[~2015-07-09 19:42 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87io9t3yoh.fsf@openmailbox.org \
--to=markkarpov@openmailbox.org \
--cc=20943@debbugs.gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.