help-gnu-emacs
[Top][All Lists]
Advanced

[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:1.8.1.5) 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)
            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





reply via email to

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