I'm creating a modular system for my use of Emacs
, so I can call modules on the fly, as I need them. Just like a lazy call, but I must explicitly call them.
Anyways, I found this riddle, I want a function lw/define-loadable
such that
(defun lw/define-loadable (fn-name mod-name)
(defun fn-name ()
(interactive)
(load! (concat "../modules/" mod-name))))
when I call
(lw/define-loadable "lw/load-chinese" "chinese.el")
Will have the same effect of calling
(defun lw/load-chinese ()
(interactive)
(load! "../modules/chinese.el"))
Currently, the call will define the funtion fn-name
as it were hard-coded.