When executing the following I get an error:
(defun caller (func)
(url-retrieve "http://m0smith.freeshell.org/"
(lambda (status) (funcall func))))
(caller (lambda() (message "called")))
Result:
error in process filter: Symbol's value as variable is void: func
What is the best way to solve this problem? Basically I need to accept a callback from somewhere else, wrap it in another lambda and use that as the callback to url-retrieve.
If I change caller to
(defun caller (func)
(url-retrieve "http://m0smith.freeshell.org/"
`(lambda (status) (funcall ,func))))
it works. However, I cannot do this as func is being passed by flycheck and the macro expansion breaks it. To see the full context of what I am doing: https://gist.github.com/m0smith/b5961fda6afd71e82983