Created
March 15, 2021 02:17
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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