Closed walseb closed 4 years ago
Hi!
Perhaps we could model this after font-lock-global-modes
? With the special meaning for the not
symbol.
Another example: company-global-modes
.
Using '(not image-mode)
as the default sounds fine to me.
Thanks for the suggestion! I finally got around to doing this. I just copied the mechanism directly from font-lock and it seems to work fine
As a side note, when a image is opened it's read in fundamental-mode before switching to image-mode. This causes
Nevermind, I was going to report this upstream but now I can't replicate it. I must have done something wrong in the earlier testsdiff-hl
to be run on the image data which takes a while depending on image size. This is also a problem for a lot of other minor modes and the only solution besides fixing it upstream seems to be to make them ignore fundamental-mode, which can be a problem if you edit a lot of files in fundamental-mode. So while this new option decreases the loading time of images, the global mode still slows it down a bit, at least in my testing.
Nevermind, I was going to report this upstream but now I can't replicate it. I must have done something wrong in the earlier tests
I'm guessing this might have been a difference between just visiting a file for the first time and M-x image-mode
in an existing buffer. But I'm not sure.
Do you think it would also be ok to add minibuffer-inactive-mode
to the default ignore list? Is there any use case where you would want diff-hl
in the minibuffer? I haven't observed any downsides to running it in the minibuffer however, so maybe this isn't worth doing
Do you think it would also be ok to add minibuffer-inactive-mode to the default ignore list?
No need. buffer-file-name
is nil in minibuffer.
I have now merged all the commits and fixed all the problems I think
Looks good. I'll edit it a bit later to make it shorter.
Thanks!
Currently
global-diff-hl-mode
makesdiff-hl
run in every buffer regardless ofmajor-mode
. This becomes a problem inimage-mode
buffers under git control inemacs 27
built withoutimagemagick
support (which is the default currently), where files ~5 mb starts taking minutes to load instead of seconds. I haven't checked to see if this also a problem when usingimagemagick
to render images, but it probably is.