The statements in the set-auto-mode function are wrapped entirely in a
save-excursion which overrides any other major-mode hooks from setting
point location (e.g. post-mode setting point after email headers). In
comparison, the set-mode-function in emacs 20 is broken into two
sections, one wrapped in save-excursion for locating the proper mode,
and a non-wrapped section for executing the modes which allows hooks
to set the point.
In the emacs files.el look for:
;; If we found modes to use, invoke them now,
;; outside the save-excursion.
to see the example.
Today is my first day working with emacs lisp, so I don't trust my
patching ability.
-JSP
Show replies by date