Created
September 25, 2010 12:32
-
-
Save nozma/596791 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(autoload 'js-console "js-console" nil t) | |
(defun js-console-eval-region (start end) | |
"Execute region" | |
(interactive "r") | |
(let ((buf-name (buffer-name (current-buffer)))) | |
(copy-region-as-kill start end) | |
(switch-to-buffer-other-window "*js*") | |
(js-console-exec-input (car kill-ring)) | |
(switch-to-buffer-other-window buf-name))) | |
(defun run-js-console-and-split-window () | |
"Run js-console and split window horizontally." | |
(interactive) | |
(split-window-horizontally) | |
(js-console) | |
(other-window 1) | |
) | |
(add-hook 'js-mode-hook ;; Emacs23用 | |
(lambda () | |
(moz-minor-mode 1) | |
(local-set-key "\C-c\C-j" 'run-js-console-and-split-window) | |
(local-set-key "\C-c\C-r" 'js-console-eval-region) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment