reddit / emacs

magit, auto-revert, and TRAMP

glg00 · 2022-11-15 17:15
In my ongoing quest to optimize my TRAMP setup for slow servers, I've tackled an annoyance where magit does a lot of work looking up a suitable git executable and whatnot when trying to set up auto reverts. I actually enjoy the auto-revert behavior on my local machine, but the aforementioned behavior was making visiting files very slow on some servers I work on. I don't know if I've overlooked an easier way to do this (I've tried a few) but I've settled on the following method using advice, I thought I'd share this in case it's useful (or if there's a better way out there). ​ (defun my-magit-auto-revert-mode-advice (orig-fun &rest args) (unless (and buffer-file-name (file-remote-p buffer-file-name)) (apply orig-fun args))) (advice-add 'magit-turn-on-auto-revert-mode-if-desired :around #'my-magit-auto-revert-mode-advice))
paretoOptimalDev · 2022-11-16 19:50
https://github.com/magit/magit/discussions/4817
glg00 · 2022-11-16 19:54
Great. It would be nice to at least have a user option for that instead of resorting to advising.