branch: elpa/nix-mode
commit e6b9f1b9394495926d737eec348702bf2200bc1e
Author: Matthew Bauer <[email protected]>
Commit: Matthew Bauer <[email protected]>
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