From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Format-alist vs. minor mode Date: Sun, 03 Aug 2008 13:47:16 -0400 Message-ID: References: <20080801104547.GA13337@tomas> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217785662 16362 80.91.229.12 (3 Aug 2008 17:47:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Aug 2008 17:47:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: tomas@tuxteam.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 03 19:48:32 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KPhh2-00048o-4Z for ged-emacs-devel@m.gmane.org; Sun, 03 Aug 2008 19:48:32 +0200 Original-Received: from localhost ([127.0.0.1]:39505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KPhg7-0001UP-86 for ged-emacs-devel@m.gmane.org; Sun, 03 Aug 2008 13:47:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KPhg1-0001RD-OJ for emacs-devel@gnu.org; Sun, 03 Aug 2008 13:47:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KPhfy-0001Jh-Ep for emacs-devel@gnu.org; Sun, 03 Aug 2008 13:47:29 -0400 Original-Received: from [199.232.76.173] (port=32940 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KPhfy-0001JA-2v for emacs-devel@gnu.org; Sun, 03 Aug 2008 13:47:26 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48001) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KPhfx-0006tZ-Q5 for emacs-devel@gnu.org; Sun, 03 Aug 2008 13:47:26 -0400 Original-Received: from ceviche.home (vpn-132-204-232-21.acd.umontreal.ca [132.204.232.21]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id m73HlhCq016828; Sun, 3 Aug 2008 13:47:44 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id AAB37B404F; Sun, 3 Aug 2008 13:47:16 -0400 (EDT) In-Reply-To: <20080801104547.GA13337@tomas> (tomas@tuxteam.de's message of "Fri, 1 Aug 2008 12:45:47 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Level: X-NAI-Spam-Score: 0.5 X-NAI-Spam-Rules: 2 Rules triggered SUBJ_END_DOT_WORDS=0.5, RV3073=0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:101999 Archived-At: > 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[^>]*>[^<]*
" > '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