[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval: (search-forward)
From: |
Oliver Scholz |
Subject: |
Re: eval: (search-forward) |
Date: |
Sun, 10 Oct 2004 14:33:54 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (windows-nt) |
Albert Reiner <areiner@tph.tuwien.ac.at> 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é!
- eval: (search-forward), Albert Reiner, 2004/10/09
- Re: eval: (search-forward),
Oliver Scholz <=
- Re: eval: (search-forward), Albert Reiner, 2004/10/10
- Re: eval: (search-forward), Joakim Hove, 2004/10/11
- Re: eval: (search-forward), Albert Reiner, 2004/10/11
- Re: eval: (search-forward), Albert Reiner, 2004/10/12
- Re: eval: (search-forward), Joakim Hove, 2004/10/18
- Re: eval: (search-forward) (Solved), Albert Reiner, 2004/10/24
- Re: eval: (search-forward), Oliver Scholz, 2004/10/11
- Re: eval: (search-forward), Albert Reiner, 2004/10/11