Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!uwvax!oddjob!matt
From: matt@oddjob.UChicago.EDU (I am not a Grook)
Newsgroups: comp.emacs
Subject: Re: Modifying point automatically on editing file 'x'
Message-ID: <3882@oddjob.UChicago.EDU>
Date: Mon, 13-Jul-87 21:57:19 EDT
Article-I.D.: oddjob.3882
Posted: Mon Jul 13 21:57:19 1987
Date-Received: Wed, 15-Jul-87 01:28:03 EDT
References: <8707131938.AA05076@ncifcrf.ncifcrf.uucp>
Reply-To: matt@oddjob.uchicago.edu (I am not a Grook)
Organization: Backwards R Us
Lines: 38

Randy T. F. Smith (RTFS?) writes:
)   I want to have point moved to a specific point within a file
) automatically upon editing the given file.  I thought I could
) do this through a modification of auto-mode-alist, ...
) However, point is at the beginning of the buffer, not the end
) of the first line.

)   Checking the source (files.el) indicate the the
)   auto-mode-alist function is called after the file is found,
)   so it's not a simple case of manipulating point on an empty
)   scratch buffer.

Check more closely ... All the work of auto-modes is done by
after-find-file which is called from inside a (save-excursion ...).
I had a similar problem trying to get my c-mode-hook to do a
(setq case-fold-search nil).  The hooks were run from inside a
(let ((case-fold-search t)) ...).  I sent this in as a bug and
it was change many releases ago.

There is a reason for the save-excursion in find-file-noselect
(the contents may be read in again if the buffer exists and the
file has been altered on disk), but I don't see that the reason
extends to protecting the call to after-find-file.

There's another save-excursion inside set-auto-mode which is
needed because that function searches for a -*-MODENAME-*- in
the buffer.  A little rearrangement can bring the line
	  (funcall (intern (concat (downcase mode) "-mode")))
and the subsequent scan of auto-mode-alist outside of the
save-excursion.

I think that the above changes should be made.  I'm sure some
FSF GNUmaster is watching.  Taking care of a local "variable" of
"mode" or "eval" I leave as an exercise for said master!
________________________________________________________
Matt	     University		matt@oddjob.uchicago.edu
Crawford     of Chicago          {hao,ihnp4}!oddjob!matt
	Yow!  I threw up on my window!