help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: define-key and functions


From: Fredrik Arnerup
Subject: Re: define-key and functions
Date: Sat, 06 Dec 2003 20:15:09 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Bill Rising <brising@louisville.edu> writes:

> Hello wizards,
>
> Is there a way to use a function which takes arguments in define-key?
>
> For instance:
> (define-key global-map "C-m" 'foo-new-line)
> runs the command foo-new-line if C-m is pressed.
>
> Is there a way to pass an argument to foo-new-line?

(define-key global-map "\C-m" 
  (lambda () (interactive) (foo-new-line argument)))

You really don't want to redefine C-m though. It's the same as Enter!

-- 
Fredrik Arnerup <e97_far@e.kth.se>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]