Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!sri-spam!nike!ucbcad!ucbvax!BONNIE.UCI.EDU!escott From: escott@BONNIE.UCI.EDU (Scott Menter) Newsgroups: net.emacs Subject: Key Bindings in GNU Emacs Message-ID: <8609022340.AA10481@ucbvax.Berkeley.EDU> Date: Tue, 2-Sep-86 19:40:38 EDT Article-I.D.: ucbvax.8609022340.AA10481 Posted: Tue Sep 2 19:40:38 1986 Date-Received: Tue, 2-Sep-86 23:43:22 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: UCI ICS Computing Support Group Lines: 36 Hello again, Emacs folk. Time for another question -- this time I think I'm really missing something: Is there an easy way to bind a key to a command that takes an argument? I'd like the keystroke to provide the argument, not make the user do so with C-u or something. The way I've been doing this is something like the following: (defun scroll-up-one-line ( ) "Emulate the Gosling C-z" (interactive) (scroll-up 1)) (global-set-key "whatever" 'scroll-up-one-line) Then I said, "Hey, Scott, I'll bet you could do it this way instead:" (defmacro scroll-up-one-line ( ) "Same as above, but a macro" (scroll-up 1)) (global-set-key "whatever" 'scroll-up-one-line) But noooo, because the 2nd argument to "global-set-key" needs to be a command (commandp => t). Using "interactive" in the macro didn't help, either. Well, do I really need to define a new command every time I want to do this? Seems like a waste... Thanks yet again, Gnurus! -------------------------------------------------------------------------- E. Scott Menter Internet: escott@ics.uci.edu UCI ICS Computing Support Group UUCP: ...!ucbvax!ucivax!escott Snail: Univ of Calif ICS Dept "...Say, Foz, about my vocals..." Irvine, Calif 92717 --------------------------------------------------------------------------