Say I have foobar_utility.el
that defines an interactive function foobar_utility
.
How can I postpone loading foobar_utility.el
until foobar_utility
is called?
Example usage:
(load (concat user-emacs-directory "foobar_utility.el") :nomessage t)
(global-set-key (kbd "<f1>") 'foobar_utility)
Is there a better way to do this besides moving the load into the key binding? e.g:
(global-set-key
(kbd "<f1>")
(lambda ()
(interactive)
(load (concat user-emacs-directory "foobar_utility.el") :nomessage t)
(call-interactively 'foobar_utility)))