I am trying to create a function in my .emacs to bind to kbd "*" in evil mode to highlight the word under cursor in addition to normal search as in vim.
I modified the script from: http://www.emacswiki.org/emacs/SearchAtPoint
This is what I have:
(defun isearch-yank-regexp (regexp)
"Pull REGEXP into search regexp."
(let ((isearch-regexp nil)) ;; Dynamic binding of global.
(isearch-yank-string regexp))
(if (not isearch-regexp)
(isearch-toggle-regexp))
(isearch-search-and-update))
(defun isearch-yank-symbol ()
"Put symbol at current point into search string."
(interactive)
(let ((sym (highlight-regexp)))
(if (null sym)
(message "No symbol at point")
(isearch-yank-regexp
(concat "\\_<" (regexp-quote sym) "\\_>")) 'hi-yellow)))
There seems to be some error here:
let: Wrong number of arguments: #[(regexp &optional face)
I am a lisp newbie.
Could you please help to fix this ?
highlight-regexp
with 0 args, while it requires at least 1. Usef1 f
to read the function doc forhighlight-regexp
– abo-abo