[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 23bdbdf21f 124/500: Add custom mmm-mode
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 23bdbdf21f 124/500: Add custom mmm-mode |
Date: |
Sat, 29 Jan 2022 08:26:48 -0500 (EST) |
branch: elpa/nix-mode
commit 23bdbdf21fa17c31204d063bec2edd6270c9fca8
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Add custom mmm-mode
---
nix-mode.el | 2 ++
nix-sh.el | 27 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/nix-mode.el b/nix-mode.el
index c6f3b81db2..4a3bc0bd94 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -399,6 +399,8 @@
(when (require 'company nil 'noerror) (require 'nix-company nil 'noerror))
+(when (require 'mmm-mode nil 'noerror) (require 'nix-sh nil 'noerror))
+
;;;###autoload
(define-derived-mode nix-mode prog-mode "Nix"
"Major mode for editing Nix expressions.
diff --git a/nix-sh.el b/nix-sh.el
new file mode 100644
index 0000000000..6953290b18
--- /dev/null
+++ b/nix-sh.el
@@ -0,0 +1,27 @@
+(require 'mmm-auto)
+
+(defun nix-sh-extra-phases (name)
+ (list (concat name "Phase") (concat "pre" (capitalize name))
+ (concat "post" (capitalize name))))
+
+(let* ((nix-sh-all-phases
+ (apply #'append
+ (mapcar 'nix-sh-extra-phases
+ '("unpack" "patch" "configure" "build"
+ "check" "install" "fixup"
+ "dist"))))
+ (nix-sh-start-regexp
+ (concat (mmm-regexp-opt nix-sh-all-phases t) " = ''")))
+ (mmm-add-group 'nix-sh
+ '((sh-command
+ :submode sh-mode
+ :face mmm-code-submode-face
+ :front "buildPhase = ''"
+ :back "''"
+ )))
+ )
+
+(mmm-add-mode-ext-class 'nix-mode "\\.nix\\'" 'nix-sh)
+
+(provide 'nix-sh)
+;;; nix-mode-mmm.el ends here
- [nongnu] elpa/nix-mode e1f2e24cc4 104/500: Move separate modes into own files., (continued)
- [nongnu] elpa/nix-mode e1f2e24cc4 104/500: Move separate modes into own files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 56a87c8d81 087/500: Move nix-flycheck to separate file., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 199e20413e 102/500: Ignore comments for hanging let's., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode fcbaf3e054 106/500: Rename flycheck mode to "nix-flycheck"., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 542ae77358 110/500: buffer-substring can't bet <1., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of antiquotes., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 66cc5478de 113/500: Merge branch 'master' into separate-files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0fd152e118 119/500: Merge pull request #22 from ljli/various, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 04a268a6fe 126/500: Remove "let" handling of indent., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1a4c98fcf7 118/500: Cosmetics, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 23bdbdf21f 124/500: Add custom mmm-mode,
ELPA Syncer <=
- [nongnu] elpa/nix-mode e413069e02 130/500: Fixup some corner cases in indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2def0ccd6a 191/500: Add autoload for company-nix command, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 895f9d14e5 193/500: Flatten "unless" form with no body, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4a5b6d5d2c 177/500: Add travis and Makefile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode af35742d55 198/500: Merge pull request #39 from purcell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1b3424ade0 190/500: Don't ignore errors when loading nix-format / nix-shebang, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 93a59d9acb 179/500: Use cl-lib instead of cl., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7c732faf3a 183/500: Handle smartparens in nix-mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7716e6d1e4 208/500: fix (cond) usage, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 236318101e 217/500: Cleanup global-nix-mode, ELPA Syncer, 2022/01/29