I have code to enable Corfu text completion. I define two functions: corfu-armg loads the package, and corfu-go activates text completion. I use a wrapper function, launchport, which accepts a list of action symbols (like 'go), and calls the appropriate function (using funcall) when it processes each symbol.
Currently, corfu-go is defined as:
(defun corfu-go ()
(setq corfu-auto t)
(global-corfu-mode 1))
and launchport is:
(defun launchport (actm-seqr armg-fun go-fun)
(catch 'exit
(dolist (actm actm-seqr)
(pcase actm
('armg (funcall armg-fun))
('go (funcall go-fun) ))) )
Finally I make a wrapper function
(defun wrapper (actm-seqr)
(launchport actm-seqr #'corfu-armg #'corfu-go))
Suppose I now want corfu-go to take an argument (for example, myarg):
(defun corfu-go (myarg)
(message "Arg: %s " myarg)
(setq corfu-auto t)
(global-corfu-mode 1))
The basic Usage of funcall is:
(funcall FUNCTION ARG1 ARG2 ...)
But I can't figure out how funcall can use ARG1. How would the launchport call be modified inside wrapper to allow corfu-go with ARG1?
&optionalarguments.launchportaccept functions with arguments and make the arguments available for execution in thefuncallclause?funcallso that we know you have read it.