I have a minor mode definition like this, and I want to prevent it from being enabled when the config variable
example-mode-config has not been defined.
;;; .... ;;;###autoload (define-minor-mode example-mode "Enables the example mode" (if example-mode (example-mode-enable) (example-mode-disable))) (defun example-mode-enable () (cond ((not example-mode-config) (message "please define example-mode-config before using example-mode") ;;; seem to need to do something here to disable the mode ;;; otherwise the mode gets enabled, but does not work ) (t ;;;; go ahead and set up ..... )))
The problem is that if
example-mode-config is undefined, the function
example-mode-config returns doing nothing, but the calling framework still goes ahead and enables the mode.