unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: chris@grierwhite.com (Christopher J. White)
Subject: Re: Binding functions and parameters
Date: Tue, 28 Jan 2003 09:56:49 -0500	[thread overview]
Message-ID: <m2y955fhla.fsf@bluesteel.grierwhite.com> (raw)
In-Reply-To: mailman.1080.1043762793.21513.help-gnu-emacs@gnu.org

>>>>> "bruce" == Bruce Ashfield <bruce@zedd.org> writes:

bruce> What I'd like to do is create a series of menu entries (or toolbar
bruce> buttons) that trigger different actions. It's no problem creating
bruce> the entries, it's the binding of the function I'd like them to call
bruce> that is causing the problem. I don't know how many entries I'll have
bruce> so I'm creating a single function that takes one argument. I'm 
bruce> triggering on the argument to figure out what to do.

By way of example, here's a way to set a key...

(let ((msg "Hello"))
     (local-set-key [f12] `(lambda() (interactive) (message ,msg))))

The backquote says there are variables inside that need to 
be replaced (prefixed by ,), namely msg.  lambda makes it an
argumentless interactive function.

...cj

-- 
------------------------------------------------------------------------------
 Christopher J. White                                    chris@grierwhite.com
------------------------------------------------------------------------------ 

       reply	other threads:[~2003-01-28 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1080.1043762793.21513.help-gnu-emacs@gnu.org>
2003-01-28 14:56 ` Christopher J. White [this message]
2003-01-28 14:05 Binding functions and parameters Bruce Ashfield

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m2y955fhla.fsf@bluesteel.grierwhite.com \
    --to=chris@grierwhite.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).