Is there any differences between the following two ways of invoking a function in the init file.
(add-hook `after-init-hook `turn-on-auto-fill)
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
The main difference is time of evaluation. The former is evaluated after all init files are run, whereas the latter is evaluated immediately.
The advantage of the former is, that you can initialize and require some nice or required stuff before running a command. The disadvantage is, that errors in your init scripts may lead to never firering the after-init-hook and thus never evaluating your command.
You may find more details in the GNU Emacs Lisp Reference for The Init File.