help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Local variables not being defined


From: Kevin Rodgers
Subject: Re: Local variables not being defined
Date: Tue, 30 Jan 2007 22:34:30 -0700
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

ken wrote:

On 01/25/2007 05:22 PM somebody named Harald Hanche-Olsen wrote:
+ ken <gebser@speakeasy.net>:

....

I am looking at the code now (the function in question is called
hack-local-variables, and it is found in files.el), and there should
be no way you are going to see that message unless there is something
in front of the string "Local Variables:" on the line.

Oh, wait, one more wild guess.  hack-local-variables goes 3000
characters back from the end of the file and searches forward for
"Local Variables:".  Don't tell me your HTML file contains another
instance of that phrase?

Thanks, Harald.  You have very good eyes to see across continent and
ocean.  I titled my test document so:

<h1 align=center>Testing the Use of Local&nbsp;Variables in....

Replacing a SPACE with "&nbsp;" made the errors cease.  (I was frankly
surprised that the (uppercase) 'V' and absence of the colon after
"Variables" didn't distinguish this text enough from the intended
instance.  Perhaps a later version has/will.)

hack-local-variables only goes back to the last newline or formfeed
character, to a maximum of 3000 characters.  So the recommended practice
is to precede the local variables section with a page break (control-L,
usually on a line by itself).

And hack-local-variables does search for the exact "Local Variables:"
string, so should not have found an occurrence with a lower case `v' and
missing colon:

        (when (let ((case-fold-search t))
                (search-forward "Local Variables:" nil t))
          (skip-chars-forward " \t")
...

So perhaps you've got a locally hacked version of hack-local-variables...

So, another dark obscure code corner illuminated, good karma created.

Let's hope!

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]