help-gnu-emacs
[Top][All Lists]
Advanced

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

Testing menu and keymap


From: uzibalqa
Subject: Testing menu and keymap
Date: Mon, 10 Jul 2023 10:35:48 +0000

I am making a menu and associated keymap but have few ideas on how to test this.



(defvar tika-kymap
  (let ( (pfmap (make-sparse-keymap)) )
    (keymap-set pfmap "H-b" #'outline-hide-body)
    pfmap))

;; --------

(defvar tika-menuitm-kymap
  (let ((menuitm-kymap (make-sparse-keymap)))

    (define-key menuitm-kymap [hide]
                (cons "Hide" (make-sparse-keymap "Hide")))

    (define-key menuitm-kymap [hide body]
                '(menu-item "Hide Body" outline-hide-body
                            :help "Hide bodies, visible headings"))

    menuitm-kymap))

;; --------

(defvar tika-menubar-kymap

  (let ((menubar-kymap (make-sparse-keymap)))

    (define-key menubar-kymap [tematika]
      (cons "Outl"
            (nconc (make-sparse-keymap "Outl Menu")
                   (apply #'append
                          (mapcar (lambda (x) (if (consp x) (cdr x)))
                                  tika-menuitm-kymap)))))





reply via email to

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