From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: From menu button, how run more than one command? Date: Wed, 01 Mar 2006 06:47:54 +0200 Message-ID: References: <11vvif44kod09bd@corp.supernews.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1141268853 26349 80.91.229.2 (2 Mar 2006 03:07:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Mar 2006 03:07:33 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 02 04:07:29 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FEe8w-0000dv-DX for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Mar 2006 04:06:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FEe8u-0005xY-UX for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Mar 2006 22:06:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FEJFk-0000Wo-Vs for help-gnu-emacs@gnu.org; Tue, 28 Feb 2006 23:47:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FEJFi-0000VY-S1 for help-gnu-emacs@gnu.org; Tue, 28 Feb 2006 23:47:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FEJFi-0000VH-I7 for help-gnu-emacs@gnu.org; Tue, 28 Feb 2006 23:47:54 -0500 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FEJGt-0002y8-AG for help-gnu-emacs@gnu.org; Tue, 28 Feb 2006 23:49:07 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-83-130-245-83.inter.net.il [83.130.245.83]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id DQT91231 (AUTH halo1); Wed, 1 Mar 2006 06:47:51 +0200 (IST) Original-To: help-gnu-emacs@gnu.org In-reply-to: <11vvif44kod09bd@corp.supernews.com> (message from RD on Fri, 24 Feb 2006 22:07:21 -0500) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33462 Archived-At: > From: RD > 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).