[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

alist for ODF files in archive mode

From: Joe Smith
Subject: alist for ODF files in archive mode
Date: Mon, 22 Oct 2007 13:20:42 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20070727 Fedora/1.1.3-2.fc7 SeaMonkey/1.1.3

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)
(setq auto-coding-alist
      (cons '("\\.o\\(d[bcfm]\\|[dt][gpst]\\|rp\\|xt\\)$" . no-conversion)

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?



[1] I had no luck using odf-mode.el from

[2] See

reply via email to

[Prev in Thread] Current Thread [Next in Thread]