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

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

[nongnu] elpa/nix-mode e6b9f1b939 016/500: Add menu bar.


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode e6b9f1b939 016/500: Add menu bar.
Date: Sat, 29 Jan 2022 08:26:30 -0500 (EST)

branch: elpa/nix-mode
commit e6b9f1b9394495926d737eec348702bf2200bc1e
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>

    Add menu bar.
---
 nix-mode.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/nix-mode.el b/nix-mode.el
index edfd21b366..eeac4af534 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -156,6 +156,13 @@ If a close brace `}' ends an antiquote, the next character 
begins a string."
   (interactive)
   (indent-relative-maybe))
 
+(defvar nix-mode-map nil "Keymap for nix-mode.")
+
+(let ((menuMap (make-sparse-keymap "Nix")))
+  (define-key nix-mode-map [menu-bar] (make-sparse-keymap))
+  (define-key nix-mode-map [menu-bar nix] (cons "Nix" menuMap))
+  (define-key menuMap [about]
+    '("Indent line" . nix-indent-line)))
 
 ;;;###autoload
 (define-derived-mode nix-mode prog-mode "Nix"
@@ -206,8 +213,10 @@ The hook `nix-mode-hook' is run when Nix mode is started.
   ;; Filling of comments.
   (setq-local adaptive-fill-mode t)
   (setq-local paragraph-start "[ \t]*\\(#+[ \t]*\\)?$")
-  (setq-local paragraph-separate paragraph-start))
+  (setq-local paragraph-separate paragraph-start)
 
+  ;; Local keymp and menu
+  (use-local-map nix-mode-map))
 
 ;;;###autoload
 (progn



reply via email to

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