From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: eval: (search-forward) Date: Sun, 10 Oct 2004 14:33:54 +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=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1097411903 31845 80.91.229.6 (10 Oct 2004 12:38:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Oct 2004 12:38:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 10 14:38:12 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 1CGcxn-0002Mi-00 for ; Sun, 10 Oct 2004 14:38:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGd4g-00039G-Ig for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Oct 2004 08:45:19 -0400 Original-Newsgroups: gnu.emacs.help X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6; Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:Yc6xanCah4b69MEQskR1fhcGX68= Original-NNTP-Posting-Host: 84.57.26.223 Original-X-Trace: 10 Oct 2004 14:33:56 +0200, 84.57.26.223 Original-Lines: 33 Original-X-Complaints-To: abuse@arcor-ip.de Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-ip.de!news.arcor-ip.de!84.57.26.223 Original-Xref: shelby.stanford.edu gnu.emacs.help:125808 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:21173 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21173 Albert Reiner writes: > Hi, > > I am working with a file that gets carried around a lot, changes names > etc., so that I (think I) cannot use bookmarks to mark the place where > I was working. So instead I put some mark, e.g., `%%WORK%%' into the > file at the position where I want to go on working. Instead of doing > C-s % % W O R K % % every time I open the document, I wanted to have > this done automatically. My attempt was to use the file local > variables section with an entry > > eval: (search-forward "%%WORK%%") > > When I open the file, I am asked whether I want to evaluate the > `eval', but still I do not end up at the marked position. > > Any clarifications on why that does not work, and on how to make it > work, would be most welcome! At the time the form is evaluated, the buffer is narrowed to the local variables section. That's all there is to it. Try this: Local Variables: eval: (add-hook 'find-file-hook (lambda () (goto-char (point-min)) (search-forward "%%WORK%%")) t t) End: Oliver -- 19 Vendémiaire an 213 de la Révolution Liberté, Egalité, Fraternité!