On Thu, Dec 30, 2010 at 11:00:21AM -0600, Benjamin Slade wrote:
> On 30 December 2010 10:47, John J. Foerch <[email protected]> wrote:
>
> On Tue, Dec 28, 2010 at 01:38:42PM -0600, Benjamin Slade wrote:
> > Emacs html-helper-mode is nice for editing rich formatted messages.
> However, I
> > don't seem to be summon the external editor in my Gmail messages: I get
> the
> > message "Element is not a text field". Is there a way to add an
> exception for
> > Gmail so that that rich formatted messages can be edited in the external
> > editor? (I was used to be able to do this with Pentadactyl/Vimperator).
>
>
> Give this a whirl.. Also, to anybody else reading this mailing list, help
> in testing would be much appreciated. If I succeeded in not breaking
> anything, then I'll patch the program with this change after a short
> period of testing.
>
>
>
>
> Thanks, John. It seems to work: I'm writing this message via Gmail in my
> external editor.
> I'll keep an eye out to see if it breaks anything.
>
> [off-topic question: does anyone know if there's a way to set up the external
> editor call assignment in such a way that it makes Emacs start in
> html-helper-mode?]
>
> --B.
The direct answer to your question might look something like this:
///in conkeror
edit_field_in_external_editor_extension = "xxx";
;;;in emacs
(defun choose-mode-for-conkeror-external-editing-file (&rest args)
(save-excursion
(goto-char (point-min))
(apply
(cond
((looking-at "\\s-*<") 'html-helper-mode)
(t 'text-mode))
args)))
(add-to-list 'auto-mode-alist '("\\.xxx\\'" .
choose-mode-for-conkeror-external-editing-file))
But I don't think that's the best way to approach this problem. It really
_is_ an on-topic question, because, since we are adding the ability to
externally edit html content to Conkeror, it makes sense that Conkeror
should be smarter about choosing file extensions for external-editor temp
files. We need a way to have Conkeror continue to use "txt" for input
boxes and textareas, but "html" for richedit fields. If Conkeror could do
that, then Emacs is already equipt to do the rest with a much simpler
auto-mode-alist config than I gave above.
The way that we choose also needs to be configurable, and (I predict)
extensible for the future. I will think on this problem. It will
probably involve replacing edit_field_in_external_editor_extension with
something that can be set to a function, instead of just a single string.
--
John Foerch
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror