4 ms·
Ask HN: How would you make Emacs do this?
For a long while now I've only used two applications almost all the time - a web browser, and Emacs. For reasons I can't quite explain but feel strongly about, I'd love to get that down to just one.
So I have the idea of being able to have a web site that's actually just a gateway to an Emacs instance running on one of my servers.
I don't have a problem imagining how I might do the web app itself - it would probably use html/javascript for presentation, and then a small piece of Flash code to give me a real tcp socket that I can use to talk to Emacs. No problem - I can do these kinds of things easily.
It would be useful to open and save-to local files in addition to ones already on the server. Again, using a little bit of Flash 10, I can make that happen easily.
Now the frontend needs to tell Emacs, via this socket, whenever the user presses a key. And Emacs in turn needs to tell the web app to update the display. I could easily decide on a simple socket protocol for these things.
But on the backend I don't have much idea at all - I've modified my own .emacs a bunch, but I've never actually hacked Emacs.
Does anyone have any pointers? Should I model this after an existing display toolkit (like motiff, gtk, etc)? Or would a different approach work better? Should I start writing this in ELisp, or am I very likely to actually need to drop down to C for some reason?
- jimm 16y agoHow about the opposite: browse the Web from within Emacs? http://www.emacswiki.org/emacs/emacs-w3m http://www.emacswiki.org/emacs/emacs-w3m [Edit: link to W3M, not the older W3]
- silentbicycle 16y agoI don't see why it would really be beneficial - People who want to connect with a remote Emacs session just use ssh + screen or tmux, which is stable and quick to set up. If you really want to implement Emacs-over-the-web, though, familiarity with these might help: distel - distributed elisp, via integration with Erlang (http://fresh.homeunix.net/~luke/distel/ http://fresh.homeunix.net/~luke/distel/) TRAMP - remote file editing (See e.g. http://www.emacswiki.org/emacs/TrampMode http://www.emacswiki.org/emacs/TrampMode) Also, there are decent web browsers for Emacs. I like emacs-w3m. (http://emacs-w3m.namazu.org/ http://emacs-w3m.namazu.org/)
- j_baker 16y agoFor editing remote files, I find that sshfs is extremely useful: http://en.wikipedia.org/wiki/SSHFS http://en.wikipedia.org/wiki/SSHFS
- abstractbill 16y agoTo clarify, I don't have a problem editing remote files - I use TRAMP right now (haven't tried sshfs, but it looks interesting thanks!). The problem I'm trying to solve is that right now I need to install Emacs on any computer I want to do work on. I'd like to be able to jump onto a random friend's laptop and open Emacs without any setup cost.
- njn 16y agoI like sshfs as well, but it seems to perform even slower than scp for me, and way slower than ssh.
- icey 16y agoHmm. Perhaps one of these would make a decent starting point? http://antony.lesuisse.org/software/ajaxterm/ http://antony.lesuisse.org/software/ajaxterm/ http://anyterm.org/ http://anyterm.org/ http://testape.com/webtty_sample.php http://testape.com/webtty_sample.php
- positr0nic 16y agoHow about something like this? http://nomachine.com/web-player.php http://nomachine.com/web-player.php Saving files locally might not be straight forward though.
- marcmarc 16y agoYou can control Firefox from emacs using MozRepl. This extension allows you execute code on the browser. For example, you can tell emacs to refresh a specific tab when an html file is saved. MozRepl is not the only extension doing that. There are 4 or 5 similar projects. More info http://www.emacswiki.org/emacs/MozRepl http://www.emacswiki.org/emacs/MozRepl
- ianb 16y agoI've been thinking about this too (http://blog.ianbicking.org/2010/05/04/browser-desktop-developer-tools/ http://blog.ianbicking.org/2010/05/04/browser-desktop-develo...) -- but I figured I'd just let go of Emacs in the process, presumably to replace it with Bespin: http://mozillalabs.com/bespin http://mozillalabs.com/bespin -- it is purported to have some Emacs keybindings (I haven't been able to enable them though).
- simplify 16y agoI think it would be useful as, say, a chrome plugin. A hotkey to open up a new emacs tab right next to my webpage tabs would be nice.
- tonyarkles 16y agoYou could look at Web Sockets (http://en.wikipedia.org/wiki/Web_Sockets http://en.wikipedia.org/wiki/Web_Sockets). I know Chrome supports it, not sure about other browsers. A friend made a very cool interactive multi-user app using this and was quite impressed at the responsiveness.