Difference between revisions of "Edit with Emacs"

From WikEmacs
Jump to navigation Jump to search
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Package
+
Noted on [[Emacs as a web browser's external editor]].
|name=Edit with Emacs
+
 
|description=Edit text areas via Chrom(ium) browsers
+
'''Edit with Emacs''' is extension for the Google Chrome web browser, that lets you edit text areas on a web page with Emacs.
|maintainer=Alex Bennée
 
|source=https://github.com/stsquad/emacs_chrome
 
}}
 
'''Edit with Emacs''' is extension to chrome, that you can edit testarea on your webpage with Emacs.
 
  
 
== How It Works ==
 
== How It Works ==
 
* install '''Edit with Emacs''' on your chrome
 
* install '''Edit with Emacs''' on your chrome
* download edit-server.el to your computer
+
* download [[edit-server.el]] to your computer (bundled with extension)
 
* add following line to .emacs
 
* add following line to .emacs
 
<source lang="lisp">
 
<source lang="lisp">
(add-to-list 'load-path "/where/your/edit-server.el/is")
+
(add-to-list 'load-path "/path/to/edit-server.el/")
 
(require 'edit-server)
 
(require 'edit-server)
 
(edit-server-start)
 
(edit-server-start)
 
</source>
 
</source>
* run your emacs as a server as "emacs --daemon"
+
* It's recommended to run your emacs as a server as "emacs --daemon" although the edit-server will happily run in a long-running emacs just as well.
 
* your will find a button at the bottom of textarea when you browse the webpage
 
* your will find a button at the bottom of textarea when you browse the webpage
 
* when you press the button a emacs frame will show up, with text already in the textarea
 
* when you press the button a emacs frame will show up, with text already in the textarea
 
* when you have done, press c-c c-c as "edit-server-done" to update your change to the textarea
 
* when you have done, press c-c c-c as "edit-server-done" to update your change to the textarea
* '''Warning''' When you edit textarea, it is likely your change your major mode to [[mediawiki-mode]] or other [[major mode]], this will likely bound the c-c c-c to other commmand, then you should use m-x "edit-server-done"
+
* '''Warning''' When you edit textarea, it is likely your change your major mode to [[mediawiki-mode]] or other [[major mode]], this will likely bound the c-c c-c to other commmand, then you should use m-x "edit-server-done" - this should be fixed in the latest v1.11
 +
* [[edit-server.el]] is also available in MELPA
  
 
== Mechanism ==
 
== Mechanism ==
Line 27: Line 24:
  
  
Noted on [[Emacs as a browser's external editor]].
+
[[Category:Third Party Package]]
 +
[[Category:Ubiquitous Emacs]]
 +
[[Category:Browser Support]]

Latest revision as of 10:47, 17 December 2012

Noted on Emacs as a web browser's external editor.

Edit with Emacs is extension for the Google Chrome web browser, that lets you edit text areas on a web page with Emacs.

How It Works

  • install Edit with Emacs on your chrome
  • download edit-server.el to your computer (bundled with extension)
  • add following line to .emacs
(add-to-list 'load-path "/path/to/edit-server.el/")
(require 'edit-server)
(edit-server-start)
  • It's recommended to run your emacs as a server as "emacs --daemon" although the edit-server will happily run in a long-running emacs just as well.
  • your will find a button at the bottom of textarea when you browse the webpage
  • when you press the button a emacs frame will show up, with text already in the textarea
  • when you have done, press c-c c-c as "edit-server-done" to update your change to the textarea
  • Warning When you edit textarea, it is likely your change your major mode to mediawiki-mode or other major mode, this will likely bound the c-c c-c to other commmand, then you should use m-x "edit-server-done" - this should be fixed in the latest v1.11
  • edit-server.el is also available in MELPA

Mechanism

Chrome extension Edit with Emacs uses its own Edit Server rather than Emacsclient because Chrome's security policy does not allow extensions to spawn new processes. The extension allows the user to edit text in Emacs and send the results to the browser textarea with [C-x #] (or M-x edit-server-done).