[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: define a keybinding for "find next alternate definition of lasttag s
RE: define a keybinding for "find next alternate definition of lasttag specified"
Wed, 27 Feb 2013 11:23:06 -0800
> (defun find-next-tag ()
> "Find next tag with TAGS file"
> ((kdb <C-u>) (kbd <M-.>)))
> (global-set-key [M-f9] 'find-next-tag)
> If a try Alt-F9 I get an error message reading "Wrong type argument:
> commandp, find-next-tag"
> I've tried it with the function names, too, but I got every time the
> same error message. What's wrong and how to do it right?
First, the error msg means that your function needs to have an `interactive'
spec. That's what makes an EmacsLisp function be a command. See node `Using
Interactive' of the Elisp manual.
Second, the function body is no good. This is what I would do:
(defun find-next-tag ()
The non-nil argument tells `find-tag' that you want the next definition.
You can find this out by doing `C-h k M-.'. That tells you that the function
you need to call is `find-tag', and it tells you that a non-nil first argument
NEXT-P corresponds to providing a prefix argument interactively.