From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: global-bind a function key Date: Wed, 20 Feb 2013 12:44:48 +0100 Message-ID: <87liajqken.fsf@wanadoo.es> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361360716 19469 80.91.229.3 (20 Feb 2013 11:45:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 11:45:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 20 12:45:39 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 1U887G-0002TW-8Z for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2013 12:45:38 +0100 Original-Received: from localhost ([::1]:50491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U886s-00006w-S9 for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2013 06:45:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U886k-0008WT-Sg for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 06:45:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U886e-00058B-8p for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 06:45:06 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:33084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U886e-00057w-2o for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 06:45:00 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U886v-0002Ft-JY for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 12:45:17 +0100 Original-Received: from 72.red-83-34-21.dynamicip.rima-tde.net ([83.34.21.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Feb 2013 12:45:17 +0100 Original-Received: from ofv by 72.red-83-34-21.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Feb 2013 12:45:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 72.red-83-34-21.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:G9aXvs3t0x5qzidOxxO+ia4F+Nk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:89176 Archived-At: Glen Stark 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 " 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 , 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, is sent to Emacs, which in practice means that you are binding . > 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 . Maybe your desktop environment allows to remove the F5 -> mapping with some configuration tool.