Add denote-menu-bar-mode, making the Denote menu bar optional

This reduces the effect that merely loading denote.el has on Emacs.
This commit is contained in:
Joseph Turner 2023-12-13 01:24:35 -05:00 committed by Protesilaos Stavrou
parent 4261d19a88
commit f0910d3146
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -3798,10 +3798,15 @@ This command is meant to be used from a Dired buffer."
:selected (bound-and-true-p denote-dired-mode)])
"Contents of the Denote menu.")
(define-key-after global-map [menu-bar denote]
(easy-menu-binding
(easy-menu-create-menu "Denote" denote--menu-contents) "Denote")
"Tools")
;;;###autoload
(define-minor-mode denote-menu-bar-mode "Show Denote menu bar."
:global t
(if denote-menu-bar-mode
(define-key-after global-map [menu-bar denote]
(easy-menu-binding
(easy-menu-create-menu "Denote" denote--menu-contents) "Denote")
"Tools")
(define-key global-map [menu-bar denote] nil)))
(defun denote-context-menu (menu _click)
"Populate MENU with Denote commands at CLICK."