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

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

Re: From menu button, how run more than one command?


From: Eli Zaretskii
Subject: Re: From menu button, how run more than one command?
Date: Wed, 01 Mar 2006 06:47:54 +0200

> From: RD <rjjd@localnet.com>
> Date: Fri, 24 Feb 2006 22:07:21 -0500
> 
> (defvar my-menu (make-sparse-keymap))
> 
> (define-key my-menu [rmx]
>    '(menu-item "FILE" abc))      ;executes function abc
> 
> (defun abc ()
>    (interactive)
>    (cd "C:/emacs")
>    (call-interactively 'find-file)
> )
> 
> Is there a way to write the "define-key" so that I don't need a separate
> function?

Yes, use `lambda' (a.k.a. anonymous functions).




reply via email to

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