-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diff-hl-after-revert
is completely broken
#205
Comments
Hi! Let's review this step-by-step.
That's helpful, thanks. This kind of thing can be hard to notice in practice, given that when a minor mode is enabled, it usually stays enabled, outside of experimentation. I've fixed it now.
Not quite. When a And having the |
Was there a particular problem you were looking into? |
Hmmm, interesting. I didn't know The issue is that the diff-hl marks don't get updated upon auto-revert. I'm using |
Okay.
Does it do that? I'm looking at https://github.com/bbatsov/projectile/blob/master/projectile.el, and it doesn't seem to have any references to If you were using something else for reverting buffers, e.g. https://github.com/joaotavora/revbufs/blob/master/revbufs.el, it could be the place to look at to find the problem. You can also put a breakpoint on |
My bad, it's not It's odd, anyhow. Sometimes, it refreshes, other times, it doesn't. Perhaps it refreshes only when there is some incoming change as well. And when there are only my modifications, which are committed, then there is no revert, hence to diff-hl update. Hmm. Before |
Yeah, this is probably not a It's a nifty little package! |
Okay, Magit has known problems (you can search the tracker for that term). But this particular step could be improved. @tarsius, what would you say about passing the 3rd argument |
How did you determine that? Can I see the call-stack please.
@dhanak did you follow the instructions at https://github.com/dgutov/diff-hl#magit? The configuration I personally use is (use-package diff-hl
:config
(global-diff-hl-mode)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh t)) |
(Off-topic)
If you find any documentation about that, please point me to it. |
Well, actually since you're calling
I thought the Magit integration "never worked properly"? According to you in #171 (comment), that is. I'll be happy to hear otherwise.
A couple of places I found in the manual: The doc for
And the section "Using Lexical Binding": https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html See the code example and the small paragraph right before it. |
Isn't it
Sort of. I definitely added the |
I guess that's simply not supported by either of the auto-revert mechanisms. Could be added, I guess -- I'll have to see how EDIT: Note that this feature would either slow everything down over Tramp as well, or would need to be disabled at least for remote buffers. |
I'm sorry to say, but this change is complete nonsense. First, it changed the hook function it adds to
after-revert-hook
, but it completely ignored the removal of the same hook function a few lines below. So now this function remains part of the hook forever.But a larger problem is that it defines a variable
revert-buffer-preserve-modes
inside the function definition, and then checks its value. The variable is thus never created, and invoking the function manually causes an error(void variable revert-buffer-preserve-modes)
. As a hook function, it doesn't actually do anything.I strongly believe this change should be reverted.
The text was updated successfully, but these errors were encountered: