From 45448e641a75f56a010396d664491dafe5c6d85a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 12 Sep 2009 03:55:46 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 7 +++++++ lisp/font-lock.el | 2 +- lisp/image.el | 13 ++++++------- lisp/startup.el | 13 ++++++------- lisp/subr.el | 16 ---------------- 5 files changed, 20 insertions(+), 31 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 33d7ca2f3ea..ac9426aebe7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2009-09-12 Stefan Monnier + * 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. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 07d06c7b9c2..4d8198292f8 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2265,7 +2265,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and "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" diff --git a/lisp/image.el b/lisp/image.el index 92e7560a9ca..e2f4977ed10 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -98,18 +98,17 @@ AUTODETECT can be - 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) diff --git a/lisp/startup.el b/lisp/startup.el index fcb35b95f02..5d5f23e4453 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -388,13 +388,12 @@ from being initialized." 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'. diff --git a/lisp/subr.el b/lisp/subr.el index d42382d15d3..85a74183a8d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1591,22 +1591,6 @@ and the file name is displayed in the echo area." ;;;; 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'." -- 2.39.2