[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval: (search-forward)
From: |
Joakim Hove |
Subject: |
Re: eval: (search-forward) |
Date: |
Mon, 11 Oct 2004 09:59:36 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (gnu/linux) |
Albert Reiner <areiner@tph.tuwien.ac.at> writes:
>> Local Variables:
>> eval: (add-hook 'find-file-hook (lambda () (goto-char (point-min))
>> (search-forward "%%WORK%%")) t t)
>> End:
I thought the hook was called find-file-hooks. The following works for
me: ^
1. Define the local variable work-string (or whatever) *as a
string*, in the relevant file.
2. The following function in .emacs or somewhere:
(defun goto-work ()
(if (boundp 'work-string)
(progn
(goto-char (point-min))
(unless (search-forward work-string (point-max) 't)
(message (format "Could not find \"%s\" in buffer" work-string))))))
3. (add-hook 'find-file-hooks 'goto-work)
Your existing soultion might work by just changin find-file-hook ->
find-file-hooks though.
HTH - Joakim
--
Joakim Hove
hove AT ift uib no
+47 (55 5)8 27 90
http://www.ift.uib.no/~hove/