README 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Servers
  2. =======
  3. Because the Chrome(ium) security model doesn't allow for extensions
  4. spawning processes we can't just exec() the editor process. Instead we
  5. have to implement an "edit server" which listens to XmlHttp requests
  6. on port 9292 (default) and then sends a response when the edit is
  7. complete. We include a couple here:
  8. * pycl.py - Original version, only edit one file at a time
  9. * edit_server.el - An native Emacs Lisp implementation
  10. There is another project called TextAid which does a similar thing to
  11. Edit with Emacs. It's edit server is implemented in perl and be found
  12. at:
  13. * http://opencoder.net/edit-server
  14. As the edit server concept is fairly simple we will try and keep them
  15. compatible with each other.
  16. Customizing the look of Emacs
  17. =============================
  18. By default, Emacs opens up a new frame upon an edit request. All the
  19. UI elements are removed to better mimic a bare text box. You can
  20. customize the default behavior by `M-x customize-group [RET]
  21. edit-server [RET]`. Or you can set the variables' values directly in
  22. your ~/.emacs.
  23. How it works
  24. ============
  25. The browser sends a request to the edit server of the form:
  26. http://${HOSTNAME}:${HOSTPORT}/${CMD}
  27. HOSTNAME is usually localhost, i.e. 127.0.0.1
  28. HOSTPORT is the server port, in our case defaults to 9292
  29. CMD is the command to the edit server, it may be one of the following:
  30. * edit
  31. Optional parameters: ?id=${ID}&url=${URL}
  32. The edit command is sent as an HTTP POST request. After the headers
  33. the data is the current contents of the text area.
  34. Once the edit is complete the server sends an HTTP 200 (OK) response
  35. with the data containing the new text area text. Any other response
  36. will result in the text area not being updated.
  37. The optional URL allows the edit server to create more identifiable
  38. names for the buffers/temp files to help the user keep track.
  39. * status
  40. The status command is sent as an HTTP GET request. The intention is to
  41. use it as a simple test for the status of Edit Server and to be used
  42. as a "Are you there?" test.
  43. The response is basically a text string describing the state of the
  44. edit server.