Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!think!husc6!panda!genrad!mit-eddie!mit-trillian!rlk From: rlk@mit-trillian.MIT.EDU (Robert L Krawitz) Newsgroups: net.emacs Subject: Re: Key Bindings in GNU Emacs Message-ID: <1083@mit-trillian.MIT.EDU> Date: Wed, 3-Sep-86 11:28:13 EDT Article-I.D.: mit-tril.1083 Posted: Wed Sep 3 11:28:13 1986 Date-Received: Wed, 3-Sep-86 21:06:19 EDT Reply-To: rlk@athena.MIT.EDU Organization: MIT Project Athena Lines: 31 First of all, I'm a bit confused as to the problem you're having. If I understand correctly what you are trying to do, you want to have a command do different things depending upon what key sequence was used to invoke it. A macro is definitely not the correct thing to use in this situation. What you want is a command to "surround" the primary function, interpreting the keystrokes. The function this-command-keys does the right thing (well, it returns "\^M" if you invoked it by means of M-x or the like, but that shouldn't really be a problem). So you might do something like this: (defun simple-argument-for-next-line () (interactive) (let ((keys (this-command-keys))) (next-line (cond ((string= keys "0") 0) ((string= keys "1") 1) ((string= keys "2") 2) ... ((string= keys "11") 11))))) (I needn't state that this example is obviously contrived, but I might as well anyhow). Obviously, this example can be rearranged to fit one's tastes, but you get the general idea. It may well be convenient to have an interactive spec equivalent to this-command-keys, but it probably isn't necessary. -- Robert^Z