Guest User

Untitled

a guest
Jan 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1.  
  2. --- coffee-mode.el 2011-09-08 14:52:36.000000000 +0900
  3. +++ my-coffee-mode.el 2011-09-08 14:54:21.000000000 +0900
  4. @@ -99,6 +99,12 @@
  5. :type 'string
  6. :group 'coffee)
  7.  
  8. +(defcustom js2coffee-command "js2coffee"
  9. + "The js2coffee command used for evaluating code. Must be in your
  10. +path."
  11. + :type 'string
  12. + :group 'coffee)
  13. +
  14. (defcustom coffee-args-repl '("-i")
  15. "The command line arguments to pass to `coffee-command' to start a REPL."
  16. :type 'list
  17. @@ -234,6 +240,23 @@
  18. (funcall coffee-js-mode)
  19. (goto-char (point-min)))
  20.  
  21. +
  22. +(defun coffee-js2coffee-region (start end)
  23. + "Compiles a region and displays the JS in another buffer."
  24. + (interactive "r")
  25. +
  26. + (let ((buffer (get-buffer coffee-compiled-buffer-name)))
  27. + (when buffer
  28. + (kill-buffer buffer)))
  29. +
  30. + (call-process-region start end
  31. + js2coffee-command nil
  32. + (current-buffer)
  33. + )
  34. + (delete-region start end)
  35. + )
  36. +
  37. +
  38. (defun coffee-show-version ()
  39. "Prints the `coffee-mode' version."
  40. (interactive)
Add Comment
Please, Sign In to add comment