all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tomas@tuxteam.de
Cc: emacs-devel@gnu.org
Subject: Format-alist vs. minor mode
Date: Fri, 1 Aug 2008 12:45:47 +0200	[thread overview]
Message-ID: <20080801104547.GA13337@tomas> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

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?

Thanks
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIkulbBcgs9XrR2kYRAgpvAJ9LsoGl/L1YyyKxrQhkL1HHkEAIlgCfR6tn
ivpezzABebPH9+j4I1+eTsU=
=7Gd0
-----END PGP SIGNATURE-----




             reply	other threads:[~2008-08-01 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-01 10:45 tomas [this message]
2008-08-01 12:26 ` Format-alist vs. minor mode martin rudalics
2008-08-01 13:17   ` tomas
2008-08-03 17:47 ` Stefan Monnier
2008-08-03 18:01   ` tomas
2008-08-04 19:02     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080801104547.GA13337@tomas \
    --to=tomas@tuxteam.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.