[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval: (search-forward) (Solved)
From: |
Albert Reiner |
Subject: |
Re: eval: (search-forward) (Solved) |
Date: |
24 Oct 2004 18:11:39 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Joakim,
thanks a lot for your reply:
[Joakim Hove <hove@ift.uib.no>, Mon, 18 Oct 2004 09:02:12 +0200]:
> Albert Reiner <areiner@tph.tuwien.ac.at> writes:
>
> > But surprisingly, after the hook is run the boundp test always
> > fails, as if the buffer-local value went away after initialization.
> > Any simple fix?
>
> Maybe; I think local variables defined on the top of the file are
> meant only for the initialization, maybe the go out of scope when the
> initialization is complete. Try putting the relevant string *at the
> bottom* of the file instead:elisp
>
> ;;; Local Variables: ***
> ;;; work-string: ";;; Start here" ***
> ;;; End: ***
>
> Read more about File Variables in (info "(emacs) File Variables").
(The variable settings were already at the end, and the info manual
does not seem to indicate a distinction between those on the top and
those at the bottom of the file.)
All of this turned out to be the result of testing this exclusively
with files in noweb major mode. That mode does some mode changing
depending on where in the file point is, and apparently only those
variables where the permanent-local property is t are visible once
noweb-code-mode or noweb-doc-mode are in effect.
The simple solution is to add (put 'work-string 'permanent-local t) to
the defun; the correct thing would probably be to change noweb-mode.el
so that noweb-make-variable-permanent-local is mapped over all
file-local variables, i.e., to add something like (mapcar
'noweb-make-variable-permanent-local (mapcar 'car
(buffer-local-variables))) to the defun noweb-mode, but I do not
understand noweb-mode.el enough to know whether this is safe.
Thanks again for taking the time to answer,
Albert.