A minor mode is not enabled/disabled by setting a variable. The minor mode variable should be used to check the "mode enabled" status, not to set the mode state. If its value is t
, the minor mode is on, else the mode is off.
See the below snippets to see how to control any minor mode. Replace MINOR-MODE-NAME
with the actual minor mode name you are dealing with (global-auto-revert-name
as is the case in the question).
Enabling a minor mode
Using elisp
Directly
(MINOR-MODE-NAME)
;; or
(MINOR-MODE-NAME 1)
Based on a hook activation
(add-hook 'SOME-HOOK #'MINOR-MODE-NAME)
Disabling a minor mode
Using elisp
Directly
(MINOR-MODE-NAME 0)
;; or
(MINOR-MODE-NAME -1)
Based on a hook activation
(add-hook 'SOME-HOOK (lambda () (MINOR-MODE-NAME -1)))
Toggling a minor mode
Interactively
M-x MINOR-MODE-NAME
Using a key binding
(global-set-key (kbd "<KEY>") #'MINOR-MODE-NAME)
Using elisp (non-interactively)
(MINOR-MODE-NAME 'toggle)
Sources
(global-auto-revert-mode 1)
auto-revert-interval
? I use it and it works for me, excepting files over tramp.