This has been driving me crazy, I can't get this to work. I want to link the on-off status of a handful of minor modes, in particular evil-mode, evil-quickscope-mode, hl-paren-mode, and a few others. I don't necessarily want evil globally, but once I turn on evil-mode I want the other modes to also turn on (and correspondingly turn off once evil turns off).
Is there a way to accomplish this cleanly? The closest I've come involved using mode-hooks, but somehow the modes always got out of sync (evil on, others off. others on, evil off. etc.)
edit: Posting the relevant mode-hooks section of my init.el:
;; Evil Mode Setup
(require 'evil-leader)
(evil-leader/set-leader ",")
(evil-leader/set-key "q" 'kill-buffer-and-window)
(evil-leader/set-key "b" 'ibuffer)
(defun after-all-loads () (require 'evil))
(add-hook 'after-init-hook 'after-all-loads)
(define-key global-map "\C-xv" 'evil-mode)
(add-hook 'evil-mode-hook 'hl-paren-mode)
(add-hook 'evil-mode-hook 'evil-visual-mark-mode)
(add-hook 'evil-mode-hook 'evil-quickscope-mode)
(add-hook 'evil-mode-hook 'evil-leader-mode)
evil-quickscope-mode
is defined viadefine-minor-mode
. The doc fordefine-minor-mode
says: "When called from Lisp, the mode command toggles the mode if the argument is `toggle', disables the mode if the argument is a non-positive integer, and enables the mode otherwise (including if the argument is omitted or nil or a positive integer)."