[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Format-alist vs. minor mode
From: |
Stefan Monnier |
Subject: |
Re: Format-alist vs. minor mode |
Date: |
Sun, 03 Aug 2008 13:47:16 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
> I'm trying to switch on a minor mode via the format-alist feature, like
> so:
> (add-to-list 'format-alist
> (list "ZEIT-k4c"
> "ZEIT k4 cooked XML"
> "^<\\?xml[^>]*>[^<]*<article>"
> 'am-parse-region
> 'am-unparse-region
> t
> 'am-mode)
> nil
> (lambda (x y) (equal (car x) (car y))))
> It works at first, when the regexp is recognized the mode function is
> called... but then "fundamental-mode" sets in, kills all local variables
> and reverts the minor mode settings.
> What am I doing wrong? Do only major modes work with format-alist?
If the minor mode depends on the file/buffer's contents, then it should
survive a change in major-mode, right? So you might want to make your
minor mode permanent-local.
Stefan