Skip to content

Instantly share code, notes, and snippets.

@wrightmikea
Created March 15, 2021 02:17
Show Gist options
  • Save wrightmikea/b5ec6c10229f604bb07c88eef9294cfd to your computer and use it in GitHub Desktop.
Save wrightmikea/b5ec6c10229f604bb07c88eef9294cfd to your computer and use it in GitHub Desktop.
Elisp related to text-mode menu part of 2021 March 5 Emacs SF Dmenu Demo by Mike Wright
;; Elisp related to text-mode menu part of 2021 March 5 Emacs SF Dmenu Demo by Mike Wright
(progn
;; Creating a new menu pane in the menu bar to the right of “Tools” menu
(define-key-after
global-map
[menu-bar mymenu]
(cons "MyMenu" (make-sparse-keymap "mymenu mymenu"))
'tools )
;; Creating a menu item, under the menu by the id “[menu-bar mymenu]”
(define-key
global-map
[menu-bar mymenu nl]
'("Next Line" . next-line))
;; creating another menu item
(define-key
global-map
[menu-bar mymenu pl]
'("Previous Line" . previous-line))
(define-key
global-map
[menu-bar mymenu kq]
'("quit" . keyboard-quit))
)
;; code to remove the whole menu panel
;; (global-unset-key [menu-bar mymenu])
;;(tmm-menubar) ;; text-mode menu - navigate with emacs keys, eg. C-p, C-n; enter to select;
;; or: M-` p n or q to move cursor up down or not at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment