changeset 104978:a4c2188bd87d

* startup.el (tutorial-directory): Make it a defcustom. Use custom-initialize-delay rather than eval-at-startup to set it. * image.el (image-load-path): Make it a defcustom. Use custom-initialize-delay rather than eval-at-startup to set it. * subr.el (eval-at-startup): Remove. * font-lock.el (lisp-font-lock-keywords-2): Remove eval-at-startup.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 12 Sep 2009 03:55:46 +0000
parents 1e1816f211ce
children c545eaa5edad
files lisp/ChangeLog lisp/font-lock.el lisp/image.el lisp/startup.el lisp/subr.el
diffstat 5 files changed, 20 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Sep 12 03:35:40 2009 +0000
+++ b/lisp/ChangeLog	Sat Sep 12 03:55:46 2009 +0000
@@ -1,5 +1,12 @@
 2009-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* startup.el (tutorial-directory): Make it a defcustom.
+	Use custom-initialize-delay rather than eval-at-startup to set it.
+	* image.el (image-load-path): Make it a defcustom.
+	Use custom-initialize-delay rather than eval-at-startup to set it.
+	* subr.el (eval-at-startup): Remove.
+	* font-lock.el (lisp-font-lock-keywords-2): Remove eval-at-startup.
+
 	* subr.el (do-after-load-evaluation): Warn the user after loading an
 	obsolete package.
 
--- a/lisp/font-lock.el	Sat Sep 12 03:35:40 2009 +0000
+++ b/lisp/font-lock.el	Sat Sep 12 03:55:46 2009 +0000
@@ -2265,7 +2265,7 @@
 		 "save-match-data" "save-current-buffer"
 		 "unwind-protect" "condition-case" "track-mouse"
 		 "eval-after-load" "eval-and-compile" "eval-when-compile"
-		 "eval-when" "eval-at-startup" "eval-next-after-load"
+		 "eval-when" "eval-next-after-load"
 		 "with-case-table" "with-category-table"
 		 "with-current-buffer" "with-electric-help"
 		 "with-local-quit" "with-no-warnings"
--- a/lisp/image.el	Sat Sep 12 03:35:40 2009 +0000
+++ b/lisp/image.el	Sat Sep 12 03:55:46 2009 +0000
@@ -98,18 +98,17 @@
  - maybe  auto-detect only if the image type is available
 	    (see `image-type-available-p').")
 
-(defvar image-load-path nil
+(defcustom image-load-path
+  (list (file-name-as-directory (expand-file-name "images" data-directory))
+        'data-directory 'load-path)
   "List of locations in which to search for image files.
 If an element is a string, it defines a directory to search.
 If an element is a variable symbol whose value is a string, that
 value defines a directory to search.
 If an element is a variable symbol whose value is a list, the
-value is used as a list of directories to search.")
-
-(eval-at-startup
- (setq image-load-path
-       (list (file-name-as-directory (expand-file-name "images" data-directory))
-	     'data-directory 'load-path)))
+value is used as a list of directories to search."
+  :type '(repeat (choice directory variable))
+  :initialize 'custom-initialize-delay)
 
 
 (defun image-load-path-for-library (library image &optional path no-error)
--- a/lisp/startup.el	Sat Sep 12 03:35:40 2009 +0000
+++ b/lisp/startup.el	Sat Sep 12 03:55:46 2009 +0000
@@ -388,13 +388,12 @@
 Warning Warning!!!  Pure space overflow    !!!Warning Warning
 \(See the node Pure Storage in the Lisp manual for details.)\n")
 
-(defvar tutorial-directory nil
-  "Directory containing the Emacs TUTORIAL files.")
-
-;; Get correct value in a dumped, installed Emacs.
-(eval-at-startup
- (setq tutorial-directory (file-name-as-directory
-                           (expand-file-name "tutorials" data-directory))))
+(defcustom tutorial-directory
+  (file-name-as-directory (expand-file-name "tutorials" data-directory))
+  "Directory containing the Emacs TUTORIAL files."
+  :group 'installation
+  :type 'directory
+  :initialize 'custom-initialize-delay)
 
 (defun normal-top-level-add-subdirs-to-load-path ()
   "Add all subdirectories of current directory to `load-path'.
--- a/lisp/subr.el	Sat Sep 12 03:35:40 2009 +0000
+++ b/lisp/subr.el	Sat Sep 12 03:55:46 2009 +0000
@@ -1591,22 +1591,6 @@
 
 ;;;; 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."
-  `(progn
-     (if command-line-processed
-	 (progn . ,body)
-       (add-hook 'before-init-hook
-		 '(lambda () ,(concat "From " (or load-file-name "no file"))
-		    . ,body)
-		 t))
-     nil))
-
 (defun load-history-regexp (file)
   "Form a regexp to find FILE in `load-history'.
 FILE, a string, is described in the function `eval-after-load'."