cleaned up hooks a bit

This commit is contained in:
Bozhidar Batsov 2011-11-27 14:55:59 +02:00
parent 4bc0350c47
commit 6d3d16fa39
7 changed files with 15 additions and 10 deletions

View file

@ -32,13 +32,13 @@
;;; Code: ;;; Code:
(defun prelude-c-coding-hook () (defun prelude-c-mode-common-hook ()
(setq c-basic-offset 4) (setq c-basic-offset 4)
(prelude-coding-hook)) (prelude-coding-hook))
;; this will affect all modes derived from cc-mode, like ;; this will affect all modes derived from cc-mode, like
;; java-mode, php-mode, etc ;; java-mode, php-mode, etc
(add-hook 'c-mode-common-hook 'prelude-c-coding-hook) (add-hook 'c-mode-common-hook 'prelude-c-mode-common-hook)
(provide 'prelude-c) (provide 'prelude-c)

View file

@ -39,7 +39,10 @@
;; 2. Invoke M-x clojure-jack-in from a project ;; 2. Invoke M-x clojure-jack-in from a project
(require 'clojure-mode) (require 'clojure-mode)
(add-hook 'clojure-mode-hook 'prelude-lisp-coding-hook) (defun prelude-clojure-mode-hook ()
(prelude-list-coding-hook))
(add-hook 'clojure-mode-hook 'prelude-clojure-mode-hook)
(provide 'prelude-clojure) (provide 'prelude-clojure)

View file

@ -166,7 +166,7 @@
(add-hook 'text-mode-hook 'turn-on-auto-fill) (add-hook 'text-mode-hook 'turn-on-auto-fill)
;; load yasnippet ;; load yasnippet
(require 'yasnippet) ;; not yasnippet-bundle (require 'yasnippet)
(yas/initialize) (yas/initialize)
;; keep the whitespace decent all the time ;; keep the whitespace decent all the time

View file

@ -32,12 +32,12 @@
;;; Code: ;;; Code:
(defun prelude-haskell-hook () (defun prelude-haskell-mode-hook ()
(prelude-coding-hook) (prelude-coding-hook)
(turn-on-haskell-doc-mode) (turn-on-haskell-doc-mode)
(turn-on-haskell-indentation)) (turn-on-haskell-indentation))
(add-hook 'haskell-mode-hook 'prelude-haskell-hook) (add-hook 'haskell-mode-hook 'prelude-haskell-mode-hook)
(provide 'prelude-haskell) (provide 'prelude-haskell)

View file

@ -32,12 +32,12 @@
;;; Code: ;;; Code:
(defun prelude-js-coding-hook () (defun prelude-js-mode-hook ()
(prelude-coding-hook) (prelude-coding-hook)
;; electric-layout-mode doesn't play nice with js-mode ;; electric-layout-mode doesn't play nice with js-mode
(electric-layout-mode -1)) (electric-layout-mode -1))
(add-hook 'js-mode-hook 'prelude-js-coding-hook) (add-hook 'js-mode-hook 'prelude-js-mode-hook)
(provide 'prelude-js) (provide 'prelude-js)

View file

@ -36,6 +36,7 @@
(defalias 'perl-mode 'cperl-mode) (defalias 'perl-mode 'cperl-mode)
(defun prelude-cperl-mode-hook () (defun prelude-cperl-mode-hook ()
(prelude-coding-hook)
(setq cperl-indent-level 4) (setq cperl-indent-level 4)
(setq cperl-continued-statement-offset 8) (setq cperl-continued-statement-offset 8)
;; cperl-hairy affects all those variables, but I prefer ;; cperl-hairy affects all those variables, but I prefer

View file

@ -35,10 +35,11 @@
(require 'python) (require 'python)
(defun prelude-python-coding-hook () (defun prelude-python-mode-hook ()
(prelude-coding-hook)
(electric-indent-mode -1)) (electric-indent-mode -1))
(add-hook 'python-mode-hook 'prelude-python-coding-hook) (add-hook 'python-mode-hook 'prelude-python-mode-hook)
(provide 'prelude-python) (provide 'prelude-python)