From a57251913aefba167469793bfd1874db9f502748 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Fri, 30 Jan 2015 11:32:49 -0800 Subject: [PATCH] feat(emacs): assume lua-mode and mmm-mode are available --- src/emacs/lean-mmm-lua.el | 40 +++++++++++++++++++-------------------- src/emacs/lean-mode.el | 4 +--- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/emacs/lean-mmm-lua.el b/src/emacs/lean-mmm-lua.el index 9a15733fa..f2e41253a 100644 --- a/src/emacs/lean-mmm-lua.el +++ b/src/emacs/lean-mmm-lua.el @@ -4,26 +4,24 @@ ;; Author: Soonho Kong ;; -(when (and (package-installed-p 'mmm-mode) - (package-installed-p 'lua-mode)) - (require 'mmm-mode) - (require 'mmm-auto) - (require 'lua-mode) - (setq mmm-global-mode 'maybe) - (setq mmm-submode-decoration-level 0) - (eval-after-load 'mmm-vars - '(progn - (mmm-add-group - 'lean-lua - '((lua-inline - :submode lua-mode - :face mmm-code-submode-face - :insert ((?l lean-tag nil @ "(*\n" @ " " _ "" @ "\n*)" @)) - :front "[(][*]" - :back "[*][)]"))) - (mmm-add-mode-ext-class 'lean-mode "\\.lean" 'lean-lua))) - (defun lean-mmm-lua-hook () - (setq-local mmm-parse-when-idle t) - (setq-local mmm-idle-timer-delay 0.5))) +(require 'mmm-mode) +(require 'mmm-auto) +(require 'lua-mode) +(setq mmm-global-mode 'maybe) +(setq mmm-submode-decoration-level 0) +(eval-after-load 'mmm-vars + '(progn + (mmm-add-group + 'lean-lua + '((lua-inline + :submode lua-mode + :face mmm-code-submode-face + :insert ((?l lean-tag nil @ "(*\n" @ " " _ "" @ "\n*)" @)) + :front "[(][*]" + :back "[*][)]"))) + (mmm-add-mode-ext-class 'lean-mode "\\.lean" 'lean-lua))) +(defun lean-mmm-lua-hook () + (setq-local mmm-parse-when-idle t) + (setq-local mmm-idle-timer-delay 0.5)) (provide 'lean-mmm-lua) diff --git a/src/emacs/lean-mode.el b/src/emacs/lean-mode.el index d4f078cab..5dc1115e4 100644 --- a/src/emacs/lean-mode.el +++ b/src/emacs/lean-mode.el @@ -176,9 +176,7 @@ enabled and disabled respectively.") (when lean-company-use (company-lean-hook)) ;; mmm-lua-mode - (when (and (package-installed-p 'mmm-mode) - (package-installed-p 'lua-mode)) - (lean-mmm-lua-hook))) + (lean-mmm-lua-hook)) ;; Automode List ;;;###autoload