all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: From menu button, how run more than one command?
Date: Wed, 01 Mar 2006 11:51:17 -0700	[thread overview]
Message-ID: <du4qge$qpc$1@sea.gmane.org> (raw)
In-Reply-To: <u7j7gj551.fsf@gmail.com>

Mathias Dahl wrote:
 > Luckily for you I struggled too with menus last week. Would something
 > like this work for you?
 >
 > (defvar my-menu (make-sparse-keymap))
 >
 > (define-key my-menu [rmx1]
 >    `(menu-item "Find file on c:/"
 >                ,(lambda ()
 >                   (interactive)
 >                   (abc "c:/"))))
 >
 > (define-key my-menu [rmx2]
 >    `(menu-item "Find file on h:/"
 >                ,(lambda ()
 >                   (interactive)
 >                   (abc "h:/"))))
 >
 > (defun abc (path)
 >    (cd path)
 >    (call-interactively 'find-file))
 >
 > ;; Test it
 >
 > (popup-menu my-menu)

(lambda ...) is a self-evaluating form, so the backquote/comma syntax is
completely extraneous and can be replaced with a simple quote:
'(menu-item ...)

-- 
Kevin Rodgers

  reply	other threads:[~2006-03-01 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-25  3:07 From menu button, how run more than one command? RD
2006-02-27 13:35 ` Mathias Dahl
2006-03-01 18:51   ` Kevin Rodgers [this message]
     [not found]   ` <mailman.166.1141291544.2835.help-gnu-emacs@gnu.org>
2006-03-02 10:50     ` Mathias Dahl
2006-03-02 16:01     ` Johan Bockgård
2006-03-01  4:47 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2006-02-24 22:53 DiGrazia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='du4qge$qpc$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.