From xemacs-m  Mon Apr 14 20:45:28 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id UAA19330
	for <xemacs-beta@xemacs.org>; Mon, 14 Apr 1997 20:45:27 -0500 (CDT)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id SAA08489;
	Mon, 14 Apr 1997 18:58:15 -0700
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: outline-mode is working in tty-only mode, but...
References: <199704140842.JAA08227@wrath.parallax.co.uk>
X-Url: http://www.miranova.com/%7Esteve/
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: andyp@parallax.co.uk's message of Mon, 14 Apr 1997 09:42:39 +0100
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
Date: 14 Apr 1997 18:58:12 -0700
Message-ID: <m2zpv1gi8a.fsf@altair.xemacs.org>
Lines: 42
X-Mailer: Gnus v5.4.45/XEmacs 20.1

Andy Piper <andyp@parallax.co.uk> writes:

> There is another annoying bug with this stuff in that the glyphs get loaded
> twice (look at emacs News for an example). I tried to fix this once but 
> the bug is deep in find-file (I think) involves some interaction with
> mode variables and you could break all sorts of stuff by fixing it.

`enable-local-variables' isn't respected.  If you have it set to t as
is the default, local variables always get executed twice.  See the
comments in `set-auto-mode' which discuss deliberately calling the hack
local variable stuff but disabling it the first time through.

You can verify this by loading NEWS with C-h n after doing (setq
enable-local-variables nil).  `view-emacs-news' merely does a
find-file on it, and expects the local variables in the file to Do
The Right Thing.

This patch fixes this bug.  Comments?

Index: lisp/prim/files.el
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/lisp/prim/files.el,v
retrieving revision 1.8
diff -u -r1.8 files.el
--- files.el	1997/03/28 02:28:59	1.8
+++ files.el	1997/04/15 01:44:45
@@ -1474,8 +1474,9 @@
 	      (val (cdr (car result))))
 	  (cond ((eq key 'mode)
 		 (setq mode-p t)
-		 (funcall (intern (concat (downcase (symbol-name val))
-					  "-mode"))))
+		 (and enable-local-variables
+		      (funcall (intern (concat (downcase (symbol-name val))
+					       "-mode")))))
 		(set-any-p
 		 (hack-one-local-variable key val))
 		(t

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

