edit-current-field-in-external-editor: better file extensions for temp files
Since edit-current-field-in-external-editor now supports external editing
of richedit fields, whose contents are html, the previous system of always
giving the temp file an extension of "txt" is no longer adequate. This
patch makes the command choose the default extension based on the mime
type being edited, but also provides a user variable that can be used to
override these choices.
This patch contains two breaking changes:
* variable edit_field_in_external_editor_extension has been removed, and
superseded by a mime-type table external_editor_extension_overrides
which maps mime types to extensions. If you previously used this
variable to set the temp file extension to "foo", for example, you
would update your rc to do the following instead:
external_editor_extension_overrides.set("text/plain", "foo");
* function get_filename_for_current_textfield has been superseded by
external_editor_make_base_filename, which takes as its arguments the
root element being edited and the top document of the buffer containing
the element. The top document is more useful than the element's own
ownerDocument in some cases, such as when about:blank is used for the
document of an editable iframe. The new function returns only the base
filename, with no extension, as the extension is generated by means
described above.