From 7442449659ab10cf905ac681efdbd5215b3d772c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 18 Dec 2015 21:36:56 +0100 Subject: [PATCH] Move vala-mode-func to editing library --- emacs/.emacs.d/init.el | 8 +++----- emacs/.emacs.d/site-lisp/oni-editing.el | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 43c307d..edb4c22 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -141,10 +141,6 @@ MODE1 is enabled and vice-versa." "Set the `disabled' property for each item in FUNCTIONS to nil." (mapc #'(lambda (f) (put f 'disabled nil)) functions)) -(defun oni:vala-mode-func () - "Function for `vala-mode-hook'." - (setq indent-tabs-mode nil)) - (defun oni:write-file-func () "Function for `write-file-hooks'." (time-stamp)) @@ -560,7 +556,9 @@ MODE1 is enabled and vice-versa." ;; Disable line truncation in term-mode. (add-hook 'term-mode-hook 'oni:disable-line-truncation) -(add-hook 'vala-mode-hook #'oni:vala-mode-func) +;; Don't use tabs in vala-mode +(add-hook 'vala-mode-hook 'oni:disable-tabs-mode) + (add-hook 'write-file-hooks 'oni:write-file-func) (add-hook 'yas-global-mode-hook 'oni:yas-minor-mode-func) diff --git a/emacs/.emacs.d/site-lisp/oni-editing.el b/emacs/.emacs.d/site-lisp/oni-editing.el index 0383cef..b0ab218 100644 --- a/emacs/.emacs.d/site-lisp/oni-editing.el +++ b/emacs/.emacs.d/site-lisp/oni-editing.el @@ -55,6 +55,11 @@ (interactive) (oni:change-number-at-point #'1-)) +;;;###autoload +(defun oni:disable-tabs-mode () + "Function for `vala-mode-hook'." + (setq indent-tabs-mode nil)) + ;;;###autoload (defun oni:downcase-prev (num) (interactive "p")