[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cancel enabling of minor-mode.
From: |
Nicolas Richard |
Subject: |
Re: Cancel enabling of minor-mode. |
Date: |
Thu, 28 Nov 2013 13:22:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
>> Can I somehow cancel enabling of my minor-mode?
>
> To cancel, you can (setq test-mode nil).
IIUC, it will still run any hook associated with the mode like for any
mode change (+ show the message "Test mode disabled"). Not too bad, but
not exactly like cancelling either. Perhaps some (user-error ...) would
be ok in that case ?
Otherwise, the OP could define a helper function `test-mode-maybe'
which would check and only activate if it's ok.
--
Nico.