Gnus development mailing list
 help / color / mirror / Atom feed
From: Norman Walsh <ndw@nwalsh.com>
Subject: OT emacs question, please forgive me :-)
Date: Mon, 29 Sep 2003 13:54:33 -0400	[thread overview]
Message-ID: <87vfrbtr8m.fsf@nwalsh.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I can't tell if my ISP is providing proper newsgroup access or not. So
I don't know if my post to gnus.emacs.help actually went anywhere. I
know this is off-topic, and I humbly beg your forgiveness. OTOH,
you're all a whole lot more elisp skilled than I, so perhaps the
answer is obvious and you'd be gracious enough to point me in the
right direction.

I'm guessing there must be some way to do this other than brute force.

I have an alist:

(defvar my-alist
  '(("choice1" . "opt1")
    ("choice2" . 35)
    ("choice3" . "opt3")))

I want to make a menu-bar menu that contains choice1, choice2, choice3.
If choice1 is selected, I want to evaluate (my-function "opt1"),
If choice2 is selected, I want to evaluate (my-function 35), etc.

I can see a brute-force solution:

(defun my-function-opt1 ()
  (interactive)
  (my-function "opt1"))

(define-key menu-bar-my-menu [my-choice1]
  '("choice1" . my-function-opt1))

But it seems to me that it should be possible to build the menu bar
from the alist. Alas, it's just beyond my elisp skills.

Clues, please?

                                        Be seeing you,
                                          norm

- -- 
Norman Walsh <ndw@nwalsh.com> | Many eyes go through the meadow, but
http://nwalsh.com/            | few see the flowers in it.--Ralph Waldo
                              | Emerson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQE/eHHYOyltUcwYWjsRAsLPAJ9GBiFXmOLBNb4IU2Vwm772eK9AWQCePHHL
9O9PDjr0osLVAnknar6n6QA=
=2fAa
-----END PGP SIGNATURE-----



             reply	other threads:[~2003-09-29 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-29 17:54 Norman Walsh [this message]
2003-09-29 20:26 ` Reiner Steib

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=87vfrbtr8m.fsf@nwalsh.com \
    --to=ndw@nwalsh.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 NNTP newsgroup(s).