So, I'm trying to create a universal web search function in Elisp:
(defun look-up-base (url-formatter) (let (search url) (setq search(thing-at-point 'symbol)) (setq url (url-formatter search)) (browse-url url)) )
This function will simply take the word under the cursor, format the word for web search using url-formatter, and then open the search bar in a web browser to perform the search.
Then I try to implement a function that will substitute Google words under the cursor, using the previous function as the basis.
(defun google () (interactive) (look-up-base (lambda (search) (concat "http://www.google.com/search?q=" search))))
Emacs will not complain if I try to evaluate it, but when I try to use it, Emacs gives me this error message:
setq: Symbol function definition is void: url-formatter
And I do not know why this is happening. I donβt see anything wrong with the function, what am I doing wrong?
source share