Path: utzoo!censor!geac!jtsv16!uunet!ginosko!gem.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!uxc.cso.uiuc.edu!tank!eecae!cps3xx!cps3xx.egr.msu.edu!ben From: ben@nsf1.mth.msu.edu (Ben Lotto) Newsgroups: comp.emacs Subject: Re: Using tags and a function key Message-ID: Date: 22 Sep 89 14:02:18 GMT References: <14063@shamash.cdc.com> Distribution: usa Organization: Michigan State University Lines: 33 In-reply-to: mdb@ESD.3Com.COM's message of 22 Sep 89 09:04:10 GMT On 22 Sep 89 09:04:10 GMT, mdb@ESD.3Com.COM (Mark D. Baushke) said: Mark> On 21 Sep 89 15:49:56 GMT, ldk@raistlin.udev.cdc.com (ld kelley) Mark> said: ldk> I am trying (for the first time) to bind a function to a key. Mark> You might try the following: Mark> (define-key sun-raw-map "212z" '(lambda () (find-tag nil t))) This doesn't work (at least on my emacs on my system). I get an error which says Wrong type argument: commandp, (lambda nil (find-tag nil t)) The thing that does work here is (defun my-find-tag-next () (interactive) (find-tag nil t)) (define-key sun-raw-map "212z" 'my-find-tag-next) This is because the third argument to define-key must be nil, a command, a string, a keymap, or a list consisting of elements of the form (keymap . char). -- -B. A. Lotto (ben@nsf1.mth.msu.edu) Department of Mathematics/Michigan State University/East Lansing, MI 48824