[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval: (search-forward)
From: |
Albert Reiner |
Subject: |
Re: eval: (search-forward) |
Date: |
11 Oct 2004 12:16:54 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
> 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)
Wonderful, works beautifully!
Thanks,
Albert.