With a package that defines a minor mode which calls an external function at run-time.
Is it reasonable to move this:(require 'my-runtime-dependency)
in the body of the code which enables the minor mode? or should it always be at the top of the file?
e.g:
(eval-when-compile
;; Quiet warnings.
(require 'my-runtime-dependency))
;; --- Snip
(defun my-mode-enable ()
(require 'my-runtime-dependency)
;; body.
)
(defun my-mode-disable ()
;; body.
)
;;;###autoload
(define-minor-mode my-mode
"Toggle `my-mode' in the current buffer."
:global nil
(cond
(my-mode (my-mode-enable))
(t (my-mode-disable))))