From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: buffer-local file variables Date: Thu, 01 Jul 2004 08:59:16 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <40E426C4.7020809@yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1088693993 648 80.91.224.253 (1 Jul 2004 14:59:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Jul 2004 14:59:53 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 01 16:59:35 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bg32F-0001sW-00 for ; Thu, 01 Jul 2004 16:59:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bg340-00066x-Uc for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Jul 2004 11:01:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bg33z-00066i-6u for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2004 11:01:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bg33x-00066W-GY for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2004 11:01:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bg33x-00066T-Dp for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2004 11:01:21 -0400 Original-Received: from [130.59.10.2] (helo=chx400.switch.ch) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Bg31r-0002WX-JO for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2004 10:59:12 -0400 Original-Received: from mail.fu-berlin.de ([130.133.1.2]) by chx400.switch.ch with esmtp (Exim 3.20 #1) id 1Bg31q-0005Jr-00 for gnu-emacs-bug@moderators.isc.org; Thu, 01 Jul 2004 16:59:10 +0200 Original-Received: by Mail.FU-Berlin.DE (Exim 4.34) from curry.zedat.fu-berlin.de ([160.45.10.36]) for gnu-emacs-bug@moderators.isc.org with esmtp id <1Bg31p-00071N-DG>; Thu, 01 Jul 2004 16:59:09 +0200 Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.uni-berlin.de with bsmtp id ; Thu, 1 Jul 2004 16:59:09 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 53 X-Orig-X-Trace: news.uni-berlin.de g6GkAoi0Khjf/bZJvnZu8AK0eu+g7AWPvF2gneXYPl8ZhZW3Q= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:8325 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8325 naehring@iee.et.tu-dresden.de wrote: > If `enable-local-variables is set to `t then appearently a newly > loaded text file is searched for the string "local variables:" from > top to bottom. That's not true. Emacs only searches the last (formfeed-separated) page of the buffer for the local variables section. If there are no page separators, it only searches the final 3000 characters. See hack-local-variables in lisp/files.el. > I would consider that as almost a bug. Almost :-) I suggest that the 3000 character limit is too generous, and that 1024 ought to be plenty. > If the main text contains the string "local variables:" (which might > be in a comment of some computer program) then emacs misinterprets > this as the beginning of the in-file declaration of the buffer-local > variables. This, almost certainly induces the error > > File local-variables error: (error "Local variables entry is missing the prefix") If that occurs, you can avoid it by introducing a final empty page. But this workaround is only available if the program (or data) file format allows it. > There are some cries for help about this error in the WWW. Maybe, > those are due to this buggy behaviour. References? > I think text files should be searched for "local variables:" from > bottom up. Then, one can avoid the above error message by inserting an > empty local-variables block at the end of the text file. A "\n\f" (newline-formfeed) sequence is all that is needed -- or 3000 whitespace characters :-) > The only problem left would be some variable setting containing the > string "local variables:". It's only a problem if that string occurs near the end of the buffer, which can usually be worked around. > But in most cases those settings can be done in the first line of the > text file with the help of the -*-...-*- syntax. I thought you were talking about occurrences of "local variables:" in the buffer that should not be parsed by Emacs? -- Kevin Rodgers