The Fellowship / Fellows / ciaran / Ciarán's free software notes / Launching your favourite editor in Firefox

Launching your favourite editor in Firefox

After a bit of tweaking, I'm now happily using the the It's All Text! plugin to let me to edit webpage text boxes with Emacs. It also works with other text editors. [UPDATE: Actually, my browser is Iceweasel, not Firefox. See the Mozilla software rebranding article on Wikipedia, and the IceCat project]

To configure it, go to Tools->It's All Text!->Preferences in Firefox's menu bar. In the editor field, when I added some command line options to make Emacs start quickly, it gave me the error "Unable to open your editor". So I made a "quickmacs.sh" file and told It's All Text that that that was my editor. In quickmacs.sh, I put:

#!/bin/sh
gnome-terminal -t "QM $1" -e "emacs -nw -Q --load ~/software/tb.el $1"

The second "$1" is essential. I want Emacs in non-gui mode, so it has to be launched by a terminal program because It's All Text! doesn't run the given editor command in a terminal. tb.el is a a cut down version of my emacs.el. It just contains the minimal convenience settings I want for editing textboxes:

(transient-mark-mode t)
(show-paren-mode t)
(menu-bar-mode 0)
(defun ciaran-turn-on-french-input-method ()
   "set the input method to French"
   (interactive)
   (set-input-method "french-alt-postfix"))
(global-set-key [?\C-c ?.] 'ciaran-turn-on-french-input-method)
(longlines-mode t)

There were two other interesting plugins. The first is EmbeddedEditor 0.1, but you have to make an account and log in if you want to download it, so I ignored it. The second is Firemacs, but that's adding some Emacs features to Firefox - I prefer to have a full Emacs.

-- 
Ciarán O'Riordan,
Support free software: Join FSFE's Fellowship

This document is in public domain

Comentarios

hmmm

@gerloff: Strange. I copy and pasted your command and I got vim in a gnome-terminal. There's a gremlin somewhere. It also works when I do:

xterm -e '/usr/bin/vim'

Trying that might tell you if it's a vim or a gnome-terminal problem. Typing "alias" at the command line would also show if either command is already redefined in some way. That could mess things up, maybe. Happy debugging :-)

no joy there

@ciaran: the line

gnome-terminal -e '/usr/bin/vim'

doesn't work for me for some reason. I've had the same problem
with the Plone external editor thing before.

Gvim works fine in both cases.

gnome-terminal -e

@gerloff: If you give it a command, it doesn't automatically run a shell for the command. That's why my command to launch emacs is inside quotes after gnome-terminal -e. The -nw switch to emacs is to get the non-gui version.

cool tool

Thanks Ciaran for pointing me to this! I'm writing this comment in
gvim -- but only because I haven't figured out how to tell the
tool to open a shell and start vim inside it. (Hints appreciated)

Either way, this is so much better than the clumsy web editors that
blight our digital lives.

Btw, Plone offers an "edit with external application" thing, but
that needs to be installed server-side -- not much use if you
can't persuade the admin to do it.

Log in or join the Fellowship to post comments.



Right menu

Fellow Events

<< Octubre 2008 >>
Mon Tue Wed Thu Fri Sat Sun
  1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 
Selected Day Today


FSFE Card


DRM.info
© FSFE