>> (add-hook 'MAJOR-MODE-hook
>> (lambda ()
>> (set (make-local-variable 'VAR) VAL)))
> I wonder when this is used and when this:
> (eval-after-load 'MAJOR_MODE (setq VAR VAL))
Your code will be run once when loading the `MAJOR_MODE' package
(i.e. usually the first time `MAJOR_MODE' is used), whereas the code
I quoted is run every time `MAJOR-MODE' is enabled.
If you use Emacs for a single file at a time, the difference between the
two may be unnoticeable. But if you do use several files in the same
Emacs session (which is the normal way to use Emacs), then the
difference is important.
Stefan