[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

invoke a keyboard menu map from lisp?

From: Stephen Leake
Subject: invoke a keyboard menu map from lisp?
Date: Wed, 26 Aug 2015 16:40:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

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"))
    (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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]