From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: buffer-local file variables
Date: Thu, 01 Jul 2004 08:59:16 -0600 [thread overview]
Message-ID: <40E426C4.7020809@yahoo.com> (raw)
In-Reply-To: mailman.2744.1088576044.1953.bug-gnu-emacs@gnu.org
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
next parent reply other threads:[~2004-07-01 14:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.2744.1088576044.1953.bug-gnu-emacs@gnu.org>
2004-07-01 14:59 ` Kevin Rodgers [this message]
2004-06-30 6:12 buffer-local file variables naehring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40E426C4.7020809@yahoo.com \
--to=ihs_4664@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).