evil-mode evil-lookup-func question

Daniel Friedman Daniel.Friedman at oberlin.edu
Sun Jan 6 01:25:19 CET 2013


Hi everyone,

I'm quite new to hacking elisp (and this mailing list), so please bear
with me!

For the past week, I've been customizing evil-mode to fit my
needs. Recently, I've been having trouble setting the evil-lookup-func
variable. I want to add mode-hooks so that when I hit "K" (upper-case)
on a token in a buffer, the lookup functions that is called is
appropriate to the file type. For example, I'm trying to add a hook to
python-mode so that the evil-lookup-func variable is set locally to
py-documentation, but it's not working. Here is my current mode-hook:

(defun my-python-mode-hook()
  (setq evil-lookup-func #'py-documentation))
(add-hook 'python-mode-hook 'my-python-mode-hook)

When I hit "K" on a token in a python-mode buffer, I get the following
error:

funcall: Wrong number of arguments: (lambda (w) "Launch PyDOC on the
Word at Point" (interactive (list (let* ((word (thing-at-point (quote
word))) (input (read-string (format "pydoc entry%s: " (if (not word)
"" (format " (default %s)" word)))))) (if (string= input "") (if (not
word) (error "No pydoc args given") word) input)))) (shell-command
(concat py-shell-name " -c \"from pydoc import help;help('" w "')\"")
"*PYDOCS*") (view-buffer-other-window "*PYDOCS*" t (quote
kill-buffer-and-window))), 0

There are two main things that I need help with:
1. Why am I getting this error, even when there is a word under the
   point? How can I resolve this bug?
2. How do I make this hook only apply to python-mode buffers? When I
   hit "K" in any buffer, it calls this function. I'm sure there's a
   simple solution, but like I said, I'm very new to elisp.

Thanks!
D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ourproject.org/pipermail/implementations-list/attachments/20130105/da63f66c/attachment.htm 


More information about the implementations-list mailing list