[Top][All Lists]

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

Re: define-key and functions

From: Bill Rising
Subject: Re: define-key and functions
Date: Sat, 06 Dec 2003 19:19:44 GMT
User-agent: MT-NewsWatcher/3.2 (PPC Mac OS X)

In article <address@hidden>,
 Fredrik Arnerup <address@hidden> wrote:

> Bill Rising <address@hidden> 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)))

Ahh... (slaps self on forehead)
Works like a dream.

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

I understand. It was the first keystroke that came to mind.

Thanks muchly.


reply via email to

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