Commit adbe2d11 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(eval-at-startup): New macro.

parent 55f77e1c
......@@ -1322,7 +1322,23 @@ definition only or variable definition only.
;;;; Specifying things to do after certain files are loaded.
;;;; Specifying things to do later.
(defmacro eval-at-startup (&rest body)
"Make arrangements to evaluate BODY when Emacs starts up.
If this is run after Emacs startup, evaluate BODY immediately.
Always returns nil.
This works by adding a function to `before-init-hook'.
That function's doc string says which file created it."
(if command-line-processed
(progn . ,body)
(add-hook 'before-init-hook
'(lambda () ,(concat "From " (or load-file-name "no file"))
. ,body)
(defun eval-after-load (file form)
"Arrange that, if FILE is ever loaded, FORM will be run at that time.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment