Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!APPLE.COM!nli!jym From: nli!jym@APPLE.COM Newsgroups: gnu.emacs Subject: Re: simple question: global-set-key Message-ID: <9002071720.AA13995@nlp9> Date: 7 Feb 90 17:20:48 GMT References: Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: Natural Language Inc. Lines: 23 > Here is what I do > (define-key esc-map "!" '(lambda (arg) (interactive "p") (recenter 0))) > I'd be happy to see a better solution (but this one works). You can, of course, use global-set-key as well: (global-set-key "\C-ot" '(lambda (arg) (interactive "p") (recenter 0))) Formally creating a function is "better" if you'd like to take advantage of Emacs' self-documenting features: (defun my-recenter (arg) "Puts current line to top of window." (interactive "p") (recenter 0) ) ;defun; (global-set-key "\e?" 'my-recenter) :::.-----.::: <_Jym_> ::::::::::::::::::::::::::::::::::.-----.::: ::/ | \:::::::::::::::::::::::::::::::: Jym Dyer ::/ o o \:: ::\ /|\ /::::::::::::::::::::::: nli!jym@apple.com ::\ \___/ /:: :::`-----':::::::::::::::::: Berserkeley, California :::`-----':::