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: [christopher.ian.moore@gmail.com: Emacs very slow opening file] Date: Thu, 29 Sep 2005 15:44:53 -0400 Message-ID: <87achvll8q.fsf-monnier+emacs@gnu.org> References: <20050929095157.GA6233@kenny.sha-bang.local> <20050929123820.GC31770@kenny.sha-bang.local> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128023352 28631 80.91.229.2 (29 Sep 2005 19:49:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Sep 2005 19:49:12 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 29 21:49:03 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EL4O8-0007w7-MN for ged-emacs-devel@m.gmane.org; Thu, 29 Sep 2005 21:48:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EL4O8-0004JJ-3X for ged-emacs-devel@m.gmane.org; Thu, 29 Sep 2005 15:48:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EL4L2-00035x-TE for emacs-devel@gnu.org; Thu, 29 Sep 2005 15:45:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EL4Kx-00032k-Lt for emacs-devel@gnu.org; Thu, 29 Sep 2005 15:45:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EL4Kx-0002q4-AL for emacs-devel@gnu.org; Thu, 29 Sep 2005 15:44:59 -0400 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EL4Kw-0004J6-8a; Thu, 29 Sep 2005 15:44:58 -0400 Original-Received: from alfajor ([67.71.32.13]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050929194454.COVK26967.tomts5-srv.bellnexxia.net@alfajor>; Thu, 29 Sep 2005 15:44:54 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 130B3D7A2D; Thu, 29 Sep 2005 15:44:53 -0400 (EDT) Original-To: Kenichi Handa In-Reply-To: <20050929123820.GC31770@kenny.sha-bang.local> (Sascha Wilde's message of "Thu, 29 Sep 2005 14:38:20 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:43365 Archived-At: >> > So, I would conclude, that there is no bug at all. Emacs can't >> > possibly know, that the "Local Variables:" block isn't meant to be >> > interpreted in the diff file. > [...] >> Perhaps, Emacs has to detect that the file is a patch before >> checking "-*- ... -*-" and "Local Variables". > I don't think that any magical file-type recognition mechanism should > overwrite explicitly stated modes. I completely agree with that, but I do think that the rule for "what is a Local-Variables section" is not strict enough. It'd be good to tighten them, or at least make it possible to tighten them. E.g. major modes could set a "local-variables-prefix-regexp" which the text leading to the "Local Variables" should match. E.g. c-mode could set it to "\\`[ \t]*\\(//\\|/?\\*)[ \t]*\\'" Problem is: in order for this to be useful for the OP, the test should be done *after* using the Local-Variables's section (i.e. after switching to C mode). Still, it doesn't sound unfeasible, and would help reduce the likelihood of mistakenly using a Local-Variables section. Stefan