Permalink
Browse files

Use mode configured for .js files for compiled JS buffers.

  • Loading branch information...
1 parent 5703337 commit f687d8cc0b507c1553d215bb7ae7d7185ca127f8 @rrthomas rrthomas committed May 8, 2012
Showing with 2 additions and 17 deletions.
  1. +1 −11 README.md
  2. +1 −6 coffee-mode.el
View
@@ -172,8 +172,7 @@ line, so you can investigate. If this annoys you, you can set
Compiles the current buffer to JavaScript using the command specified
by the `coffee-command` variable and opens the contents in a new
-buffer using your JavaScript mode of choice. The JavaScript mode is
-determined by the `coffee-js-mode` variable and defaults to `js2-mode`.
+buffer using the mode configured for ".js" files.
Bind it:
@@ -219,9 +218,6 @@ Naturally. Example:
(make-local-variable 'tab-width)
(set 'tab-width 2)
- ;; If you don't have js2-mode
- (setq coffee-js-mode 'javascript-mode)
-
;; If you don't want your compiled files to be wrapped
(setq coffee-args-compile '("-c" "--bare"))
@@ -246,12 +242,6 @@ customize-group` with "coffee" as the group.
You can also customize then with `coffee-mode-hook`, as demonstrated
above.
-### coffee-js-mode
-
-The mode to use when viewing compiled JavaScript.
-
-Default: `'js2-mode`
-
### coffee-tab-width
The tab width to use when indenting.
View
@@ -73,11 +73,6 @@
"A CoffeeScript major mode."
:group 'languages)
-(defcustom coffee-js-mode 'js2-mode
- "The mode to use when viewing compiled JavaScript."
- :type 'string
- :group 'coffee)
-
(defcustom coffee-tab-width tab-width
"The tab width to use when indenting."
:type 'integer
@@ -191,7 +186,7 @@ If FILENAME is omitted, the current buffer's file name is used."
nil)
(append coffee-args-compile (list "-s" "-p")))
(switch-to-buffer (get-buffer coffee-compiled-buffer-name))
- (funcall coffee-js-mode)
+ (let ((buffer-file-name) "tmp.js") (set-auto-mode))
(goto-char (point-min)))
(defun coffee-js2coffee-replace-region (start end)

0 comments on commit f687d8c

Please sign in to comment.