deno-repl.el 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ;;; deno-repl-options.el
  2. ;;; Version - 1.0.0
  3. ;;; Author - Nalin Ranjan
  4. (require 'comint)
  5. (require 'deno-repl-options)
  6. ;; (defvar deno-repl-mode nil "")
  7. (defconst deno-repl-buffer-name "deno-repl")
  8. (defconst deno-repl-mode-name "deno/repl")
  9. (defvar deno-repl-mode-map
  10. (let ((repl-key-map (nconc
  11. (make-sparse-keymap)
  12. comint-mode-map)))
  13. ;; example definition
  14. (define-key repl-key-map "\t" 'completion-at-point)
  15. repl-key-map)
  16. "Basic mode map for `deno-repl-mode'")
  17. (define-derived-mode deno-repl-mode comint-mode
  18. deno-repl-mode-name
  19. "A major mode for deno repl"
  20. :group 'deno
  21. )
  22. (defun deno-repl ()
  23. "command to launch a deno repl"
  24. (interactive)
  25. (let*
  26. ((repl-buffer (get-buffer-create deno-repl-buffer-name)))
  27. (with-current-buffer repl-buffer
  28. (deno-repl-mode)
  29. ;; (set major-mode 'deno-repl-mode)
  30. (goto-char (point-max))
  31. ;; (insert "Hello! We are making such a good progress!!!")
  32. )
  33. (switch-to-buffer repl-buffer)))
  34. (let
  35. ((repl-options (make-deno-repl-options
  36. ;; :config " "
  37. ;; :log-level " "
  38. ;; :lock " asdf"
  39. ;; :cert "asdf "
  40. ;; :eval "console.log(\"Hello\") "
  41. ;; :import-map " tu hai wahi "
  42. ;; :location " href "
  43. ;; :cached-only t
  44. ;; :compat t
  45. ;; :help t
  46. ;; :lock-write t
  47. ;; :no-remote t
  48. ;; :quiet t
  49. ;; :unstable t
  50. ;; :seed 123
  51. )))
  52. (deno-repl-command repl-options)
  53. ;; (run-deno-repl
  54. ;; (deno-repl-command repl-options))
  55. )
  56. (provide 'deno-repl)