From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Albert Reiner Newsgroups: gmane.emacs.help Subject: Re: eval: (search-forward) (Solved) Date: 24 Oct 2004 18:11:39 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098634956 12443 80.91.229.6 (24 Oct 2004 16:22:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Oct 2004 16:22:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 24 18:22:25 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 1CLl8T-0007sY-00 for ; Sun, 24 Oct 2004 18:22:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLlG4-0006Ks-Mw for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Oct 2004 12:30:16 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!news.tele.dk!news.tele.dk!small.news.tele.dk!uio.no!quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: berry.phys.ntnu.no Original-X-Trace: quimby.gnus.org 1098634299 25534 129.241.48.91 (24 Oct 2004 16:11:39 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Sun, 24 Oct 2004 16:11:39 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:126038 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21416 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21416 Joakim, thanks a lot for your reply: [Joakim Hove , Mon, 18 Oct 2004 09:02:12 +0200]: > Albert Reiner 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.