From f011538a1ed4cf7dcfb44cd7925cc80abad05663 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 25 Mar 2014 09:23:12 +0100 Subject: [PATCH] Emacs: lua-mode hook --- .emacs.d/init.el | 1 + .emacs.d/mode-lua.el | 10 ++++++++++ .emacs.d/mode-perl.el | 5 ++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .emacs.d/mode-lua.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 6f607f91..3ea9edd9 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -86,6 +86,7 @@ Example: to assign some-function to C-i, use (add-hook 'graphviz-dot-mode-hook (lambda () (require 'mode-dot))) (load-external "\\.lua\\'" 'lua-mode nil 'sh-mode) +(add-hook 'lua-mode-hook (lambda () (require 'mode-lua))) (load-external "\\.md\\'\\|\\.markdown\\'" 'markdown-mode) ;; If we need more option, add it to a dedicated file. diff --git a/.emacs.d/mode-lua.el b/.emacs.d/mode-lua.el new file mode 100644 index 00000000..70edaa5e --- /dev/null +++ b/.emacs.d/mode-lua.el @@ -0,0 +1,10 @@ +;;============================================================================== +;; Lua +;;============================================================================== + +(add-hook-and-eval + 'lua-mode-hook + (lambda () + (set (make-local-variable 'compile-command) (concat "lua " buffer-file-name)))) + +(provide 'mode-lua) diff --git a/.emacs.d/mode-perl.el b/.emacs.d/mode-perl.el index 8396d7ed..c888415e 100644 --- a/.emacs.d/mode-perl.el +++ b/.emacs.d/mode-perl.el @@ -2,10 +2,9 @@ ;; Perl ;;============================================================================== -(add-hook - 'python-mode-hook +(add-hook-and-eval + 'perl-mode-hook (lambda () - (set (make-local-variable 'compilation-scroll-output) t) (set (make-local-variable 'compile-command) (concat "perl " buffer-file-name)))) (provide 'mode-perl)