unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* alist for ODF files in archive mode
@ 2007-10-22 17:20 Joe Smith
  0 siblings, 0 replies; only message in thread
From: Joe Smith @ 2007-10-22 17:20 UTC (permalink / raw)
  To: help-gnu-emacs

I see there has been some discussion of how emacs might be used to edit 
ODF documents, however even without a special mode for ODF[1], emacs is 
quite useful out of the box, simply by opening the ODF document in 
standard archive mode. From there, you can easily open/edit/save the XML 
files, or view images, without any further customization.

Unfortunately, the standard auto- alists do not have a pattern 
recognizing all the ODF file names[2]. Here's the setting I get using 
Emacs 22.1.1 (Fedora 7 package):

("\\.\\(sx[dmicw]\\|odt\\)\\'" . archive-mode)

So only .odt files (and the old pre-ODF XML formats) are opened as archives.

Here's what I've cobbled up:

;; Add ODF extensions for archive mode
(setq auto-mode-alist
       (cons '("\\.o\\(d[bcfm]\\|[dt][gpst]\\|rp\\|xt\\)$" . archive-mode)
	    auto-mode-alist))
(setq auto-coding-alist
       (cons '("\\.o\\(d[bcfm]\\|[dt][gpst]\\|rp\\|xt\\)$" . no-conversion)
	    auto-coding-alist))

It seems to work, but I know just enough to get into trouble, so any 
suggestions would be appreciated.

If appropriate, could this (or something better) be added to the 
standard emacs configuration, so that emacs would do something helpful 
with ODF files right out of the box?

Thanks!

<Joe

[1] I had no luck using odf-mode.el from
http://www.cb1.com/~john/computing/emacs/lisp/editing/odf-mode.el

[2] See 
http://framework.openoffice.org/documentation/mimetypes/mimetypes.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-22 17:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-22 17:20 alist for ODF files in archive mode Joe Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).