unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* invoke a keyboard menu map from lisp?
@ 2015-08-26 21:40 Stephen Leake
  2015-08-27  2:21 ` Alexis
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Stephen Leake @ 2015-08-26 21:40 UTC (permalink / raw)
  To: emacs-devel

I'm trying to build a keyboard menu keymap on the fly, and then invoke
it. I've gotten this far:

(defun dvc-offer-choices (comment choices)
  "Present user with a choice of actions, labeled by COMMENT. CHOICES is a list of pairs
containing (function description)."
  ;; Build a keyboard menu keymap
  (let ((i 0)
	(map (make-sparse-keymap "actions"))
	choice)
    (unless (< (length choices) 10)
      (error "‘dvc-offer-choices’ only supports up to 10 choices"))

    (while choices
      (setq choice (pop choices))
      (define-key map (int-to-string i)
	(list menu-item
	      (format "%d) %s" i (cadr choice))
	      (car choice))))
    ;; FIXME: invoke the map
    ))

But I can't find the function that executes the keymap.

Can anyone help?

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-08-27 17:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-26 21:40 invoke a keyboard menu map from lisp? Stephen Leake
2015-08-27  2:21 ` Alexis
2015-08-27  3:18   ` Stephen Leake
2015-08-27  2:30 ` Stephen Leake
2015-08-27  2:46   ` Eli Zaretskii
2015-08-27  3:16     ` Stephen Leake
2015-08-27  6:22 ` Stefan Reichör
2015-08-27 17:00 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

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).