🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #2180

Re: keymap defs -- using lambda expressions

#2180
From: Benjamin R. Liblit
Date: Sun, 24 Jan 1993 21:11
19 lines
1221 bytes
In article <hyk1H?8o3c@atlantis.psu.edu>, TTN@ECL.PSU.EDU (Thien-Thi Nguyen) writes:
> (define-key some-mode-map '(lambda () (kill-buffer (current-buffer))))

You're missing an argument to define-key.  The general format is:

	(define-key KEYMAP KEY DEFINITION)

You've got the keymap and the definition, but you're missing the key
itself.  Try something like the following:

	(define-key some-mode-map "k" '(lambda () .....))

That would find the given lambda function to the "k" key in the given
keymap.  For more information on how keys can be specified, see
"String Type" in the elisp reference.

--
Ben Liblit   -----   "Fais que tes reves soient plus longs que la nuit."
liblit@cs.psu.edu   --   brl102@psuvm.psu.edu   --   brl102@psuvm.bitnet
Technical Details
Message-ID: <C1DMuy.Hw2@cs.psu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!psuvax1!liblit
References: <hyk1H?8o3c@atlantis.psu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.help
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!psuvax1!liblit
From: liblit@cs.psu.edu (Benjamin R. Liblit)
Subject: Re: keymap defs -- using lambda expressions
In-Reply-To: TTN@ECL.PSU.EDU's message of Sun, 24 Jan 93 20:28:49 GMT
Message-ID: <C1DMuy.Hw2@cs.psu.edu>
Sender: news@cs.psu.edu (Usenet)
Nntp-Posting-Host: waldo.cs.psu.edu
References: <hyk1H?8o3c@atlantis.psu.edu>
Date: Sun, 24 Jan 1993 21:11:15 GMT
Lines: 19