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

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

Re: Multiple keymaps for a minor mode


From: Tim Johnson
Subject: Re: Multiple keymaps for a minor mode
Date: Thu, 5 Mar 2020 15:45:49 -0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Tim Johnson <tim@akwebsoft.com> writes:

They exist for the purpose of giving better help. Essentially they
*are* arbitrary.
So you also could establish the association to categories in some other
way and look up the categories when building the popup menus.

In fact, should my muse so move me, I want a keybind/command to
display in more than one category.
That should not be a problem.  Anyway, don't hesitate to post some code
snippets or more code when you want.

I'm quite happy with the results that I have produced, and am happy to share.

The core elisp is as follows:


(defun info-popup (title &rest messages)
  "simple informational popup"
  (interactive)
  (let (menu items)
    (setq menu (list title))
    (setq items '("--"))
    (dolist (message messages)
      (setq items (append items (list(cons message nil)))))
    (setq menu (append menu (list items)))
    (condition-case nil
    (x-popup-menu (list '(700 300) (selected-window)) menu)
      ((quit) nil))))

;; I have two complaints about the result of my code:

;; The title shows as quite pale, not a big deal, but the solution would edify me.

;; x-popup-dialog by default shows in the very center of the frame. I would love it if I could accomplish the same with x-popup-menu, but couldn't figure that part out.

;; Below is a simple implementation


(defun tj-transpose-info ()
  "Popup transpostition key bindings"
  (interactive)
  (info-popup
   "Transposition"
   " C-M-t Sexps" "C-t Prev chars" "M-t Words" "C-x C-t Lines"))

Thanks for the interest

--
Tim
tj49.com




reply via email to

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