unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: help-gnu-emacs@gnu.org
Subject: Re: global-bind a function key
Date: Wed, 20 Feb 2013 12:44:48 +0100	[thread overview]
Message-ID: <87liajqken.fsf@wanadoo.es> (raw)
In-Reply-To: wP%Us.784962$iq1.414547@en-nntp-12.dc1.easynews.com

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	other threads:[~2013-02-20 11:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20  8:29 global-bind a function key Glen Stark
2013-02-20 11:44 ` Óscar Fuentes [this message]
2013-02-20 12:27 ` Jambunathan K
2013-02-20 12:28 ` Jambunathan K
2013-02-20 12:56 ` Glen Stark
2013-02-20 15:00 ` Drew Adams
2013-02-20 15:52 ` Stefan Monnier

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=87liajqken.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --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).