[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: define a keybinding for "find next alternate definition of last tag
From: |
Jambunathan K |
Subject: |
Re: define a keybinding for "find next alternate definition of last tag specified" |
Date: |
Thu, 28 Feb 2013 01:23:52 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
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 <burkhard.schultheis@web.de> 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 <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?
>
> Regards
> Burkhard
>
>
--