I\'m trying to use the interactive function name feature. On emacs lisp manual it says:
‘a’ A function name (i.e., a symbol satisfying fboundp). Existing, Completion, Pr
This should do this trick:
(defun test (abcd)
(interactive "aTheme name: ")
(call-interactively abcd))
Your function test
receives its argument abcd
as a function, but you can't just invoke a function by putting a symbol referencing it in the first position of a list to be evaluated. Since Emacs Lisp is a Lisp-2, the reference to the function provided to the interactive query is stored in symbol abcd
's value slot, not its function slot. The evaluation rules for a list like
(abcd)
involve looking in the first object's function slot if that object is a symbol, which it is in your case. If instead you wish to invoke a function referenced in a symbol's value slot, you need the funcall function:
(funcall abcd)
That says, "Take abcd
, grab the value out of its value slot, and, provided it's a function, call it here, just as we would have if that function had been referenced in the list's first position either in a symbol's function slot or by a direct reference to the function object."
Here's an answer to a similar question with references useful to allow you probe further.