README 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. The edit command is sent as an HTTP POST request. After the headers
  32. the data is the current contents of the text area.
  33. Once the edit is complete the server sends an HTTP 200 (OK) response
  34. with the data containing the new text area text. Any other response
  35. will result in the text area not being updated.
  36. The extension also sets some headers which may be used by the edit
  37. servers to create more identifiable names for the buffers/temp files
  38. to help the user keep track.
  39. x-url: The URL of the source page
  40. x-id: The unique (on the page) ID of the text area
  41. * status
  42. The status command is sent as an HTTP GET request. The intention is to
  43. use it as a simple test for the status of Edit Server and to be used
  44. as a "Are you there?" test.
  45. The response is basically a text string describing the state of the
  46. edit server.