unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Burkhard Schultheis'" <burkhard.schultheis@web.de>,
	<help-gnu-emacs@gnu.org>
Subject: RE: define a keybinding for "find next alternate definition of lasttag specified"
Date: Wed, 27 Feb 2013 11:23:06 -0800	[thread overview]
Message-ID: <71E20C988188464CBC4C4D82C7DFF4E2@us.oracle.com> (raw)
In-Reply-To: <kgl356$b6q$1@news.albasani.net>

> (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 ()
  "..."
  (interactive)
  (find-tag t))

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.




  reply	other threads:[~2013-02-27 19:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 12:36 define a keybinding for "find next alternate definition of last tag specified" Burkhard Schultheis
2013-02-27 13:53 ` Burkhard Schultheis
2013-02-27 19:23   ` Drew Adams [this message]
2013-02-27 19:53   ` Jambunathan K
     [not found]   ` <mailman.21045.1361993039.855.help-gnu-emacs@gnu.org>
2013-02-28  8:31     ` define a keybinding for "find next alternate definition of lasttag specified" Burkhard Schultheis
2013-02-28 15:00   ` define a keybinding for "find next alternate definition of last tag specified" Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71E20C988188464CBC4C4D82C7DFF4E2@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=burkhard.schultheis@web.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).