Skip to content
Browse files

Switch to using prog-mode-hook instead of our own coding-hook.

  • Loading branch information...
1 parent 9801445 commit 8967c61cd4f94e457199f60c3d322e76f0bdb766 @technomancy committed May 19, 2011
Showing with 15 additions and 19 deletions.
  1. +0 −1 languages/starter-kit-js.el
  2. +0 −1 languages/starter-kit-lisp.el
  3. +0 −1 languages/starter-kit-ruby.el
  4. +13 −13 starter-kit-defuns.el
  5. +2 −3 starter-kit-misc.el
View
1 languages/starter-kit-js.el
@@ -45,7 +45,6 @@
'(progn (define-key js-mode-map "{" 'paredit-open-curly)
(define-key js-mode-map "}" 'paredit-close-curly-and-newline)
(add-hook 'js-mode-hook 'esk-paredit-nonlisp)
- (add-hook 'js-mode-hook 'run-coding-hook)
(setq js-indent-level 2)
;; fixes problem with pretty function font-lock
(define-key js-mode-map (kbd ",") 'self-insert-command)
View
1 languages/starter-kit-lisp.el
@@ -76,7 +76,6 @@
(when (> (display-color-cells) 8)
(font-lock-add-keywords (intern (concat (symbol-name mode) "-mode"))
'(("(\\|)" . 'esk-paren-face))))
- (add-hook (intern (concat (symbol-name mode) "-mode-hook")) 'esk-run-coding-hook)
(add-hook (intern (concat (symbol-name mode) "-mode-hook")) 'esk-turn-on-paredit)
(add-hook (intern (concat (symbol-name mode) "-mode-hook"))
'esk-turn-on-paredit))
View
1 languages/starter-kit-ruby.el
@@ -92,7 +92,6 @@ exec-to-string command, but it works and seems fast"
(delete-region (point-min) (point-max))))))
(ad-activate 'ruby-do-run-w/compilation)))
- (add-hook 'ruby-mode-hook 'esk-run-coding-hook)
(add-hook 'ruby-mode-hook 'esk-paredit-nonlisp)
;; Rinari (Minor Mode for Ruby On Rails)
View
26 starter-kit-defuns.el
@@ -62,7 +62,7 @@ imenu index, then jumps to that symbol's location."
(imenu--make-index-alist) 'imenu--subalist-p))))
(cdr (assoc (ido-completing-read "Symbol: " (mapcar 'car lst)) lst)))))
-;;; These belong in coding-hook:
+;;; These belong in prog-mode-hook:
;; We have a number of turn-on-* functions since it's advised that lambda
;; functions not go in hooks. Repeatedly evaling an add-to-list with a
@@ -90,6 +90,9 @@ imenu index, then jumps to that symbol's location."
(defun esk-turn-on-paredit ()
(paredit-mode t))
+(defun esk-turn-on-idle-highlight-mode ()
+ (idle-highlight-mode t))
+
(defun esk-pretty-lambdas ()
(font-lock-add-keywords
nil `(("(?\\(lambda\\>\\)"
@@ -99,20 +102,16 @@ imenu index, then jumps to that symbol's location."
(defun esk-add-watchwords ()
(font-lock-add-keywords
- nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):"
+ nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\|NOCOMMIT\\)"
1 font-lock-warning-face t))))
-(add-hook 'esk-coding-hook 'esk-local-column-number-mode)
-(add-hook 'esk-coding-hook 'esk-local-comment-auto-fill)
-(add-hook 'esk-coding-hook 'esk-turn-on-hl-line-mode)
-(add-hook 'esk-coding-hook 'esk-turn-on-save-place-mode)
-(add-hook 'esk-coding-hook 'esk-pretty-lambdas)
-(add-hook 'esk-coding-hook 'esk-add-watchwords)
-(add-hook 'esk-coding-hook 'idle-highlight)
-
-(defun esk-run-coding-hook ()
- "Enable things that are convenient across all coding buffers."
- (run-hooks 'esk-coding-hook))
+(add-hook 'prog-mode-hook 'esk-local-column-number-mode)
+(add-hook 'prog-mode-hook 'esk-local-comment-auto-fill)
+(add-hook 'prog-mode-hook 'esk-turn-on-hl-line-mode)
+(add-hook 'prog-mode-hook 'esk-turn-on-save-place-mode)
+(add-hook 'prog-mode-hook 'esk-pretty-lambdas)
+(add-hook 'prog-mode-hook 'esk-add-watchwords)
+(add-hook 'prog-mode-hook 'esk-turn-on-idle-highlight-mode)
(defun esk-turn-off-tool-bar ()
(tool-bar-mode -1))
@@ -180,6 +179,7 @@ imenu index, then jumps to that symbol's location."
(defun esk-paredit-nonlisp ()
"Turn on paredit mode for non-lisps."
+ (interactive)
(set (make-local-variable 'paredit-space-for-delimiter-predicates)
'((lambda (endp delimiter) nil)))
(paredit-mode 1))
View
5 starter-kit-misc.el
@@ -87,6 +87,7 @@
(ido-mode t)
(setq ido-enable-prefix nil
ido-enable-flex-matching t
+ ido-auto-merge-work-directories-length nil
ido-create-new-buffer 'always
ido-use-filename-at-point 'guess
ido-max-prospects 10))
@@ -98,10 +99,8 @@
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook 'turn-on-flyspell)
-(defvar esk-coding-hook nil
- "Hook that gets run on activation of any programming mode.")
-
(defalias 'yes-or-no-p 'y-or-n-p)
+(defalias 'auto-tail-revert-mode 'tail-mode)
(random t) ;; Seed the random-number generator

0 comments on commit 8967c61

Please sign in to comment.
Something went wrong with that request. Please try again.