Consider a problem of evaluating a variable who's name is a string:
(defun string-dereference ()
(interactive)
(let ((myStr "rst-adjust"))
;; (describe-function 'myStr) => Symbol's function definition is void: myStr
;; (funcall (format "(describe-function '%s)" myStr) => Invalid function: "(describe-function 'rst-adjust)")
)
While the following works
(describe-function 'rst-adjust)
How do I do that given rst-adjust is stored in a string?
Edit:
The answer is:
(describe-function (intern myStr))
intern is the function you're looking for:
(let ((my-str "rst-adjust"))
(intern my-str))
==> rst-adjust
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With