Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make a single hook that gets run from whichever javascript mode is used

  • Loading branch information...
commit 05390ef8b23f16525ad4e06abe1431dc15025942 1 parent b7bce7b
@stesla authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 starter-kit-js.el
View
8 starter-kit-js.el
@@ -5,6 +5,10 @@
;; NB: js-mode is part of Emacs since version 23.2 (with an alias
;; javascript-mode). It is derived and updated from Espresso mode.
+(defvar esk-js-mode-hook nil)
+(defun run-esk-js-mode-hook ()
+ (run-hooks 'esk-js-mode-hook))
+
(defmacro esk-configure-javascript (name)
(let ((sym (intern name))
(mode (intern (concat name "-mode")))
@@ -18,7 +22,8 @@
(add-hook ',hook 'moz-minor-mode)
(add-hook ',hook 'esk-paredit-nonlisp)
(add-hook ',hook 'run-coding-hook)
- (add-hook ',hook 'pretty-functions) (setq ,indent 2)
+ (add-hook ',hook 'run-esk-js-mode-hook)
+ (setq ,indent 2)
(eval-after-load ',sym
'(progn (define-key ,keymap "{" 'paredit-open-curly)
@@ -31,6 +36,7 @@
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "ƒ")
nil))))))
+(add-hook 'esk-js-mode-hook 'pretty-functions)
(if (< (string-to-number emacs-version) 23.2)
(esk-configure-javascript "espresso")
Please sign in to comment.
Something went wrong with that request. Please try again.