<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -62,18 +62,30 @@ Symbols matching the text at point are put first in the completion list.&quot;
            (position (cdr (assoc selected-symbol name-and-pos))))
       (goto-char position))))
 
-(defun coding-hook ()
-  &quot;Enable things that are convenient across all coding buffers.&quot;
-  (set (make-local-variable 'comment-auto-fill-only-comments) t)
+;;; These belong in coding-hook:
+
+(defun local-column-number-mode ()
   (make-local-variable 'column-number-mode)
-  (column-number-mode t)
-  (setq save-place t)
-  (auto-fill-mode) ;; in comments only
-  (if window-system (hl-line-mode t))
-  (pretty-lambdas)
-  ;; TODO: this breaks in js2-mode!
-  ;;(if (functionp 'idle-highlight) (idle-highlight))
-  )
+  (column-number-mode t))
+
+(defun local-comment-auto-fill ()
+  (set (make-local-variable 'comment-auto-fill-only-comments) t)
+  (auto-fill-mode t))
+
+(defun turn-on-hl-line-mode ()
+  (if window-system (hl-line-mode t)))
+
+(defun turn-on-save-place-mode ()
+  (setq save-place t))
+
+(add-hook 'coding-hook 'local-column-number-mode)
+(add-hook 'coding-hook 'local-comment-auto-fill)
+(add-hook 'coding-hook 'turn-on-hl-line-mode)
+(add-hook 'coding-hook 'pretty-lambdas)
+  
+(defun run-coding-hook ()
+  &quot;Enable things that are convenient across all coding buffers.&quot;
+  (run-hooks coding-hook))
 
 (defun untabify-buffer ()
   (interactive)</diff>
      <filename>starter-kit-defuns.el</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
      (defun js-lambda () (interactive) (insert &quot;function () {\n}&quot;)
        (backward-char 5))
 
-     (add-hook 'js2-mode-hook 'coding-hook)
+     (add-hook 'js2-mode-hook 'run-coding-hook)
 
      (define-key js2-mode-map (kbd &quot;C-c l&quot;) 'js-lambda)
      (define-key js2-mode-map &quot;\C-\M-h&quot; 'backward-kill-word)</diff>
      <filename>starter-kit-js.el</filename>
    </modified>
    <modified>
      <diff>@@ -25,9 +25,10 @@
 
 ;;; Emacs Lisp
 
-(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
-(add-hook 'emacs-lisp-mode-hook 'coding-hook)
+(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
+(add-hook 'emacs-lisp-mode-hook 'run-coding-hook)
 (add-hook 'emacs-lisp-mode-hook 'esk-remove-elc-on-save)
+(add-hook 'emacs-lisp-mode-hook 'idle-highlight)
 
 (defun esk-remove-elc-on-save ()
   &quot;If you're saving an elisp file, likely the .elc is no longer valid.&quot;
@@ -42,7 +43,9 @@
 
 ;;; Clojure
 
-(add-hook 'clojure-mode-hook 'coding-hook)
+(add-hook 'clojure-mode-hook 'run-coding-hook)
+(add-hook 'clojure-mode-hook 'idle-highlight)
+
 (font-lock-add-keywords 'clojure-mode
                         '((&quot;(\\|)&quot; . 'esk-paren-face)))
 
@@ -51,13 +54,15 @@
 
 ;;; Scheme
 
-(add-hook 'scheme-mode-hook 'coding-hook)
+(add-hook 'scheme-mode-hook 'run-coding-hook)
+(add-hook 'scheme-mode-hook 'idle-highlight)
 (font-lock-add-keywords 'scheme-mode
 			'((&quot;(\\|)&quot; . 'esk-paren-face)))
 
 ;;; Common Lisp
 
-(add-hook 'lisp-mode-hook 'coding-hook)
+(add-hook 'lisp-mode-hook 'run-coding-hook)
+(add-hook 'lisp-mode-hook 'idle-highlight)
 (font-lock-add-keywords 'lisp-mode
 			'((&quot;(\\|)&quot; . 'esk-paren-face)))
 </diff>
      <filename>starter-kit-lisp.el</filename>
    </modified>
    <modified>
      <diff>@@ -71,6 +71,9 @@
 (add-hook 'text-mode-hook 'turn-on-auto-fill)
 (add-hook 'text-mode-hook 'turn-on-flyspell)
 
+(defvar coding-hook nil
+  &quot;Hook that gets run on activation of any programming mode.&quot;)
+
 (defalias 'yes-or-no-p 'y-or-n-p)
 (random t) ;; Seed the random-number generator
 </diff>
      <filename>starter-kit-misc.el</filename>
    </modified>
    <modified>
      <diff>@@ -52,7 +52,8 @@ exec-to-string command, but it works and seems fast&quot;
              (delete-region (point-min) (point-max))))))
      (ad-activate 'ruby-do-run-w/compilation)))
 
-(add-hook 'ruby-mode-hook 'coding-hook)
+(add-hook 'ruby-mode-hook 'run-coding-hook)
+(add-hook 'ruby-mode-hook 'idle-highlight)
 
 ;;; Flymake
 </diff>
      <filename>starter-kit-ruby.el</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cd73bcef9230c53606bdbdebc2de725c728b71ba</id>
    </parent>
  </parents>
  <author>
    <name>Phil Hagelberg</name>
    <email>technomancy@gmail.com</email>
  </author>
  <url>http://github.com/technomancy/emacs-starter-kit/commit/b2ffdf12fe905fcd0359726efbc217d971e9ca8c</url>
  <id>b2ffdf12fe905fcd0359726efbc217d971e9ca8c</id>
  <committed-date>2009-03-11T10:41:26-07:00</committed-date>
  <authored-date>2009-03-11T10:41:26-07:00</authored-date>
  <message>Make coding-hook a real hook instead of a defun.</message>
  <tree>5d083abf87145249ff77b927d9cd02b3a7359f26</tree>
  <committer>
    <name>Phil Hagelberg</name>
    <email>technomancy@gmail.com</email>
  </committer>
</commit>
