help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: global-bind a function key


From: Óscar Fuentes
Subject: Re: global-bind a function key
Date: Wed, 20 Feb 2013 12:44:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Glen Stark <mail@glenstarkREMOVEME.net> writes:

> I feel like this should be really simple but I'm having a hard time 
> anyway.
>
> I'm using emacs 24.2.1
>
> Following the instructions here: http://www.delorie.com/gnu/docs/emacs/
> emacs_497.html
>
> I have the following line in my .emacs file:
>
>       (global-set-key [f5] 'convert-include-type)
>
> (convert-include-type is a function of my own definition).  
>
> If I evaluate the above lisp expression I get no errors, but pressing the 
> F5 key produces the message "<SunOpen> is undefined", which is apparently 
> the default keybinding for F5.  

It seems that your desktop environment (the equivalent to
KDE/Gnome/whatever you are using) translates F5 to the virtual key
<SunOpen>, which is what Emacs sees. This means that Emacs never sees
the F5 key as pressed, so it is no surprise that your global-set-key
doesn't work.

> If I run "global-set-key, f5, convert-include-type" from the minibuffer, 
> everything works as expected.  

Here, when you interactively press F5, <SunOpen> is sent to Emacs, which
in practice means that you are binding <SunOpen>.

> I tried a couple other syntaxes for keybinding an f5 key that I found on 
> the web, but so far I have had no luck.  Can someone help me out?  

If I'm correct there is no syntax for F5 that works for your setup
because the desktop environment is translating the F5 press event to
<SunOpen>.

Maybe your desktop environment allows to remove the F5 -> <SunOpen>
mapping with some configuration tool.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]