-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[suggestion] Evaluate JavaScript with node.js / io.js #483
Comments
I used to have something like this in my last setup with js-comint. I was going add something like this once I had time to look in to other options. |
PR welcome. There are conventions for such actions: https://github.com/syl20bnr/spacemacs/blob/master/doc/CONVENTIONS.md#interactions-with-repls |
I have never done any LISP before, im still learning. Ill definitely make a PR once i have something worth sharing. |
Checkout swankjs too. |
Wow. A video of swank! :) https://m.youtube.com/watch?v=qwtVtcQQfqc |
Thats just amazing! We really need to get that included in JS layer! |
Skewer seems to have solved some usability issues with live coding in a browser, but I can't find anything about node.js/io.js REPL support. Slime on the other hand seems like it is really good for nodejs/io.js, but the CSS/HTML eval is dreadful. It would probably be best to have both available, but mixing them will likely be problematic. |
Why has nobody done work on this?...I mean I'm not demanding, just am curious :) |
I have tried but failed, as I just suck at Lisp, and also am very new to the Emacs ecosystem. The solutions out there seems very big (swank) as it seems to be connected to the browser (via sockets) too. I would like to (start) with something very basic/minimal, im very fond of how to alchemist package evaluates your Elixir code and prints it to the buffer, as a comment. For now i have been using this to eval my buffer.
The snippet is from SO, http://stackoverflow.com/questions/19743105/how-to-evaluate-javascript-buffer-by-node-js-from-within-emacs-on-windows It prints the result in a new buffer. Theres a lot of room for improvement, and i have some ideas and have been reading the source for the alchemist package to get a better understanding of how it works. |
As a javascript/node developer, I really disappointed this hasn't been resolved despite being old and much in demand.. |
@v3ctr0n The latest master now has skewer-mode included. |
@stormpat how do I evaluate node.js code in the skewer repl? |
Wow, I feel like I am retracing the steps of this issue. I am okay with a little LISP not strong yet on emacs ecosystem. Came over to spacemacs for everything I can but I am hitting the same wall here. |
@InvisibleTech @ghost If you want a more traditional REPL you could try https://melpa.org/#/nodejs-repl |
Thanks @stormpat but my issue is twofold, I use spacemacs (not the issue IMO :-) ) and so it seems to have rules of engagement. I tried to add use of noderepl-js setting up site-lisp to contain the required folder with some code used to tell "normal" Emacs how to do the Node REPL. Issue seemed to be spacemacs ignored it. So I would have to then install it use emacs commands. I think it had to be done every restart - don't recall. I tried (just hacking without knowing) to reference the file from the layers list and since it wasn't a proper layer.. rejected. I am an emacs/spacemacs newb... so what do I do to "install" your suggested file? |
Heres something to get you started: First add the package to your .spacemacs file. The restart emacs to install Optional: Add some keybindings for easier use Note. The You can start the repl with You will get this: |
What don't we have node.js REPL in the layer ? Is it just because nobody submitted it or is there any other issue ? |
I'm not entirely sure..
…On 02/12/2017 07:51 AM, Sylvain Benner wrote:
What don't we have node.js REPL in the layer ? Is it just because nobody
submitted it or is there any other issue ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#483 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABaMAjvyudSELrjPP59dtMCiOzx-Lw4ks5rbwBSgaJpZM4DXZw0>.
|
@syl20bnr indeed, there is no Node REPL support in the layer at the moment. What makes this issue challenging is the fact that we need support for two different REPLs in most cases, within a single project, in the same major mode
We need a way to define which set of REPL bindings should be activated for a given file within a project. So that conventional leader keybindigs like Maybe the layer should provide some file/dir-local vars to define which REPL to use. Any hints on how to properly implement this in Spacemacs are welcome. |
Is there a spacemacs convention for handling the case where two packages provide the same functionality and then allow the user to configure it by some variable? I am currently using nodejs-repl with my spacemacs config, but I just overwrite all the skewer stuff in my user-config. If there is a convention or example of this I will try implementing what I have in the js layer. |
I would be in favor of a flag personally.
…On 03/14/2017 05:32 PM, Zack wrote:
Is there a spacemacs convention for handling the case where two
packages provide the same functionality and then allow the user to
configure it by some variable? I am currently using nodejs-repl with
my spacemacs config, but I just overwrite all the skewer stuff in my
user-config. If there is a convention or example of this I will try
implementing what I have in the js layer.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#483 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABaMKgPJ-HMBFsS1iaXWzFVTKxjlddyks5rlweGgaJpZM4DXZw0>.
|
Here's something people can do while they wait for this to be properly integrated into the javascript layer. (Thanks to @stormpat for the example above.) https://github.com/abicky/nodejs-repl.el/wiki/Spacemacs-Configuration |
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (syl20bnr#483).
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (syl20bnr#483).
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (syl20bnr#483).
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (syl20bnr#483).
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (#483).
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (syl20bnr/spacemacs#483).
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (syl20bnr#483).
Add relevant keybindings and documentation, including a setting `js2-include-node-externs` as a configuration variable for those that intend to use `Spacemacs` for node projects, as it currently seems to be mostly aimed at pure JS (syl20bnr#483).
It would be really cool if you could eval a buffer with node or io.js. This should be a part of the JavaScript contrib layer. Even better, if there was a way to evaluate just a block instead of the entire buffer.
There is bindings in the clojure layer to eval a region or buffer, so i was thinking of something similar.
The text was updated successfully, but these errors were encountered: