From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: harven Newsgroups: gmane.emacs.help Subject: Re: custom keyboard layout? howto redefine keys? Date: Fri, 10 Apr 2009 18:39:21 +0200 Organization: http://groups.google.com Message-ID: References: <84995d58-0858-4762-b317-8935fdfafcf9@f19g2000yqo.googlegroups.com> <95ednf9KOIEejULUnZ2dnUVZ_r-dnZ2d@sysmatrix.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1239381935 2534 80.91.229.12 (10 Apr 2009 16:45:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Apr 2009 16:45:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 10 18:46:52 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LsJsS-0007Nb-17 for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Apr 2009 18:46:52 +0200 Original-Received: from localhost ([127.0.0.1]:34377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsJr3-0005JO-LC for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Apr 2009 12:45:25 -0400 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Cancel-Lock: sha1:q9aDbxm4OuKmy/5EzWECdY4cYkU= Original-Lines: 35 Original-NNTP-Posting-Date: 10 Apr 2009 18:39:21 MEST Original-NNTP-Posting-Host: 82.240.200.149 Original-X-Trace: 1239381561 news-2.free.fr 6727 82.240.200.149:49266 Original-X-Complaints-To: abuse@proxad.net Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!feed.ac-versailles.fr!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-a.proxad.net!nnrp6-1.free.fr!not-for-mail Original-Xref: news.stanford.edu gnu.emacs.help:168363 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63642 Archived-At: nic.d.m.1@googlemail.com writes: > Thank you very much! I "mixed" your solutions and it worked: > > (global-set-key "b" (lambda () (interactive) (ucs-insert "61"))) > (global-set-key "a" (lambda () (interactive) (ucs-insert "62"))) > > Any idea *why* this works? I don't understand it. What is the meaning > of "interactive" here? you could have used instead: (defun my-command () (interactive) (ucs-insert "61")) (global-set-key "b" 'my-command) Interactive means that the function my-command is actually a command, that is something called interactively using M-x my-command. Now you will probably never use that command directly, so there is no need to give it a name. Hence the lambda which defines an anonymous function, that is a function without a name, and the interactive which convert it to a command. It's a bit paradoxical, but global-set-key wants a command, not a function, as its argument. > By the way: Is there a possibility to reload the .emacs file without > restarting emacs? > > I tried: M-x load-file .emacs but it doesn't work. with current buffer being .emacs, do M-x eval-buffer