all messages for Emacs-related lists mirrored at yhetil.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 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.