From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: [christopher.ian.moore@gmail.com: Emacs very slow opening file] Date: Sun, 02 Oct 2005 23:22:43 +0300 Organization: JURTA Message-ID: <87y85bzvdo.fsf@jurta.org> References: <20050929095157.GA6233@kenny.sha-bang.local> <20050930074317.GA6249@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 1128292531 13898 80.91.229.2 (2 Oct 2005 22:35:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 Oct 2005 22:35:31 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 03 00:35:30 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMCPZ-0001Bz-G5 for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 00:34:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMCPY-0000iz-Vi for ged-emacs-devel@m.gmane.org; Sun, 02 Oct 2005 18:34:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EMCP9-0000dc-H5 for emacs-devel@gnu.org; Sun, 02 Oct 2005 18:33:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EMCP5-0000bT-HK for emacs-devel@gnu.org; Sun, 02 Oct 2005 18:33:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMCP5-0000Z3-EW for emacs-devel@gnu.org; Sun, 02 Oct 2005 18:33:55 -0400 Original-Received: from [194.126.101.123] (helo=HOT-Bounce1.hot.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EMCGT-0004iM-JS; Sun, 02 Oct 2005 18:25:01 -0400 Original-Received: from mail.neti.ee (Relay4 [192.168.1.23]) by HOT-Bounce1.hot.ee (Postfix) with ESMTP id B26B417F2E9; Mon, 3 Oct 2005 01:07:35 +0300 (EEST) Original-Received: from mail.neti.ee (80-235-42-225-dsl.mus.estpak.ee [80.235.42.225]) by Relayhost1.neti.ee (Postfix) with ESMTP id 05E171812; Mon, 3 Oct 2005 01:24:38 +0300 (EEST) Original-To: "Richard M. Stallman" In-Reply-To: <20050930074317.GA6249@kenny.sha-bang.local> (Sascha Wilde's message of "Fri, 30 Sep 2005 09:43:17 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:43475 Archived-At: >> One idea is to restrict what strings can be used as the "prefix" >> in a local variables list, so that local variables lists in diff output >> are not obeyed. > > I'm afraid it won't be that easy. Typical prefix chars in diffs are > "-", "+" and "!" most (all?) of them are used for comments in some > languages (eg. Ada, Postscript). Even worse: context lines aren't > prefixed at all. One quite reliable solution is to store the original values of prefix/suffix strings in the Local Variables section by adding new variables `local-variables-prefix' and `local-variables-suffix', e.g.: -/* Local Variables: */ -/* local-variables-prefix:"/* " */ -/* local-variables-suffix:" */" */ -/* mode:c */ -/* eval:(load-library "time-stamp") */ -/* eval:(make-local-variable 'write-file-hooks) */ -/* eval:(add-hook 'write-file-hooks 'time-stamp) */ -/* End: */ That way `hack-local-variables' could treat these variables specially: by extracting their values from the Local Variables section, and testing if they match the real prefix and suffix around the `Local Variables:'. So the Local Variables section in the example above wouldn't be interpreted, because the value of `local-variables-prefix' ("/* ") is not the same as the prefix "-/* " in the diff file. Of course, this wouldn't work with existing Local-Variables sections, but for new sections adding these special variables would be easy with a new command (from etc/TODO) that will make a local variables section and write the values of `local-variables-prefix' and `local-variables-suffix' automatically. -- Juri Linkov http://www.jurta.org/emacs/