emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/denote f0910d3146 13/20: Add denote-menu-bar-mode, maki


From: ELPA Syncer
Subject: [elpa] externals/denote f0910d3146 13/20: Add denote-menu-bar-mode, making the Denote menu bar optional
Date: Wed, 20 Dec 2023 03:58:01 -0500 (EST)

branch: externals/denote
commit f0910d31465090e181efcbba7e7b356329bc1429
Author: Joseph Turner <joseph@breatheoutbreathe.in>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add denote-menu-bar-mode, making the Denote menu bar optional
    
    This reduces the effect that merely loading denote.el has on Emacs.
---
 denote.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/denote.el b/denote.el
index d9210e1518..89b2b276a3 100644
--- a/denote.el
+++ b/denote.el
@@ -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."



reply via email to

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