From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: define a keybinding for "find next alternate definition of last tag specified" Date: Thu, 28 Feb 2013 01:23:52 +0530 Message-ID: <87bob5ildb.fsf@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361994902 1984 80.91.229.3 (27 Feb 2013 19:55:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Feb 2013 19:55:02 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Burkhard Schultheis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 27 20:55:25 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UAn62-000352-3e for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Feb 2013 20:55:22 +0100 Original-Received: from localhost ([::1]:43510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAn5e-0003rg-1U for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Feb 2013 14:54:58 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAn5N-0003lr-55 for help-gnu-emacs@gnu.org; Wed, 27 Feb 2013 14:54:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAn5B-0003bu-4B for help-gnu-emacs@gnu.org; Wed, 27 Feb 2013 14:54:35 -0500 Original-Received: from mail-da0-f41.google.com ([209.85.210.41]:36492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAn59-0003WR-R8 for help-gnu-emacs@gnu.org; Wed, 27 Feb 2013 14:54:29 -0500 Original-Received: by mail-da0-f41.google.com with SMTP id j17so461453dan.28 for ; Wed, 27 Feb 2013 11:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=8c+yA+OML61IOnwteYB4zAajgbBXJR656RFd2mAvkUU=; b=x9L1cDm11PWdytl64DE9/dtKW557LcbPsnN9lWKM0azpHfpTYAG9xlwML16EG1t9fa opzC1JnloYj9uASCt+5LIhgb2eC5qomsAJnA4um1+cyY70MNB5HyqAKac1Cr4bYbh2N5 YeBqndk+wB9JRv6z9CX+/KJ19CcYGwXzDPs66rKsOmOl552immfNeagfSiKSzFxspY3j nVQZNh/Vk/X9m952FFp6tw11VS0uDQ/JyNsIbg6TxM61AunjeivoeooBzk+XOSE2RUr4 Bli4IM3ejxWkg3z8ZM7PJb49i+FDZoQlB01NznKezZBUxLzf3Qlge4O+z2OHk5BfWVgk BQOQ== X-Received: by 10.66.228.72 with SMTP id sg8mr9391263pac.186.1361994848711; Wed, 27 Feb 2013 11:54:08 -0800 (PST) Original-Received: from debian-6.05 ([101.62.6.45]) by mx.google.com with ESMTPS id k7sm6361349paz.13.2013.02.27.11.54.05 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 27 Feb 2013 11:54:07 -0800 (PST) In-Reply-To: (Burkhard Schultheis's message of "Wed, 27 Feb 2013 14:53:38 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89285 Archived-At: You can let Emacs define stuff for you. (fset 'find-alt-tag (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("\256" 0 "%d")) arg))) (global-set-key [27 f9] (quote find-alt-tag)) Esc-F9 will find the alternate tag. I have used kbd macros C-x ( do something C-x ) C-x C-k n M-x insert-kbd-macro followed by M-x global-set-key RET M-x list-command-history RET For background reading do this. Note the capital "K" C-h K C-x ( C-h K C-x C-k n ps: Gnus will truncate a C-u in the find-alt-tag definition above. But you have the recipe now, so... Burkhard Schultheis writes: > Am 27.02.2013 13:36, schrieb Burkhard Schultheis: >> I want to have a single keystroke for the keystroke sequence C-u m-. >> (find next alternate definition of last tag specified). as far as I see >> there is no command associated with this action. >> >> How can I define a global key in my .emacs file for this action? >> >> Thank you in advance! >> > > In the meantime I've tried it several ways, last test was: > > (defun find-next-tag () > "Find next tag with TAGS file" > ((kdb ) (kbd ))) > > (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? > > Regards > Burkhard > > --