changeset 776:79940b592197

[xemacs-hg @ 2002-03-15 07:43:14 by ben] .cvsignore: ignore .tmp files that are getting auto-created by VC. Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). alloc.c, emacs.c, lisp.h: add new -no-packages. make sure list of args for sorting is actually correct. clean up arg parsing code. xemacs.mak: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). Makefile: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). mule\chinese.el, mule\japan-util.el: fix warnings. behavior-defs.el: fix errors with require. bytecomp-runtime.el: add new funs {when,and}-{f}boundp, clean up docs. cus-edit.el: pretty-print values. dump-paths.el, find-paths.el, startup.el, setup-paths.el: fix problems/inconsistencies parsing options. support new -no-packages option. merge code duplication in dump-paths and startup. lisp-mode.el: indent macrolet and labels correctly. update comments about lisp-indent-function. flet already handled in cl. apropos.el, auto-save.el, buff-menu.el, cl-extra.el, dragdrop.el, faces.el, files.el, fill.el, font-lock.el, font.el, gtk-faces.el, gui.el, help.el, hyper-apropos.el, info.el, isearch-mode.el, keymap.el, lisp-mnt.el, mouse.el, package-admin.el, package-get.el, printer.el, process.el, resize-minibuffer.el, simple.el, toolbar-items.el, wid-edit.el, win32-native.el: fix warnings. very-early-lisp.el: update docs. mule\chinese.el, mule\japan-util.el: fix warnings. mule\chinese.el, mule\japan-util.el: fix warnings. behavior-defs.el: fix errors with require. bytecomp-runtime.el: add new funs {when,and}-{f}boundp, clean up docs. cus-edit.el: pretty-print values. dump-paths.el, find-paths.el, startup.el, setup-paths.el: fix problems/inconsistencies parsing options. support new -no-packages option. merge code duplication in dump-paths and startup. lisp-mode.el: indent macrolet and labels correctly. update comments about lisp-indent-function. flet already handled in cl. apropos.el, auto-save.el, buff-menu.el, cl-extra.el, dragdrop.el, faces.el, files.el, fill.el, font-lock.el, font.el, gtk-faces.el, gui.el, help.el, hyper-apropos.el, info.el, isearch-mode.el, keymap.el, lisp-mnt.el, mouse.el, package-admin.el, package-get.el, printer.el, process.el, resize-minibuffer.el, simple.el, toolbar-items.el, wid-edit.el, win32-native.el: fix warnings. very-early-lisp.el: update docs. mule\chinese.el, mule\japan-util.el: fix warnings. Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs).
author ben
date Fri, 15 Mar 2002 07:43:43 +0000
parents 7d972c3de90a
children e65d9cf16707
files ChangeLog Makefile.in.in lib-src/ChangeLog lib-src/Makefile.in.in lisp/ChangeLog lisp/apropos.el lisp/auto-save.el lisp/behavior-defs.el lisp/buff-menu.el lisp/bytecomp-runtime.el lisp/cl-extra.el lisp/cus-edit.el lisp/dragdrop.el lisp/dump-paths.el lisp/faces.el lisp/files.el lisp/fill.el lisp/find-paths.el lisp/font-lock.el lisp/font.el lisp/gtk-faces.el lisp/gui.el lisp/help.el lisp/hyper-apropos.el lisp/info.el lisp/isearch-mode.el lisp/keymap.el lisp/lisp-mnt.el lisp/lisp-mode.el lisp/mouse.el lisp/mule/chinese.el lisp/mule/japan-util.el lisp/package-admin.el lisp/package-get.el lisp/printer.el lisp/process.el lisp/resize-minibuffer.el lisp/setup-paths.el lisp/simple.el lisp/startup.el lisp/toolbar-items.el lisp/very-early-lisp.el lisp/wid-edit.el lisp/win32-native.el man/ChangeLog man/Makefile nt/ChangeLog nt/xemacs.mak src/.cvsignore src/ChangeLog src/Makefile.in.in src/alloc.c src/emacs.c src/lisp.h
diffstat 54 files changed, 759 insertions(+), 464 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Mar 14 11:50:17 2002 +0000
+++ b/ChangeLog	Fri Mar 15 07:43:43 2002 +0000
@@ -1,6 +1,16 @@
+2002-03-15  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in (batch):
+	* Makefile.in.in (batch_packages):
+	* Makefile.in.in (finder):
+	* Makefile.in.in (check-features):
+	* Makefile.in.in (install):
+	Use -no-packages to avoid problems with package files shadowing
+	core files (e.g. unicode.el in mule-ucs).
+
 2002-03-12  Ben Wing  <ben@xemacs.org>
 
-	* The Great Mule Merge: placeholder.
+	* The Great Mule Merge: See CHANGES-ben-mule.
 
 2002-03-05  Stephen J. Turnbull  <stephen@xemacs.org>
 
--- a/Makefile.in.in	Thu Mar 14 11:50:17 2002 +0000
+++ b/Makefile.in.in	Fri Mar 15 07:43:43 2002 +0000
@@ -278,10 +278,13 @@
 depend ${srcdir}/src/depend:
 	cd ./src && $(RECURSIVE_MAKE) depend
 
+batch = -no-packages -batch
+batch_packages = -vanilla -batch
+
 ## Build XEmacs and recompile out-of-date and missing .elc files along
 ## the way.
 all-elc all-elcs: lib-src lwlib dump-elcs src
-	${blddir}/src/${PROGNAME} -batch -vanilla \
+	${blddir}/src/${PROGNAME} ${batch} \
 		-l update-elc-2.el -f batch-update-elc-2 lisp
 
 ## Sub-target for all-elc.
@@ -291,7 +294,7 @@
 finder: src
 	@echo "Building finder database ..."
 	@(cd ./lisp; \
-		${blddir}/src/${PROGNAME} -batch -vanilla \
+		${blddir}/src/${PROGNAME} ${batch} \
 		-eval '(setq finder-compile-keywords-quiet t)' \
 		-l finder -f finder-compile-keywords )
 	@echo "Building finder database ...(done)"
@@ -299,7 +302,7 @@
 lisp/finder-inf.el:
 	@echo "Building finder database ..."
 	@(cd ./lisp; \
-		${blddir}/src/${PROGNAME} -batch -vanilla \
+		${blddir}/src/${PROGNAME} ${batch} \
 		-eval '(setq finder-compile-keywords-quiet t)' \
 		-l finder -f finder-compile-keywords )
 	@echo "Building finder database ...(done)"
@@ -384,7 +387,7 @@
 ## all.  --cet
 
 check-features: all
-	${blddir}/src/${PROGNAME} -batch -l check-features.el
+	${blddir}/src/${PROGNAME} ${batch} -l check-features.el
 
 install-only: ${MAKE_SUBDIR} check-features install-arch-dep install-arch-indep
 
--- a/lib-src/ChangeLog	Thu Mar 14 11:50:17 2002 +0000
+++ b/lib-src/ChangeLog	Fri Mar 15 07:43:43 2002 +0000
@@ -1,3 +1,10 @@
+2002-03-15  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in (blessmail):
+	* Makefile.in.in (maybe-blessmail):
+	Use -no-packages to avoid problems with package files shadowing
+	core files (e.g. unicode.el in mule-ucs).
+
 2002-03-12  Ben Wing  <ben@xemacs.org>
 
 	* The Great Mule Merge: placeholder.
--- a/lib-src/Makefile.in.in	Thu Mar 14 11:50:17 2002 +0000
+++ b/lib-src/Makefile.in.in	Fri Mar 15 07:43:43 2002 +0000
@@ -207,7 +207,7 @@
 #define MOVEMAIL_NEEDS_BLESSING
 blessmail = blessmail
 blessmail:
-	../src/xemacs -batch -l ../lisp/blessmail.el
+	../src/xemacs -batch -no-packages -l ../lisp/blessmail.el
 	chmod +x $@
 #endif /* movemail needs blessing */
 
--- a/lisp/ChangeLog	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/ChangeLog	Fri Mar 15 07:43:43 2002 +0000
@@ -1,3 +1,111 @@
+2002-03-15  Ben Wing  <ben@xemacs.org>
+
+	* mule\chinese.el:
+	* mule\chinese.el (post-read-decode-hz):
+	* mule\chinese.el (pre-write-encode-hz):
+	* mule\japan-util.el (japanese-katakana-region):
+	* mule\japan-util.el (japanese-hiragana-region):
+	* mule\japan-util.el (japanese-zenkaku-region):
+	fix warnings.
+
+2002-03-15  Ben Wing  <ben@xemacs.org>
+
+	* behavior-defs.el (func-menu):
+	* behavior-defs.el (filladapt):
+	fix errors with require.
+	
+	* bytecomp-runtime.el:
+	* bytecomp-runtime.el (with-boundp):
+	* bytecomp-runtime.el (if-boundp):
+	* bytecomp-runtime.el (when-boundp):
+	* bytecomp-runtime.el (and-boundp): New.
+	* bytecomp-runtime.el (declare-boundp):
+	* bytecomp-runtime.el (globally-declare-boundp):
+	* bytecomp-runtime.el (with-fboundp):
+	* bytecomp-runtime.el (if-fboundp):
+	* bytecomp-runtime.el (when-fboundp):
+	* bytecomp-runtime.el (and-fboundp): New.
+	* bytecomp-runtime.el (declare-fboundp):
+	* bytecomp-runtime.el (globally-declare-fboundp):
+	* bytecomp-runtime.el (with-byte-compiler-warnings-suppressed):
+	add new funs {when,and}-{f}boundp, clean up docs.
+
+	* cus-edit.el (custom-save-variables):
+	pretty-print values.
+	
+	* dump-paths.el:
+	* dump-paths.el (startup-setup-paths): New.
+	* find-paths.el:
+	* startup.el (command-switch-alist):
+	* startup.el (command-line-do-help):
+	* startup.el (normal-top-level):
+	* startup.el (command-line-early):
+	* startup.el (command-line):
+	* startup.el (startup-find-roots-warning):
+	* startup.el (startup-setup-paths): Removed.
+	* startup.el (startup-load-autoloads):
+	* setup-paths.el:
+	fix problems/inconsistencies parsing options.  support new
+	-no-packages option.  merge code duplication in dump-paths and
+	startup.
+
+	* lisp-mode.el:
+	* lisp-mode.el (lisp-indent-function):
+	* lisp-mode.el (while):
+	indent macrolet and labels correctly.  update comments about
+	lisp-indent-function.  flet already handled in cl.
+	
+	* apropos.el (apropos-safe-documentation):
+	* auto-save.el (make-auto-save-file-name):
+	* buff-menu.el (default-list-buffers-identification):
+	* cl-extra.el (cl-map-intervals):
+	* dragdrop.el (experimental-dragdrop-drop-url-default):
+	* faces.el ((color '(red green blue yellow))):
+	* files.el (recover-session):
+	* files.el (file-remote-p):
+	* fill.el (find-space-insertable-point):
+	* font-lock.el (font-lock-thing-lock-cleanup):
+	* font-lock.el (font-lock-after-fontify-buffer):
+	* font.el (font-blink-initialize):
+	* gtk-faces.el (*try-oblique-before-italic-fonts*): Removed.
+	* gtk-faces.el (try-oblique-before-italic-fonts): New.
+	* gtk-faces.el ('*try-oblique-before-italic-fonts*): New.
+	* gtk-faces.el (gtk-make-font-italic):
+	* gtk-faces.el (gtk-make-font-bold-italic):
+	* gui.el (insert-gui-button):
+	* help.el (xemacs-www-page):
+	* help.el (xemacs-www-faq):
+	* hyper-apropos.el (hyper-apropos-find-function):
+	* hyper-apropos.el (hyper-apropos-find-variable):
+	* info.el (Info-find-node):
+	* isearch-mode.el (isearch-help-or-delete-char):
+	* keymap.el (kbd):
+	* lisp-mnt.el (lm-report-bug):
+	* mouse.el (mouse-eval-sexp):
+	* package-admin.el (package-admin-check-manifest):
+	* package-get.el (package-get-update-base-from-buffer):
+	* package-get.el (package-get-staging-dir):
+	* printer.el (generic-print-region):
+	* process.el (shell-command):
+	* process.el (shell-quote-argument):
+	* resize-minibuffer.el (resize-minibuffer-setup):
+	* simple.el (sendmail-user-agent-compose):
+	* toolbar-items.el (toolbar-paste):
+	* toolbar-items.el (toolbar-ispell-internal):
+	* toolbar-items.el (toolbar-compile):
+	* toolbar-items.el (toolbar-gnus):
+	* wid-edit.el (widget-before-change):
+	* wid-edit.el (widget-after-change):
+	* wid-edit.el (widget-url-link-action):
+	* win32-native.el (grep-null-device):
+	* win32-native.el (grep-null-device)): New.
+	* win32-native.el (grep-regexp-alist):
+	* win32-native.el (grep-regexp-alist)): New.
+	* win32-native.el (mswindows-system-shells):
+	fix warnings.
+
+	* very-early-lisp.el: update docs.
+
 2002-03-14  Ville Skyttä  <ville.skytta@xemacs.org>
 
 	* files.el (auto-mode-alist): GNUmakefile is a Makefile,
--- a/lisp/apropos.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/apropos.el	Fri Mar 15 07:43:43 2002 +0000
@@ -466,7 +466,7 @@
       (setq function (cdr function)))
   ;; XEmacs change from: (setq function (if (byte-code-function-p function)
   (setq function (if (compiled-function-p function)
-		     (if (fboundp 'compiled-function-doc-string)
+		     (if-fboundp 'compiled-function-doc-string
 			 (compiled-function-doc-string function)
 		       (if (> (length function) 4)
 			   (aref function 4)))
--- a/lisp/auto-save.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/auto-save.el	Fri Mar 15 07:43:43 2002 +0000
@@ -280,9 +280,9 @@
 			   ;; (to become non-dir part of filename) will
 			   ;; be escaped twice.  Don't care.
 			   (auto-save-escape-name (buffer-name))))
-	    (remote-p (and (stringp file-name)
-			   (fboundp 'efs-ftp-path)
-			   (efs-ftp-path file-name))))
+	    (remote-p (and-fboundp 'efs-ftp-path
+			(stringp file-name)
+			(efs-ftp-path file-name))))
 	;; Return the appropriate auto save file name:
 	(expand-file-name;; a buffername needs this, a filename not
 	 (cond (remote-p
--- a/lisp/behavior-defs.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/behavior-defs.el	Fri Mar 15 07:43:43 2002 +0000
@@ -275,8 +275,6 @@
   :disable #'(lambda ()
 	       (resize-minibuffer-mode -1)))
 
-(eval-when-compile (require 'func-menu))
-
 (define-behavior 'func-menu
   "Suppose you have a file with a lot of functions in it. Well, this
 package makes it easy to jump to any of those functions. The names of
@@ -474,7 +472,6 @@
   :short-doc "`Recent Files' menu"
   :enable 'recent-files-initialize)
 
-(eval-when-compile (require 'filladapt))
 (define-behavior 'filladapt
   "These functions enhance the default behavior of Emacs' Auto Fill
 mode and the commands `fill-paragraph', `lisp-fill-paragraph',
--- a/lisp/buff-menu.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/buff-menu.el	Fri Mar 15 07:43:43 2002 +0000
@@ -509,8 +509,8 @@
 (defun default-list-buffers-identification (output)
   (save-excursion
     (let ((file (or (buffer-file-name (current-buffer))
-		    (and (boundp 'list-buffers-directory)
-			 list-buffers-directory)))
+		    (and-boundp 'list-buffers-directory
+		      list-buffers-directory)))
 	  (size (buffer-size))
 	  (mode mode-name)
 	  eob p s col)
--- a/lisp/bytecomp-runtime.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/bytecomp-runtime.el	Fri Mar 15 07:43:43 2002 +0000
@@ -210,8 +210,12 @@
 compiling this file, the warnings `reference to free variable VARIABLE' and
 `assignment to free variable VARIABLE' will not occur anywhere in BODY, for
 any of the listed variables.  This is a clean way to avoid such warnings.
-See also `declare-boundp', `if-boundp', `when-boundp', and
-`globally-declare-boundp'."
+
+See also `if-boundp', `when-boundp', and `and-boundp' (ways to
+conditionalize on a variable being bound and avoid warnings),
+`declare-boundp' (issue a variable call without warnings), and
+`globally-declare-boundp' (avoid warnings throughout a file about a
+variable)."
   (setq variables (eval variables))
   (unless (consp variables)
       (setq variables (list variables)))
@@ -225,8 +229,7 @@
 VARIABLE should be a quoted symbol.  When compiling this file, the warnings
 `reference to free variable VARIABLE' and `assignment to free variable
 VARIABLE' will not occur anywhere in the if-statement.  This is a clean way
-to avoid such warnings.  See also `when-boundp', `declare-boundp',
-`with-boundp' and `globally-declare-boundp'."
+to avoid such warnings.  See also `with-boundp' and friends."
   `(with-boundp ,variable
      (if (boundp ,variable) ,then ,@else)))
 
@@ -236,11 +239,20 @@
 VARIABLE should be a quoted symbol.  When compiling this file, the warnings
 `reference to free variable VARIABLE' and `assignment to free variable
 VARIABLE' will not occur anywhere in the when-statement.  This is a clean
-way to avoid such warnings.  See also `if-boundp', `declare-boundp',
-`with-boundp' and `globally-declare-boundp'."
+way to avoid such warnings.  See also `with-boundp' and friends."
   `(with-boundp ,variable
      (when (boundp ,variable) ,@body)))
 
+(put 'and-boundp 'lisp-indent-function 1)
+(defmacro and-boundp (variable &rest args)
+  "Equivalent to (and (boundp VARIABLE) ARGS) but handles bytecomp warnings.
+VARIABLE should be a quoted symbol.  When compiling this file, the warnings
+`reference to free variable VARIABLE' and `assignment to free variable
+VARIABLE' will not occur anywhere in the and-statement.  This is a clean
+way to avoid such warnings.  See also `with-boundp' and friends."
+  `(with-boundp ,variable
+     (and (boundp ,variable) ,@args)))
+
 (defmacro declare-boundp (variable)
   "Evaluate VARIABLE without bytecomp warnings about the symbol.
 
@@ -251,7 +263,9 @@
 which is equivalent to
 
   (with-boundp 'gpm-minor-mode
-    gpm-minor-mode)"
+    gpm-minor-mode)
+
+See also `with-boundp' and friends."
   `(with-boundp ',variable ,variable))
 
 (defmacro globally-declare-boundp (variables)
@@ -262,15 +276,15 @@
 VARIABLE' and `assignment to free variable VARIABLE' will not occur
 regardless of where references to VARIABLE occur in the file.
 
-In general, you should *NOT* use this; use `declare-boundp', `if-boundp',
-`when-boundp', or `with-boundp' to wrap individual uses, as necessary.
-That way, you're more likely to remember to put in the explicit checks for
-the variable's existence that are usually necessary.  However,
-`globally-declare-boundp' is better in some circumstances, such as when
-writing an ELisp package that makes integral use of optionally-compiled-in
-functionality (typically, an interface onto a system library) and checks
-for the existence of the functionality at some entry point to the package.
-See `globally-declare-fboundp' for more information."
+In general, you should *NOT* use this; use `with-boundp' or its friends to
+wrap individual uses, as necessary.  That way, you're more likely to
+remember to put in the explicit checks for the variable's existence that
+are usually necessary.  However, `globally-declare-boundp' is better in
+some circumstances, such as when writing an ELisp package that makes
+integral use of optionally-compiled-in functionality (typically, an
+interface onto a system library) and checks for the existence of the
+functionality at some entry point to the package.  See
+`globally-declare-fboundp' for more information."
   (setq variables (eval variables))
   (if (not (consp variables))
       (setq variables (list variables)))
@@ -328,8 +342,13 @@
 FUNCTIONS can be a symbol or a list of symbols and must be quoted.  When
 compiling this file, the warning `the function FUNCTION is not known to be
 defined' will not occur anywhere in BODY, for any of the listed functions.
-This is a clean way to avoid such warnings.  See also `declare-fboundp',
-`if-fboundp', `when-fboundp', and `globally-declare-fboundp'."
+This is a clean way to avoid such warnings.
+
+See also `if-fboundp', `when-fboundp', and `and-fboundp' (ways to
+conditionalize on a function being bound and avoid warnings),
+`declare-fboundp' (issue a function call without warnings), and
+`globally-declare-fboundp' (avoid warnings throughout a file about a
+function)."
   `(with-fboundp-1 ,functions ,@body))
 
 (put 'if-fboundp 'lisp-indent-function 2)
@@ -338,8 +357,7 @@
 FUNCTION should be a quoted symbol.  When compiling this file, the warning
 `the function FUNCTION is not known to be defined' will not occur anywhere
 in the if-statement.  This is a clean way to avoid such warnings.  See also
-`when-fboundp', `declare-fboundp', `with-fboundp', and
-`globally-declare-fboundp'."
+`with-fboundp' and friends."
   `(with-fboundp ,function
      (if (fboundp ,function) ,then ,@else)))
 
@@ -348,12 +366,21 @@
   "Equivalent to (when (fboundp FUNCTION) BODY) but handles bytecomp warnings.
 FUNCTION should be a quoted symbol.  When compiling this file, the warning
 `the function FUNCTION is not known to be defined' will not occur anywhere
-in the when-statement.  This is a clean way to avoid such warnings.  See
-also `if-fboundp', `declare-fboundp', `with-fboundp', and
-`globally-declare-fboundp'."
+in the when-statement.  This is a clean way to avoid such warnings.  See also
+`with-fboundp' and friends."
   `(with-fboundp ,function
      (when (fboundp ,function) ,@body)))
 
+(put 'and-fboundp 'lisp-indent-function 1)
+(defmacro and-fboundp (function &rest args)
+  "Equivalent to (and (fboundp FUNCTION) ARGS) but handles bytecomp warnings.
+FUNCTION should be a quoted symbol.  When compiling this file, the warning
+`the function FUNCTION is not known to be defined' will not occur anywhere
+in the and-statement.  This is a clean way to avoid such warnings.  See also
+`with-fboundp' and friends."
+  `(with-fboundp ,function
+     (and (fboundp ,function) ,@args)))
+
 (defmacro declare-fboundp (form)
   "Execute FORM (a function call) without bytecomp warnings about the call.
 Sample usage is
@@ -363,7 +390,9 @@
 which is equivalent to
 
   (with-fboundp 'x-keysym-on-keyboard-sans-modifiers-p
-    (x-keysym-on-keyboard-sans-modifiers-p 'backspace))"
+    (x-keysym-on-keyboard-sans-modifiers-p 'backspace))
+
+See also `with-fboundp' and friends."
   `(with-fboundp ',(car form) ,form))
 
 (defmacro globally-declare-fboundp (functions)
@@ -374,18 +403,18 @@
 to be defined' will not occur regardless of where calls to FUNCTION occur
 in the file.
 
-In general, you should *NOT* use this; use `declare-fboundp', `if-fboundp',
-`when-fboundp', or `with-fboundp' to wrap individual uses, as necessary.
-That way, you're more likely to remember to put in the explicit checks for
-the function's existence that are usually necessary.  However,
-`globally-declare-fboundp' is better in some circumstances, such as when
-writing an ELisp package that makes integral use of optionally-compiled-in
-functionality (typically, an interface onto a system library) and checks
-for the existence of the functionality at some entry point to the package.
-The file `ldap.el' is a good example: It provides a layer on top of the
-optional LDAP ELisp primitives, makes calls to them throughout its code,
-and verifies the presence of LDAP support at load time.  Putting calls to
-`declare-fboundp' throughout the code would be a major annoyance."
+In general, you should *NOT* use this; use `with-fboundp' or its friends to
+wrap individual uses, as necessary.  That way, you're more likely to
+remember to put in the explicit checks for the function's existence that
+are usually necessary.  However, `globally-declare-fboundp' is better in
+some circumstances, such as when writing an ELisp package that makes
+integral use of optionally-compiled-in functionality (typically, an
+interface onto a system library) and checks for the existence of the
+functionality at some entry point to the package.  The file `ldap.el' is a
+good example: It provides a layer on top of the optional LDAP ELisp
+primitives, makes calls to them throughout its code, and verifies the
+presence of LDAP support at load time.  Putting calls to `declare-fboundp'
+throughout the code would be a major annoyance."
   (when (cl-compiling-file)
     (setq functions (eval functions))
     (if (not (consp functions))
@@ -429,11 +458,9 @@
 
 -- use (declare (special ...)) if you are making use of
    dynamically-scoped variables.
--- use `if-fboundp', `when-fboundp', `declare-fboundp', `with-fboundp', or
-   `globally-declare-fboundp' to avoid warnings about undefined functions
+-- use `with-fboundp' and friends to avoid warnings about undefined functions
    when you know the function actually exists.
--- use `if-boundp', `when-boundp', `declare-boundp', `with-boundp', or
-   `globally-declare-boundp' to avoid warnings about undefined variables
+-- use `with-boundp' and friends to avoid warnings about undefined variables
    when you know the variable actually exists.
 -- use `with-obsolete-variable' or `with-obsolete-function' if you
    are purposely using such a variable or function."
--- a/lisp/cl-extra.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/cl-extra.el	Fri Mar 15 07:43:43 2002 +0000
@@ -284,10 +284,10 @@
 	  (setq cl-mark (copy-marker (or cl-start (point-min))))
 	  (setq cl-mark2 (and cl-end (copy-marker cl-end))))
 	(while (and cl-next (or (not cl-mark2) (< cl-mark cl-mark2)))
-	  (setq cl-next (and (fboundp 'next-property-change)
-			     (if cl-prop (next-single-property-change
-					  cl-mark cl-prop cl-what)
-			       (next-property-change cl-mark cl-what)))
+	  (setq cl-next (and-fboundp 'next-property-change
+			  (if cl-prop (next-single-property-change
+				       cl-mark cl-prop cl-what)
+			    (next-property-change cl-mark cl-what)))
 		cl-next2 (or cl-next (save-excursion
 				       (set-buffer cl-what) (point-max))))
 	  (funcall cl-func (prog1 (marker-position cl-mark)
@@ -297,10 +297,10 @@
     (or cl-start (setq cl-start 0))
     (or cl-end (setq cl-end (length cl-what)))
     (while (< cl-start cl-end)
-      (let ((cl-next (or (and (fboundp 'next-property-change)
-			      (if cl-prop (next-single-property-change
-					   cl-start cl-prop cl-what)
-				(next-property-change cl-start cl-what)))
+      (let ((cl-next (or (and-fboundp 'next-property-change
+			   (if cl-prop (next-single-property-change
+					cl-start cl-prop cl-what)
+			     (next-property-change cl-start cl-what)))
 			 cl-end)))
 	(funcall cl-func cl-start (min cl-next cl-end))
 	(setq cl-start cl-next)))))
--- a/lisp/cus-edit.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/cus-edit.el	Fri Mar 15 07:43:43 2002 +0000
@@ -3404,12 +3404,15 @@
 			       ;; support non-themed vars
 			       (and (null spec) (get symbol 'saved-value)))
  		      (princ "\n '(")
- 		      (prin1 symbol)
+		      (prin1 symbol)
  		      (princ " ")
 		      ;; This comment stuff is in the way ####
 		      ;; Is (eq (third spec) (car saved-value)) ????
  		      ;; (prin1 (third spec))
-		      (prin1 (car (get symbol 'saved-value)))
+		      ;; XEmacs -- pretty-print value if available
+		      (if-fboundp 'pp
+			  (pp (car (get symbol 'saved-value)))
+			(prin1 (car (get symbol 'saved-value))))
 		      (when (or now requests comment)
 			(princ (if now " t" " nil")))
 		      (when (or comment requests)
--- a/lisp/dragdrop.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/dragdrop.el	Fri Mar 15 07:43:43 2002 +0000
@@ -246,7 +246,7 @@
 		   ;; to-do: open ftp URLs with efs...
 		   (t 
 		    ;; some other URL, try to fire up some browser for it
-		    (if (fboundp 'browse-url)
+		    (if-fboundp 'browse-url
 			(browse-url (car data))
 		      (display-message 'error 
 			"Can't show URL, no browser selected"))))
--- a/lisp/dump-paths.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/dump-paths.el	Fri Mar 15 07:43:43 2002 +0000
@@ -1,6 +1,7 @@
 ;; dump-paths.el --- set up XEmacs paths for dumping
 
 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: internal, dumped
@@ -26,42 +27,72 @@
 
 ;;; Commentary:
 
-;; This sets up the various paths for continuing loading files for
-;; dumping.
-;; #### This code is duplicated in startup.el (startup-setup-paths).
+;; This sets up the various paths for continuing loading files for dumping.
+;; This is the only file of the basic path/package files (find-paths.el,
+;; package.el, setup-paths.el, dump-paths.el) that actually does stuff.
 
-(let ((debug-paths (or debug-paths
-		      (and (getenv "EMACSDEBUGPATHS")
-			   t)))
-      (roots (paths-find-emacs-roots invocation-directory
-				     invocation-name)))
+(defun startup-setup-paths (roots user-init-directory
+				  &optional
+				  inhibit-packages inhibit-site-lisp
+				  debug-paths called-early)
+  "Setup all the various paths.
+ROOTS is a list of plausible roots of the XEmacs directory hierarchy.
+If INHIBIT-PACKAGES is non-NIL, don't do packages.
+If INHIBIT-SITE-LISP is non-NIL, don't do site-lisp.
+If DEBUG-PATHS is non-NIL, print paths as they are detected.
+It's idempotent, so call this as often as you like!"
 
-  (if debug-paths
-      (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n"
-		     roots)))
+  (if (eq inhibit-packages t)
+      (setq inhibit-packages '(early late last)))
+  (if (not (listp inhibit-packages))
+      (setq inhibit-packages (list inhibit-packages)))
 
-  (let* ((package-locations
-	  (packages-compute-package-locations
-	   ;; temporary kludge:
-	   ;; this should be synched with startup.el
-	   (paths-construct-path '("~" ".xemacs"))))
-	 (stuff (packages-find-packages roots package-locations)))
-    (setq late-packages (car (cdr stuff))))
+  (apply #'(lambda (early late last)
+	     (setq early-packages (and (not (memq 'early inhibit-packages))
+				       early))
+	     (setq late-packages (and (not (memq 'late inhibit-packages))
+				       late))
+	     (setq last-packages (and (not (memq 'last inhibit-packages))
+				       last))
+	     )
+	 (packages-find-packages
+	  roots
+	  (packages-compute-package-locations user-init-directory)))
 
+  (setq early-package-load-path (packages-find-package-load-path
+				 early-packages))
   (setq late-package-load-path (packages-find-package-load-path late-packages))
+  (setq last-package-load-path (packages-find-package-load-path last-packages))
 
   (if debug-paths
       (progn
+	(princ (format "arguments:\nroots: %S\nuser-init-directory: %S\n"
+		       roots user-init-directory)
+	       'external-debugging-output)
+	(princ (format "inhibit-packages: %S\ninhibit-site-lisp: %S\n"
+		       inhibit-packages inhibit-site-lisp)
+	       'external-debugging-output)
+	(princ (format "debug-paths: %S\ncalled-early: %S\n\n"
+		       debug-paths called-early)
+	       'external-debugging-output)
 	(princ (format "configure-package-path:\n%S\n" configure-package-path)
 	       'external-debugging-output)
+	(princ (format "early-packages and early-package-load-path:\n%S\n%S\n"
+		       early-packages early-package-load-path)
+	       'external-debugging-output)
 	(princ (format "late-packages and late-package-load-path:\n%S\n%S\n"
 		       late-packages late-package-load-path)
+	       'external-debugging-output)
+	(princ (format "last-packages and last-package-load-path:\n%S\n%S\n"
+		       last-packages last-package-load-path)
 	       'external-debugging-output)))
 
   (setq lisp-directory (paths-find-lisp-directory roots))
+
   (if debug-paths
       (princ (format "lisp-directory:\n%S\n" lisp-directory)
 	     'external-debugging-output))
+
   (if (featurep 'mule)
       (progn
 	(setq mule-lisp-directory
@@ -72,32 +103,100 @@
 			   mule-lisp-directory)
 		   'external-debugging-output)))
     (setq mule-lisp-directory '()))
+
   (setq site-directory (and (null inhibit-site-lisp)
 			    (paths-find-site-lisp-directory roots)))
+
   (if (and debug-paths (null inhibit-site-lisp))
       (princ (format "site-directory:\n%S\n" site-directory)
 	     'external-debugging-output))
 
   (setq load-path (paths-construct-load-path roots
-					     '()
+					     early-package-load-path
 					     late-package-load-path
-					     '()
+					     last-package-load-path
 					     lisp-directory
 					     site-directory
 					     mule-lisp-directory))
 
-  (setq module-directory (paths-find-module-directory roots))
+  (if called-early
+      (progn
+	(setq module-directory (paths-find-module-directory roots))
+	(if debug-paths
+	    (princ (format "module-directory:\n%S\n" module-directory)
+		   'external-debugging-output))
+	(setq site-module-directory (and (null inhibit-site-modules)
+					 (paths-find-site-module-directory
+					  roots)))
+	(if (and debug-paths (null inhibit-site-modules))
+	    (princ (format "site-module-directory:\n%S\n"
+			   site-module-directory)
+		   'external-debugging-output))
+
+	(setq module-load-path (paths-construct-module-load-path
+				roots
+				module-directory
+				site-module-directory)))
+    (setq Info-directory-list
+	  (paths-construct-info-path
+	   roots early-packages late-packages last-packages))
+
+    (if debug-paths
+	(princ (format "Info-directory-list:\n%S\n" Info-directory-list)
+	       'external-debugging-output))
+
+    (setq exec-directory (paths-find-exec-directory roots))
+
+    (if debug-paths
+	(princ (format "exec-directory:\n%s\n" exec-directory)
+	       'external-debugging-output))
+
+    (setq exec-path
+	  (paths-construct-exec-path roots exec-directory
+				     early-packages late-packages
+				     last-packages))
+
+    (if debug-paths
+	(princ (format "exec-path:\n%S\n" exec-path)
+	       'external-debugging-output))
+
+    (setq doc-directory (paths-find-doc-directory roots))
+
+    (if debug-paths
+	(princ (format "doc-directory:\n%S\n" doc-directory)
+	       'external-debugging-output))
+    
+    (setq data-directory (paths-find-data-directory roots))
+    
+    (if debug-paths
+	(princ (format "data-directory:\n%S\n" data-directory)
+	       'external-debugging-output))
+
+    (setq data-directory-list (paths-construct-data-directory-list
+			       data-directory early-packages
+			       late-packages last-packages))
+    (if debug-paths
+	(princ (format "data-directory-list:\n%S\n" data-directory-list)
+	       'external-debugging-output))))
+
+;;; Now actually do something.
+
+(let ((debug-paths (or debug-paths
+		      (and (getenv "EMACSDEBUGPATHS")
+			   t)))
+      (roots (paths-find-emacs-roots invocation-directory
+				     invocation-name)))
+
   (if debug-paths
-      (princ (format "module-directory:\n%S\n" module-directory)
+      (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n"
+		     roots)
 	     'external-debugging-output))
-  (setq site-module-directory (and (null inhibit-site-modules)
-			    (paths-find-site-module-directory roots)))
-  (if (and debug-paths (null inhibit-site-modules))
-      (princ (format "site-module-directory:\n%S\n" site-module-directory)
-	     'external-debugging-output))
-
-  (setq module-load-path (paths-construct-module-load-path roots
-							 module-directory
-							 site-module-directory)))
+  (startup-setup-paths roots
+		       (paths-construct-path '("~" ".xemacs"))
+		       (if inhibit-all-packages t
+			 '(early last))
+		       inhibit-site-lisp
+		       debug-paths
+		       t))
 
 ;;; dump-paths.el ends here
--- a/lisp/faces.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/faces.el	Fri Mar 15 07:43:43 2002 +0000
@@ -1808,7 +1808,6 @@
 (make-face 'secondary-selection "Secondary selection face.")
 
 ;; Several useful color faces.
-(eval-when-compile (load "cl-macs"))
 (dolist (color '(red green blue yellow))
   (make-face color (concat (symbol-name color) " text."))
   (set-face-foreground color (symbol-name color) nil 'color))
--- a/lisp/files.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/files.el	Fri Mar 15 07:43:43 2002 +0000
@@ -2991,7 +2991,7 @@
   (if (null auto-save-list-file-prefix)
       (error
        "You set `auto-save-list-file-prefix' to disable making session files"))
-  (dired (concat auto-save-list-file-prefix "*"))
+  (declare-fboundp (dired (concat auto-save-list-file-prefix "*")))
   (goto-char (point-min))
   (or (looking-at "Move to the session you want to recover,")
       (let ((inhibit-read-only t))
@@ -3399,7 +3399,7 @@
 ;; Suggested by Michael Kifer <kifer@CS.SunySB.EDU>
 (defun file-remote-p (file-name)
   "Test whether FILE-NAME is looked for on a remote system."
-  (cond ((not allow-remote-paths) nil)
+  (cond ((not (declare-boundp allow-remote-paths)) nil)
 	((fboundp 'ange-ftp-ftp-path)
 	 (declare-fboundp (ange-ftp-ftp-path file-name)))
 	((fboundp 'efs-ftp-path)
--- a/lisp/fill.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/fill.el	Fri Mar 15 07:43:43 2002 +0000
@@ -785,8 +785,8 @@
 ;; 97/3/14 jhod: This functions are added for Kinsoku support
 (defun find-space-insertable-point ()
  "Search backward for a permissible point for inserting justification spaces."
- (if (boundp 'space-insertable)
-     (if (re-search-backward (declare-boundp space-insertable) nil t)
+ (if-boundp 'space-insertable
+     (if (re-search-backward space-insertable nil t)
 	 (progn (forward-char 1)
 		t)
        nil)
--- a/lisp/find-paths.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/find-paths.el	Fri Mar 15 07:43:43 2002 +0000
@@ -31,8 +31,9 @@
 
 ;; This file is dumped with XEmacs.
 
-;; This file contains the library functionality to find paths into the
-;; XEmacs hierarchy.
+;; This file contains basic library functionality for manipulating paths
+;; and path lists and finding paths in the XEmacs hierarchy.
+
 
 ;;; Code:
 
--- a/lisp/font-lock.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/font-lock.el	Fri Mar 15 07:43:43 2002 +0000
@@ -1667,18 +1667,18 @@
 ;; because people know what they will do.
 ;; A hook is a mystery because it might do anything whatever. --rms.
 (defun font-lock-thing-lock-cleanup ()
-  (cond ((and (boundp 'fast-lock-mode) fast-lock-mode)
-	 (fast-lock-mode -1))
-	((and (boundp 'lazy-lock-mode) lazy-lock-mode)
-	 (lazy-lock-mode -1))
-	((and (boundp 'lazy-shot-mode) lazy-shot-mode)
-	 (lazy-shot-mode -1))))
+  (cond ((and-boundp 'fast-lock-mode fast-lock-mode)
+	 (declare-fboundp (fast-lock-mode -1)))
+	((and-boundp 'lazy-lock-mode lazy-lock-mode)
+	 (declare-fboundp (lazy-lock-mode -1)))
+	((and-boundp 'lazy-shot-mode lazy-shot-mode)
+	 (declare-fboundp (lazy-shot-mode -1)))))
 
 ; Do something special for these packages after fontifying.  I prefer a hook.
 (defun font-lock-after-fontify-buffer ()
-  (cond ((and (boundp 'fast-lock-mode) fast-lock-mode)
+  (cond ((and-boundp 'fast-lock-mode fast-lock-mode)
 	 (declare-fboundp (fast-lock-after-fontify-buffer)))
-	((and (boundp 'lazy-lock-mode) lazy-lock-mode)
+	((and-boundp 'lazy-lock-mode lazy-lock-mode)
 	 (declare-fboundp (lazy-lock-after-fontify-buffer)))))
 
 
--- a/lisp/font.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/font.el	Fri Mar 15 07:43:43 2002 +0000
@@ -1404,9 +1404,9 @@
 		  font-blink-interval))
    ((fboundp 'run-at-time)
     (cancel-function-timers 'font-blink-callback)
-    (run-at-time font-blink-interval
-		 font-blink-interval
-		 'font-blink-callback))
+    (declare-fboundp (run-at-time font-blink-interval
+				  font-blink-interval
+				  'font-blink-callback)))
    (t nil)))
 
 (provide 'font)
--- a/lisp/gtk-faces.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/gtk-faces.el	Fri Mar 15 07:43:43 2002 +0000
@@ -226,16 +226,18 @@
 (defun gtk-make-font-unbold (font &optional device)
   (try-font-name (gtk-frob-font-weight font "medium") device))
 
-(defcustom *try-oblique-before-italic-fonts* t
+(defcustom try-oblique-before-italic-fonts t
   "*If nil, italic fonts are searched before oblique fonts.
 If non-nil, oblique fonts are tried before italic fonts.  This is mostly
 applicable to adobe-courier fonts"
   :type 'boolean
   :tag "Try Oblique Before Italic Fonts"
   :group 'x)
+(define-obsolete-variable-alias '*try-oblique-before-italic-fonts*
+  'try-oblique-before-italic-fonts)
 
 (defun gtk-make-font-italic (font &optional device)
-  (if *try-oblique-before-italic-fonts*
+  (if try-oblique-before-italic-fonts
       (or (try-font-name (gtk-frob-font-slant font "o") device)
 	  (try-font-name (gtk-frob-font-slant font "i") device))
     (or (try-font-name (gtk-frob-font-slant font "i") device)
@@ -245,7 +247,7 @@
   (try-font-name (gtk-frob-font-slant font "r") device))
 
 (defun gtk-make-font-bold-italic (font &optional device)
-  (if *try-oblique-before-italic-fonts*
+  (if try-oblique-before-italic-fonts
       (or (try-font-name
 	   (gtk-frob-font-slant (gtk-frob-font-weight font "bold") "o") device)
 	  (try-font-name
--- a/lisp/gui.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/gui.el	Fri Mar 15 07:43:43 2002 +0000
@@ -115,7 +115,10 @@
 (defun insert-gui-button (button &optional pos buffer)
   "Insert GUI button BUTTON at POS in BUFFER."
   (check-argument-type 'gui-button-p button)
-  (make-annotation (make-glyph button)
-			       pos 'text buffer nil))
+  (if-fboundp 'make-annotation
+      (make-annotation (make-glyph button)
+		       pos 'text buffer nil)
+    (error 'unimplemented "insert-gui-button requires `annotations' package")))
+  
 
 ;;; gui.el ends here
--- a/lisp/help.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/help.el	Fri Mar 15 07:43:43 2002 +0000
@@ -803,14 +803,14 @@
 (defun xemacs-www-page ()
   "Go to the XEmacs World Wide Web page."
   (interactive)
-  (if (fboundp 'browse-url)
+  (if-fboundp 'browse-url
       (browse-url "http://www.xemacs.org/")
     (error "xemacs-www-page requires browse-url")))
 
 (defun xemacs-www-faq ()
   "View the latest and greatest XEmacs FAQ using the World Wide Web."
   (interactive)
-  (if (fboundp 'browse-url)
+  (if-fboundp 'browse-url
       (browse-url "http://www.xemacs.org/faq/index.html")
     (error "xemacs-www-faq requires browse-url")))
 
--- a/lisp/hyper-apropos.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/hyper-apropos.el	Fri Mar 15 07:43:43 2002 +0000
@@ -1232,7 +1232,9 @@
 	 (setq fn nil))
      (list fn)))
   (if fn
-      (find-function-other-window fn)))
+      (if-fboundp 'find-function-other-window
+	  (find-function-other-window fn)
+	(error 'unimplemented "`find-func' package unavailable"))))
 
 (defun hyper-apropos-find-variable (fn)
   "Find the variable for the symbol on the current line in other
@@ -1243,7 +1245,9 @@
 	 (setq fn nil))
      (list fn)))
   (if fn
-      (find-variable-other-window fn)))
+      (if-fboundp 'find-variable-other-window
+	  (find-variable-other-window fn)
+	(error 'unimplemented "`find-func' package unavailable"))))
 
 ;; ---------------------------------------------------------------------- ;;
 
--- a/lisp/info.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/info.el	Fri Mar 15 07:43:43 2002 +0000
@@ -661,9 +661,9 @@
 			   "mailto\\|news\\|tn3270\\|ftp\\|http\\|file\\|"
 			   "telnet\\|gopher\\):")
 		   filename)
-    (if (fboundp 'browse-url)
+    (if-fboundp 'browse-url
 	(browse-url filename)
-      (error "Cannot follow URLs in this XEmacs")))
+      (error 'unimplemented "no `browse-url' package; Cannot follow URLs in this XEmacs")))
    (t
     (error "Info file %s does not exist" filename))))
 
--- a/lisp/isearch-mode.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/isearch-mode.el	Fri Mar 15 07:43:43 2002 +0000
@@ -974,9 +974,9 @@
   (interactive)
   (if (and delete-key-deletes-forward
            (case (device-type)
-             ('tty (eq (declare-boundp tty-erase-char) ?\C-h))
-             ('x (not (declare-fboundp
-		       (x-keysym-on-keyboard-sans-modifiers-p 'backspace))))))
+             (tty (eq (declare-boundp tty-erase-char) ?\C-h))
+             (x (not (declare-fboundp
+		      (x-keysym-on-keyboard-sans-modifiers-p 'backspace))))))
       (isearch-delete-char)
     (isearch-mode-help)))
 
--- a/lisp/keymap.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/keymap.el	Fri Mar 15 07:43:43 2002 +0000
@@ -49,8 +49,9 @@
 \(see `insert-kbd-macro')."
   (if (or (stringp keys)
 	  (vectorp keys))
-      (read-kbd-macro keys)
-    `(read-kbd-macro ,keys)))
+      ;; #### need to move xemacs-base into the core!!!!!!
+      (declare-fboundp (read-kbd-macro keys))
+    `(declare-fboundp (read-kbd-macro ,keys))))
 
 (defun suppress-keymap (map &optional nodigits)
   "Make MAP override all normally self-inserting keys to be undefined.
--- a/lisp/lisp-mnt.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/lisp-mnt.el	Fri Mar 15 07:43:43 2002 +0000
@@ -557,13 +557,15 @@
   (let ((package	(lm-get-package-name))
 	(addr		(lm-maintainer))
 	(version	(lm-version)))
-    (mail nil
-	  (if addr
-	      (concat (car addr) " <" (cdr addr) ">")
-	    (or (and (boundp 'report-xemacs-bug-beta-address)
-		     (declare-boundp report-xemacs-bug-beta-address))
-		"<xemacs-beta@xemacs.org>"))
-	  topic)
+    (if-fboundp 'mail
+	(mail nil
+	      (if addr
+		  (concat (car addr) " <" (cdr addr) ">")
+		(or (and-boundp 'report-xemacs-bug-beta-address
+		      report-xemacs-bug-beta-address)
+		    "<xemacs-beta@xemacs.org>"))
+	      topic)
+      (error 'unimplemented "No mail package available"))
     (goto-char (point-max))
     (insert "\nIn "
 	    package
--- a/lisp/lisp-mode.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/lisp-mode.el	Fri Mar 15 07:43:43 2002 +0000
@@ -700,7 +700,7 @@
 		  (backward-up-list 1)
 		  (backward-up-list 1)
 		  (backward-up-list 1)
-		  (looking-at "(flet\\s-"))
+		  (looking-at "(\\(flet\\|macrolet\\|labels\\)\\s-"))
 	      (error nil))
 	    (setq method 'defun)
 	  (setq method (or (get (intern-soft function) 'lisp-indent-function)
@@ -777,6 +777,9 @@
 ;; like defun if the first form is placed on the next line, otherwise
 ;; it is indented like any other form (i.e. forms line up under first).
 
+;; NOTE: All def* functions are handled specially, no need to put them here.
+;; NOTE: All cl-* constructs are handled in cl.el.
+
 (put 'lambda 'lisp-indent-function 'defun)
 (put 'autoload 'lisp-indent-function 'defun)
 (put 'progn 'lisp-indent-function 0)
@@ -793,7 +796,6 @@
 (put 'let 'lisp-indent-function 1)
 (put 'let* 'lisp-indent-function 1)
 (put 'let-specifier 'lisp-indent-function 1)
-(put 'flet 'lisp-indent-function 1)
 (put 'while 'lisp-indent-function 1)
 (put 'if 'lisp-indent-function 2)
 (put 'catch 'lisp-indent-function 1)
--- a/lisp/mouse.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/mouse.el	Fri Mar 15 07:43:43 2002 +0000
@@ -274,9 +274,9 @@
 	     (<= (length result-str) (window-width (selected-window))))
 	(message "%s" result-str)
       (with-output-to-temp-buffer "*Mouse-Eval*"
-	(condition-case nil
+	(if-fboundp 'pprint
 	    (pprint val)
-	  (error (prin1 val))))
+	  (prin1 val)))
       )))
 
 (defun mouse-line-length (event)
--- a/lisp/mule/chinese.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/mule/chinese.el	Fri Mar 15 07:43:43 2002 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
 ;; Copyright (C) 1997 MORIOKA Tomohiko
-;; Copyright (C) 2000, 2001 Ben Wing.
+;; Copyright (C) 2000, 2001, 2002 Ben Wing.
 
 ;; Keywords: multilingual, Chinese
 
@@ -31,6 +31,9 @@
 
 ;;; Code:
 
+(eval-when-compile
+  (require 'china-util))
+
 ;; Syntax of Chinese characters.
 (modify-syntax-entry 'chinese-gb2312 "w")
 (loop for row in '(33 34 41)
@@ -200,7 +203,8 @@
 (defun post-read-decode-hz (len)
   (let ((pos (point))
 	(buffer-modified-p (buffer-modified-p))
-	last-coding-system-used)
+	;last-coding-system-used
+	)
     (prog1
 	(decode-hz-region pos (+ pos len))
       (set-buffer-modified-p buffer-modified-p))))
@@ -211,8 +215,8 @@
     (if (stringp from)
 	(insert from)
       (insert-buffer-substring buf from to))
-    (let (last-coding-system-used)
-      (encode-hz-region 1 (point-max)))
+    ;(let (last-coding-system-used)
+    (encode-hz-region 1 (point-max))
     nil))
 
 (set-language-info-alist
--- a/lisp/mule/japan-util.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/mule/japan-util.el	Fri Mar 15 07:43:43 2002 +0000
@@ -238,7 +238,7 @@
 	       (composition
 		(and (not hankaku)
 		     (get-char-code-property kana 'kana-composition)))
-	       next slot)
+	       slot)
 	  (if (and composition (setq slot (assq (following-char) composition)))
 	      (japanese-replace-region (match-beginning 0) (1+ (point))
 				       (cdr slot))
@@ -260,7 +260,7 @@
       (while (re-search-forward "\\cK\\|\\ck" nil t)
 	(let* ((kata (preceding-char))
 	       (composition (get-char-code-property kata 'kana-composition))
-	       next slot)
+	       slot)
 	  (if (and composition (setq slot (assq (following-char) composition)))
 	      (japanese-replace-region (match-beginning 0) (1+ (point))
 				       (get-char-code-property
@@ -307,7 +307,7 @@
 		      (re-search-forward "\\ca\\|\\ck" nil t)))
 	(let* ((hankaku (preceding-char))
 	       (composition (get-char-code-property hankaku 'kana-composition))
-	       next slot)
+	       slot)
 	  (if (and composition (setq slot (assq (following-char) composition)))
 	      (japanese-replace-region (match-beginning 0) (1+ (point))
 				       (cdr slot))
--- a/lisp/package-admin.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/package-admin.el	Fri Mar 15 07:43:43 2002 +0000
@@ -310,7 +310,10 @@
 		      (save-excursion
 			(set-buffer manifest-buf)
 			;; Put the files in sorted order
-			(sort-lines nil (point-min) (point-max))
+			(if-fboundp 'sort-lines
+			    (sort-lines nil (point-min) (point-max))
+			  (error 'unimplemented
+				 "`xemacs-base' not installed?"))
 			;; Write the file.
 			;; Note that using `write-region' *BYPASSES* any check
 			;; to see if XEmacs is currently editing/visiting the
--- a/lisp/package-get.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/package-get.el	Fri Mar 15 07:43:43 2002 +0000
@@ -445,14 +445,16 @@
 		(setq package-get-continue-update-base nil)
 		(autoload 'mc-setversion "mc-setversion")
 		(with-fboundp 'mc-setversion
-		  (or
-		   (cond ((locate-file "gpg" exec-path exec-suffix-list)
-			  (mc-setversion "gpg"))
-			 ((locate-file "pgpe" exec-path exec-suffix-list)
-			  (mc-setversion "5.0"))
-			 ((locate-file "pgp" exec-path exec-suffix-list)
-			  (mc-setversion "2.6")))
-		   (error "Can't find a suitable pgp executable")))
+		  (if-boundp 'exec-suffix-list
+		      (or
+		       (cond ((locate-file "gpg" exec-path exec-suffix-list)
+			      (mc-setversion "gpg"))
+			     ((locate-file "pgpe" exec-path exec-suffix-list)
+			      (mc-setversion "5.0"))
+			     ((locate-file "pgp" exec-path exec-suffix-list)
+			      (mc-setversion "2.6")))
+		       (error "Can't find a suitable pgp executable"))
+		    (error 'unimplemented "`apel' package unavailable")))
 		(autoload 'mc-verify "mc-toplev")
 		(declare-fboundp (mc-verify))
 		(setq package-get-continue-update-base t))
@@ -966,8 +968,8 @@
   (if (not (file-exists-p package-get-dir))
       (make-directory package-get-dir))
   (expand-file-name
-   (file-name-nondirectory (or (and (fboundp 'efs-ftp-path)
-				    (nth 2 (efs-ftp-path filename)))
+   (file-name-nondirectory (or (and-fboundp 'efs-ftp-path
+				 (nth 2 (efs-ftp-path filename)))
 			       filename))
    (file-name-as-directory package-get-dir)))
 
--- a/lisp/printer.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/printer.el	Fri Mar 15 07:43:43 2002 +0000
@@ -446,5 +446,5 @@
 	     (setq copies (1- copies)))))
 	((and (not (eq system-type 'windows-nt))
 	      (fboundp 'lpr-region))
-	 (lpr-region start end))
+	 (declare-fboundp (lpr-region start end)))
 	(t (error "No print support available"))))
--- a/lisp/process.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/process.el	Fri Mar 15 07:43:43 2002 +0000
@@ -274,7 +274,13 @@
       (if (string-match "[ \t]*&[ \t]*$" command)
 	  ;; Command ending with ampersand means asynchronous.
 	  (progn
-	    (background (substring command 0 (match-beginning 0))))
+	    (if-fboundp 'background
+		(background (substring command 0
+				       (match-beginning 0)))
+	      (error
+	       'unimplemented
+	       "backgrounding a shell command requires package `background'")))
+	    
 	(shell-command-on-region (point) (point) command output-buffer)))))
 
 ;; We have a sentinel to prevent insertion of a termination message
@@ -447,7 +453,7 @@
       ;; mswindows-construct-process-command-line!).  Putting quotes
       ;; around shell metachars gets through the last two, and applying
       ;; the normal VC runtime quoting works with practically all apps.
-      (mswindows-quote-one-vc-runtime-arg argument t)
+      (declare-fboundp (mswindows-quote-one-vc-runtime-arg argument t))
     (if (equal argument "")
 	"\"\""
       ;; Quote everything except POSIX filename characters.
--- a/lisp/resize-minibuffer.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/resize-minibuffer.el	Fri Mar 15 07:43:43 2002 +0000
@@ -36,7 +36,7 @@
 
 ;; This file has received maintenance by the XEmacs development team.
 
-;; $Id: resize-minibuffer.el,v 1.3 2002/03/13 10:00:06 ben Exp $
+;; $Id: resize-minibuffer.el,v 1.4 2002/03/15 07:43:21 ben Exp $
 
 ;; This package allows the entire contents (or as much as possible) of the
 ;; minibuffer to be visible at once when typing.  As the end of a line is
@@ -160,12 +160,12 @@
 		       nil t)
 	     (make-local-hook 'post-command-hook)
 	     (add-hook 'post-command-hook 'resize-minibuffer-frame nil t)
-	     (unless (if-boundp 'icomplete-mode icomplete-mode)
+	     (unless (and-boundp 'icomplete-mode icomplete-mode)
 	       (resize-minibuffer-frame)))))
      (t
       (make-local-hook 'post-command-hook)
       (add-hook 'post-command-hook 'resize-minibuffer-window nil t)
-      (unless (if-boundp 'icomplete-mode icomplete-mode)
+      (unless (and-boundp 'icomplete-mode icomplete-mode)
 	(resize-minibuffer-window)))))))
 
 (defun resize-minibuffer-count-window-lines (&optional start end)
--- a/lisp/setup-paths.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/setup-paths.el	Fri Mar 15 07:43:43 2002 +0000
@@ -31,8 +31,9 @@
 
 ;; This file is dumped with XEmacs.
 
-;; This file describes and constructs the various paths into the
-;; XEmacs hierarchy from a global viewpoint.
+;; This file contains functions and variables that describe and construct
+;; the various paths into the XEmacs hierarchy from a global viewpoint.
+;; This file doesn't actually do anything.
 
 ;; It requires find-paths.el and packages.el.
 
--- a/lisp/simple.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/simple.el	Fri Mar 15 07:43:43 2002 +0000
@@ -3715,12 +3715,13 @@
 	(funcall switch-function "*mail*")))
   (let ((cc (cdr (assoc-ignore-case "cc" other-headers)))
 	(in-reply-to (cdr (assoc-ignore-case "in-reply-to" other-headers))))
-    (or (mail continue to subject in-reply-to cc yank-action send-actions)
+    (or (declare-fboundp
+	 (mail continue to subject in-reply-to cc yank-action send-actions))
 	continue
 	(error "Message aborted"))
     (save-excursion
       (goto-char (point-min))
-      (search-forward mail-header-separator)
+      (search-forward (declare-boundp mail-header-separator))
       (beginning-of-line)
       (while other-headers
 	(if (not (member (car (car other-headers)) '("in-reply-to" "cc")))
--- a/lisp/startup.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/startup.el	Fri Mar 15 07:43:43 2002 +0000
@@ -227,6 +227,7 @@
     ("-i"	. command-line-do-insert)
     ("-kill"	. command-line-do-kill)
     ("-eol"     . command-line-do-enable-eol-detection)
+    ("-enable-eol-detection" . command-line-do-enable-eol-detection)
     ;; Options like +35 are handled specially.
     ;; Window-system, site, or package-specific code might add to this.
     ;; X11 handles its options by letting Xt remove args from this list.
@@ -311,10 +312,20 @@
 
 Package/module options:
 
-  -no-early-packages	Do not process early packages.
   -vanilla		Equivalent to -q -no-site-file -no-early-packages.
+                        Useful if you think some user-init or site-init code
+                        is messing things up, or when running XEmacs in
+                        batch mode.
   -no-autoloads		Do not load global symbol files (auto-autoloads) at
 			startup.  Also implies `-vanilla'.
+  -no-packages          Pretend like the packages don't exist.  Don't put
+                        any packages in the load path or set up any package
+                        autoloads.  Also Implies `-vanilla'.  Use this when
+                        running XEmacs in batch mode when you aren't using
+                        any functionality in packages and want to make sure
+                        that you get no interference from packages
+                        (e.g. Lisp files that shadow core Lisp files).
+  -no-early-packages	Do not process early packages.
   -debug-paths          Display info about the runtime values of various
                         directory variables (e.g. for loading packages).
   -no-site-modules      Do not search site-modules directories for modules
@@ -516,9 +527,12 @@
 	  (startup-find-roots-warning))
       (startup-setup-paths emacs-roots
 			   user-init-directory
-			   inhibit-early-packages
+			   (cond (inhibit-all-packages t)
+				 (inhibit-early-packages '(early))
+				 (t nil))
 			   inhibit-site-lisp
-			   debug-paths)
+			   debug-paths
+			   nil)
       (startup-setup-paths-warning))
 
     (startup-load-autoloads)
@@ -590,36 +604,33 @@
   ;;      (progn
   ;;	(standard-display-european t)
   ;;	(require 'iso-syntax)))
-
-  (setq load-user-init-file-p (not (noninteractive)))
-
+  
+  (if vanilla-inhibiting ;; set in main_1()
+      (setq load-user-init-file-p nil
+	    site-start-file nil)
+    (setq load-user-init-file-p (not (noninteractive))))
+  
   ;; Allow (at least) these arguments anywhere in the command line
-  (let ((new-args nil)
-	(arg      nil))
-    (while args
-      (setq arg (pop args))
+  (macrolet ((long-argmatch (match)
+	       ;; use a macro to avoid lots of concatting at runtime
+	       `(or (string= arg ,match)
+		    (string= arg ,(concat "-" match)))))
+    (let ((new-args nil)
+	  (arg      nil))
+      (while args
+	(setq arg (pop args))
       (cond
        ((or (string= arg "-q")
-	    (string= arg "-no-init-file"))
+	    (long-argmatch "-no-init-file"))
 	(setq load-user-init-file-p nil))
-       ((string= arg "-no-site-file")
+       ((long-argmatch "-no-site-file")
 	(setq site-start-file nil))
-       ((or (string= arg "-no-early-packages")
-	    (string= arg "--no-early-packages"))
-	(setq inhibit-early-packages t))
-       ((or (string= arg "-vanilla")
-	    (string= arg "--vanilla")
-	    ;; Some work on this one already done in emacs.c.
-	    (string= arg "-no-autoloads")
-	    (string= arg "--no-autoloads"))
-	(setq load-user-init-file-p nil
-	      site-start-file nil))
-       ((string= arg "-user-init-file")
+       ((long-argmatch "-user-init-file")
 	(setq user-init-file (pop args)))
-       ((string= arg "-user-init-directory")
+       ((long-argmatch "-user-init-directory")
 	(setq user-init-directory (file-name-as-directory (pop args))))
        ((or (string= arg "-u")
- 	    (string= arg "-user"))
+	    (long-argmatch "-user"))
 	(let* ((user (pop args))
 	       (home-user (concat "~" user)))
 	  (setq user-init-directory (file-name-as-directory
@@ -629,13 +640,10 @@
 		(find-user-init-file user-init-directory home-user))
 	  (setq custom-file
 		(make-custom-file-name user-init-file))))
-       ((string= arg "-debug-init")
+       ((long-argmatch "-debug-init")
 	(setq init-file-debug t))
-       ((string= arg "-unmapped")
+       ((long-argmatch "-unmapped")
 	(setq initial-frame-unmapped-p t))
-       ((or (string= arg "-debug-paths")
-	    (string= arg "--debug-paths"))
-	t)
        ((or (string= arg "--") (string= arg "-"))
 	(while args
 	  (push (pop args) new-args)))
@@ -644,7 +652,7 @@
     (with-obsolete-variable 'init-file-user
       (setq init-file-user (and load-user-init-file-p "")))
 
-    (nreverse new-args)))
+    (nreverse new-args))))
 
 (defconst initial-scratch-message "\
 ;; This buffer is for notes you don't want to save, and for Lisp evaluation.
@@ -673,7 +681,7 @@
       (setq command-line-args-left (command-line-early command-line-args-left))
 
       (when (eq system-type 'windows-nt)
-	(init-mswindows-at-startup))
+	(declare-fboundp (init-mswindows-at-startup)))
 
       ;; Setup the toolbar icon directory
       (when (featurep 'toolbar)
@@ -1335,119 +1343,6 @@
 	;; don't let /tmp_mnt/... get into the load-path or exec-path.
 	(abbreviate-file-name invocation-directory)))
 
-(defun startup-setup-paths (roots user-init-directory
-				  &optional
-				  inhibit-early-packages inhibit-site-lisp
-				  debug-paths)
-  "Setup all the various paths.
-ROOTS is a list of plausible roots of the XEmacs directory hierarchy.
-If INHIBIT-PACKAGES is non-NIL, don't do packages.
-If INHIBIT-SITE-LISP is non-NIL, don't do site-lisp.
-If DEBUG-PATHS is non-NIL, print paths as they are detected.
-It's idempotent, so call this as often as you like!"
-
-  (apply #'(lambda (early late last)
-	     (setq early-packages (and (not inhibit-early-packages)
-				       early))
-	     (setq late-packages late)
-	     (setq last-packages last))
-	 (packages-find-packages
-	  roots
-	  (packages-compute-package-locations user-init-directory)))
-
-  (setq early-package-load-path (packages-find-package-load-path early-packages))
-  (setq late-package-load-path (packages-find-package-load-path late-packages))
-  (setq last-package-load-path (packages-find-package-load-path last-packages))
-
-  (if debug-paths
-      (progn
-	(princ (format "configure-package-path:\n%S\n" configure-package-path)
-	       'external-debugging-output)
-	(princ (format "early-packages and early-package-load-path:\n%S\n%S\n"
-		       early-packages early-package-load-path)
-	       'external-debugging-output)
-	(princ (format "late-packages and late-package-load-path:\n%S\n%S\n"
-		       late-packages late-package-load-path)
-	       'external-debugging-output)
-	(princ (format "last-packages and last-package-load-path:\n%S\n%S\n"
-		       last-packages last-package-load-path)
-	       'external-debugging-output)))
-
-  (setq lisp-directory (paths-find-lisp-directory roots))
-
-  (if debug-paths
-      (princ (format "lisp-directory:\n%S\n" lisp-directory)
-	     'external-debugging-output))
-
-  (if (featurep 'mule)
-      (progn
-	(setq mule-lisp-directory
-	      (paths-find-mule-lisp-directory roots
-					      lisp-directory))
-	(if debug-paths
-	    (princ (format "mule-lisp-directory:\n%S\n"
-			   mule-lisp-directory)
-		   'external-debugging-output)))
-    (setq mule-lisp-directory '()))
-
-  (setq site-directory (and (null inhibit-site-lisp)
-			    (paths-find-site-lisp-directory roots)))
-
-  (if (and debug-paths (null inhibit-site-lisp))
-      (princ (format "site-directory:\n%S\n" site-directory)
-	     'external-debugging-output))
-
-  (setq load-path (paths-construct-load-path roots
-					     early-package-load-path
-					     late-package-load-path
-					     last-package-load-path
-					     lisp-directory
-					     site-directory
-					     mule-lisp-directory))
-
-  (setq Info-directory-list
-	(paths-construct-info-path roots
-				   early-packages late-packages last-packages))
-
-
-  (if debug-paths
-      (princ (format "Info-directory-list:\n%S\n" Info-directory-list)
-	     'external-debugging-output))
-
-  (setq exec-directory (paths-find-exec-directory roots))
-
-  (if debug-paths
-      (princ (format "exec-directory:\n%s\n" exec-directory)
-	     'external-debugging-output))
-
-  (setq exec-path
-	(paths-construct-exec-path roots exec-directory
-				   early-packages late-packages last-packages))
-
-  (if debug-paths
-      (princ (format "exec-path:\n%S\n" exec-path)
-	     'external-debugging-output))
-
-  (setq doc-directory (paths-find-doc-directory roots))
-
-  (if debug-paths
-      (princ (format "doc-directory:\n%S\n" doc-directory)
-	     'external-debugging-output))
-
-  (setq data-directory (paths-find-data-directory roots))
-
-  (if debug-paths
-      (princ (format "data-directory:\n%S\n" data-directory)
-	     'external-debugging-output))
-
-  (setq data-directory-list (paths-construct-data-directory-list data-directory
-								 early-packages
-								 late-packages
-								 last-packages))
-  (if debug-paths
-      (princ (format "data-directory-list:\n%S\n" data-directory-list)
-	     'external-debugging-output)))
-
 (defun startup-find-roots-warning ()
   (save-excursion
     (set-buffer (get-buffer-create " *warning-tmp*"))
@@ -1498,7 +1393,7 @@
       (load (expand-file-name (file-name-sans-extension autoload-file-name)
 			      lisp-directory) nil t))
 
-  (if (not inhibit-autoloads)
+  (if (and (not inhibit-autoloads) (not inhibit-all-packages))
       (progn
 	(if (not inhibit-early-packages)
 	    (packages-load-package-auto-autoloads early-package-load-path))
--- a/lisp/toolbar-items.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/toolbar-items.el	Fri Mar 15 07:43:43 2002 +0000
@@ -124,10 +124,10 @@
 (defun toolbar-paste ()
   (interactive)
   ;; This horrible kludge is for pending-delete to work correctly.
-  (and (boundp 'pending-delete-mode)
-       (declare-boundp pending-delete-mode)
-       (let ((this-command toolbar-paste-function))
-	 (declare-fboundp (pending-delete-pre-hook))))
+  (and-boundp 'pending-delete-mode
+    pending-delete-mode
+    (let ((this-command toolbar-paste-function))
+      (declare-fboundp (pending-delete-pre-hook))))
   (call-interactively toolbar-paste-function))
 
 (defcustom toolbar-undo-function 'undo
@@ -156,11 +156,14 @@
 
 (defun toolbar-ispell-internal ()
   (interactive)
-  (cond
-   ((region-active-p) (ispell-region (region-beginning) (region-end)))
-   ((eq major-mode 'mail-mode) (ispell-message))
-   ((eq major-mode 'message-mode) (ispell-message))
-   (t (ispell-buffer))))
+  (if-fboundp 'ispell-region
+      (with-fboundp '(ispell-message ispell-buffer)
+	(cond
+	 ((region-active-p) (ispell-region (region-beginning) (region-end)))
+	 ((eq major-mode 'mail-mode) (ispell-message))
+	 ((eq major-mode 'message-mode) (ispell-message))
+	 (t (ispell-buffer))))
+    (error 'unimplemented "`ispell' package unavailable")))
 
 (defcustom toolbar-ispell-function 'toolbar-ispell-internal
   "*Function to call when the ispell icon is selected."
@@ -294,19 +297,23 @@
   "Run compile without having to touch the keyboard."
   (interactive)
   (declare (special compile-command toolbar-compile-already-run))
-  (require 'compile)
-  (if (boundp 'toolbar-compile-already-run)
-      (compile compile-command)
-    (setq toolbar-compile-already-run t)
-    (if (should-use-dialog-box-p)
-       (make-dialog-box 'question
-			:question (concat "Compile:\n        " compile-command)
-			:buttons
-			'(["Compile" (compile compile-command) t]
-			  ["Edit command" compile t]
-			  nil
-			  ["Cancel" (message "Quit") t]))
-      (compile compile-command))))
+  (if-fboundp 'compile
+      (progn
+	(require 'compile)
+	(if (boundp 'toolbar-compile-already-run)
+	    (compile compile-command)
+	  (setq toolbar-compile-already-run t)
+	  (if (should-use-dialog-box-p)
+	      (make-dialog-box 'question
+			       :question
+			       (concat "Compile:\n        " compile-command)
+			       :buttons
+			       '(["Compile" (compile compile-command) t]
+				 ["Edit command" compile t]
+				 nil
+				 ["Cancel" (message "Quit") t]))
+	    (compile compile-command))))
+    (error 'unimplemented "`compile' package unavailable")))
 
 ;;
 ;; toolbar news variables and defuns
@@ -369,23 +376,26 @@
 (defun toolbar-gnus ()
   "Run Gnus in a separate frame."
   (interactive)
-  (if (not toolbar-news-use-separate-frame)
-      (gnus)
-    (unless (frame-live-p toolbar-news-frame)
-      (setq toolbar-news-frame (make-frame toolbar-news-frame-plist))
-      (add-hook 'gnus-exit-gnus-hook
-		(lambda ()
-		  (when (frame-live-p toolbar-news-frame)
-		    (if (cdr (frame-list))
-			(delete-frame toolbar-news-frame))
-		    (setq toolbar-news-frame nil))))
-      (select-frame toolbar-news-frame)
-      (gnus))
-    (when (framep toolbar-news-frame)
-      (when (frame-iconified-p toolbar-news-frame)
-	(deiconify-frame toolbar-news-frame))
-      (select-frame toolbar-news-frame)
-      (raise-frame toolbar-news-frame))))
+  (if-fboundp 'gnus
+      (progn
+	(if (not toolbar-news-use-separate-frame)
+	    (gnus)
+	  (unless (frame-live-p toolbar-news-frame)
+	    (setq toolbar-news-frame (make-frame toolbar-news-frame-plist))
+	    (add-hook 'gnus-exit-gnus-hook
+		      (lambda ()
+			(when (frame-live-p toolbar-news-frame)
+			  (if (cdr (frame-list))
+			      (delete-frame toolbar-news-frame))
+			  (setq toolbar-news-frame nil))))
+	    (select-frame toolbar-news-frame)
+	    (gnus))
+	  (when (framep toolbar-news-frame)
+	    (when (frame-iconified-p toolbar-news-frame)
+	      (deiconify-frame toolbar-news-frame))
+	    (select-frame toolbar-news-frame)
+	    (raise-frame toolbar-news-frame))))
+    (error 'unimplemented "`gnus' package unavailable")))
 
 (defun toolbar-news ()
   "Run News."
--- a/lisp/very-early-lisp.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/very-early-lisp.el	Fri Mar 15 07:43:43 2002 +0000
@@ -27,8 +27,12 @@
 
 ;;; Commentary:
 
-;; This file must be loaded by temacs if temacs is to process bytecode
-;; or dumped-lisp.el files.
+;; This file must be loaded by temacs if temacs is to process bytecode or
+;; dumped-lisp.el files.  The functions in here are used by dumped-lisp.el,
+;; and by files called dumped-lisp.el in packages when they need to have
+;; stuff dumped into XEmacs. (???? I thought we got rid of this entirely.
+;; The only thing left is egg-its/dumped-lisp.el.  We should fix it, then
+;; combine this file into our own dumped-lisp.el. --ben
 
 ;;; Code:
 
--- a/lisp/wid-edit.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/wid-edit.el	Fri Mar 15 07:43:43 2002 +0000
@@ -1529,7 +1529,7 @@
 	     ;; buffer before from/to.
 	     (condition-case nil
 		 (widget-apply from-field :notify from-field)
-	       (error (debug "Before Change"))))))))
+	       (error (declare-fboundp (debug "Before Change")))))))))
 
 (defun widget-add-change ()
   (make-local-hook 'post-command-hook)
@@ -1549,7 +1549,7 @@
 	    (other (widget-field-find to)))
 	(when field
 	  (unless (eq field other)
-	    (debug "Change in different fields"))
+	    (declare-fboundp (debug "Change in different fields")))
 	  (let ((size (widget-get field :size)))
 	    (when size
 	      (let ((begin (widget-field-start field))
@@ -1574,7 +1574,7 @@
 			   (delete-backward-char 1)))))))
 	    (widget-specify-secret field))
 	  (widget-apply field :notify field)))
-    (error (debug "After Change"))))
+    (error (declare-fboundp (debug "After Change")))))
 
 
 ;;; Widget Functions
@@ -2034,9 +2034,9 @@
 
 (defun widget-url-link-action (widget &optional event)
   "Open the url specified by WIDGET."
-  (if (fboundp 'browse-url)
+  (if-fboundp 'browse-url
       (browse-url (widget-value widget))
-    (error "Cannot follow URLs in this XEmacs")))
+    (error 'unimplemented "No `browse-url' package; cannot follow URLs in this XEmacs")))
 
 ;;; The `function-link' Widget.
 
--- a/lisp/win32-native.el	Thu Mar 14 11:50:17 2002 +0000
+++ b/lisp/win32-native.el	Fri Mar 15 07:43:43 2002 +0000
@@ -57,9 +57,11 @@
 
 ;; Set the null device (for compile.el).
 ;; #### There should be such a global thingy as null-device - kkm
+(defvar grep-null-device)
 (setq grep-null-device "NUL")
 
 ;; Set the grep regexp to match entries with drive letters.
+(defvar grep-regexp-alist)
 (setq grep-regexp-alist
   '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3)))
 
--- a/man/ChangeLog	Thu Mar 14 11:50:17 2002 +0000
+++ b/man/ChangeLog	Fri Mar 15 07:43:43 2002 +0000
@@ -1,3 +1,10 @@
+2002-03-15  Ben Wing  <ben@xemacs.org>
+
+	* Makefile (new-users-guide-srcs):
+	* Makefile (extraclean):
+	Use -no-packages to avoid problems with package files shadowing
+	core files (e.g. unicode.el in mule-ucs).
+
 2002-03-14  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* emodules.texi (Using DEFUN): Add @ref{Lisp Primitives}.
--- a/man/Makefile	Thu Mar 14 11:50:17 2002 +0000
+++ b/man/Makefile	Fri Mar 15 07:43:43 2002 +0000
@@ -267,7 +267,7 @@
 #	$(MAKEINFO) -o $(INFODIR)/w3.info w3.texi
 
 # EMACS = ../src/xemacs
-# EMACSFLAGS = -batch -q -no-site-file
+# EMACSFLAGS = -batch -vanilla
 
 # $(INFODIR)/vm.info : vm.texi
 #	-$(EMACS) $(EMACSFLAGS) -insert vm.texi -l texinfmt \
@@ -374,7 +374,7 @@
 #	$(TEXI2HTML) -subdir $(HTMLDIR) w3.texi
 
 # EMACS = ../src/xemacs
-# EMACSFLAGS = -batch -q -no-site-file
+# EMACSFLAGS = -batch -vanilla
 
 # $(HTMLDIR)/vm.html : vm.texi
 #	-$(EMACS) $(EMACSFLAGS) -insert vm.texi -l texinfmt \
--- a/nt/ChangeLog	Thu Mar 14 11:50:17 2002 +0000
+++ b/nt/ChangeLog	Fri Mar 15 07:43:43 2002 +0000
@@ -1,3 +1,14 @@
+2002-03-15  Ben Wing  <ben@xemacs.org>
+
+	* xemacs.mak:
+	* xemacs.mak (BATCH):
+	* xemacs.mak (XEMACS_BATCH_PACKAGES):
+	* xemacs.mak (batch_test_emacs):
+	* xemacs.mak (MAKEINFO):
+	* xemacs.mak (makeinfo-test):
+	Use -no-packages to avoid problems with package files shadowing
+	core files (e.g. unicode.el in mule-ucs).
+
 2002-03-12  Ben Wing  <ben@xemacs.org>
 
 	* The Great Mule Merge: placeholder.
--- a/nt/xemacs.mak	Thu Mar 14 11:50:17 2002 +0000
+++ b/nt/xemacs.mak	Fri Mar 15 07:43:43 2002 +0000
@@ -1,6 +1,6 @@
 #   Makefile for Microsoft NMAKE
 #   Copyright (C) 1995 Board of Trustees, University of Illinois.
-#   Copyright (C) 1995, 1996, 2000, 2001 Ben Wing.
+#   Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing.
 #   Copyright (C) 1995 Sun Microsystems, Inc.
 #   Copyright (C) 1998 Free Software Foundation, Inc.
 #
@@ -943,8 +943,12 @@
 
 
 PROGNAME=$(SRC)\xemacs.exe
-TEMACS_BATCH="$(LIB_SRC)\i" "$(TEMACS)" -batch
-XEMACS_BATCH="$(LIB_SRC)\i" "$(PROGNAME)" -vanilla -batch
+BATCH = -no-packages -batch
+BATCH_PACKAGES = -vanilla -batch
+TEMACS_BATCH = "$(LIB_SRC)\i" "$(TEMACS)" $(BATCH)
+XEMACS_BATCH = "$(LIB_SRC)\i" "$(PROGNAME)" $(BATCH)
+XEMACS_BATCH_PACKAGES = "$(LIB_SRC)\i" "$(PROGNAME)" $(BATCH_PACKAGES)
+
 
 # Section handling automated tests starts here
 
@@ -954,7 +958,7 @@
 run_temacs    = $(temacs_loadup) run-temacs
 ## We have automated tests!!
 testdir=../tests/automated
-batch_test_emacs=-batch -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir)
+batch_test_emacs=$(BATCH) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir)
 
 # .PHONY: check check-temacs
 
@@ -994,7 +998,7 @@
 # Section handling info starts here
 
 !if !defined(MAKEINFO)
-MAKEINFO=$(XEMACS_BATCH) -l texinfmt -f batch-texinfo-format
+MAKEINFO=$(XEMACS_BATCH_PACKAGES) -l texinfmt -f batch-texinfo-format
 !endif
 
 MANDIR = $(XEMACS)\man
@@ -1175,7 +1179,7 @@
 	@<<makeinfo_test.bat
 @echo off
 if exist "$(MAKEINFO)" goto test_done
-@$(XEMACS_BATCH) -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))"
+@$(XEMACS_BATCH_PACKAGES) -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))"
 @if not errorlevel 1 goto suggest_makeinfo
 @echo XEmacs 'info' cannot be built!
 @echo Install XEmacs package 'texinfo' (see README.packages).
--- a/src/.cvsignore	Thu Mar 14 11:50:17 2002 +0000
+++ b/src/.cvsignore	Fri Mar 15 07:43:43 2002 +0000
@@ -21,3 +21,4 @@
 xemacs
 xemacs.dmp
 xemacs.opt
+*.tmp
--- a/src/ChangeLog	Thu Mar 14 11:50:17 2002 +0000
+++ b/src/ChangeLog	Fri Mar 15 07:43:43 2002 +0000
@@ -1,3 +1,27 @@
+2002-03-15  Ben Wing  <ben@xemacs.org>
+
+	* .cvsignore:
+	ignore .tmp files that are getting auto-created by VC.
+	
+	* Makefile.in.in (release):
+	* Makefile.in.in (fastdump):
+	* Makefile.in.in (dynodump_deps):
+	* Makefile.in.in (dump-elcs):
+	* Makefile.in.in (batch_test_emacs):
+	* Makefile.in.in (run-rtcmacs):
+	Use -no-packages to avoid problems with package files shadowing
+	core files (e.g. unicode.el in mule-ucs).
+
+	* alloc.c (disksave_object_finalization):
+	* emacs.c:
+	* emacs.c (argmatch):
+	* emacs.c (main_1):
+	* emacs.c (standard_args):
+	* emacs.c (vars_of_emacs):
+	* lisp.h:
+	add new -no-packages.  make sure list of args for sorting is
+	actually correct.  clean up arg parsing code.
+
 2002-03-12  Ben Wing  <ben@xemacs.org>
 
 	* The Great Mule Merge: placeholder.
--- a/src/Makefile.in.in	Thu Mar 14 11:50:17 2002 +0000
+++ b/src/Makefile.in.in	Fri Mar 15 07:43:43 2002 +0000
@@ -456,7 +456,9 @@
 mo_file = ${mo_dir}emacs.mo
 #endif
 
-temacs_loadup = ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el
+batch = -no-packages -batch
+batch_packages = -vanilla -batch
+temacs_loadup = ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/loadup.el
 dump_temacs   = ${temacs_loadup} dump
 run_temacs    = ${temacs_loadup} run-temacs
 debug_temacs = gdb ${EXE_TARGET}
@@ -466,9 +468,9 @@
 	ln ${EXE_TARGET} ${PROGNAME}
 #else
 	-if [ -w ${srcdir}/../lisp ]; then \
-	  w=`pwd`; cd ${srcdir} && $${w}/${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/inc-vers; \
+	  w=`pwd`; cd ${srcdir} && $${w}/${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/inc-vers; \
 	else true; fi
-	-./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/loadup.el dump
+	-./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/loadup.el dump
 	touch release
 #endif /* ! defined (CANNOT_DUMP) */
 
@@ -478,7 +480,7 @@
 	-${dump_temacs}
 	@if test -f $@;        then if test -f SATISFIED; then \
 		echo "Testing for Lisp shadows ..."; \
-		./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
+		./${PROGNAME} ${batch} -f list-load-path-shadows; fi; \
 		$(RM) SATISFIED; exit 0; fi; \
 	if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
 	$(RM) $@; \
@@ -487,19 +489,19 @@
 	@$(RM) $@
 	${dump_temacs}
 	@echo "Testing for Lisp shadows ..."
-	@./${PROGNAME} -batch -vanilla -f list-load-path-shadows
+	@./${PROGNAME} ${batch} -f list-load-path-shadows
 #endif
 
 fastdump: ${EXE_TARGET}
 	@$(RM) ${DUMP_TARGET} && touch SATISFIED
 	-${dump_temacs}
-	@./${PROGNAME} -batch -vanilla -f list-load-path-shadows
+	@./${PROGNAME} ${batch} -f list-load-path-shadows
 
 FRC.update-elc.stamp :
 
 update-elc.stamp : ${EXE_TARGET} FRC.update-elc.stamp
 	@touch NOBYTECOMPILE
-	./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el
+	./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/update-elc.el
 	@if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \
 	 $(RM) NOBYTECOMPILE
 
@@ -520,14 +522,14 @@
 
 ${libsrc}DOC: ${EXE_TARGET} update-elc.stamp
 	$(RM) ${libsrc}DOC; \
-	${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/make-docfile.el -- \
+	${DUMPENV} ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/make-docfile.el -- \
 		-o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \
 		${obj_src} ${mallocdocsrc} ${rallocdocsrc} ${extra_doc_files}
 
 dump_elcs: dump-elcs
 
 dump-elcs: ${EXE_TARGET}
-	-${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/update-elc.el
+	-${DUMPENV} ./${EXE_TARGET} -nd ${batch} -l ${srcdir}/../lisp/update-elc.el
 
 all-elc all-elcs:
 	cd .. && $(RECURSIVE_MAKE) all-elc
@@ -600,7 +602,7 @@
 
 ## We have automated tests!!
 testdir = ${srcdir}/../tests/automated
-batch_test_emacs = -batch -l ${testdir}/test-harness.el -f batch-test-emacs ${testdir}
+batch_test_emacs = ${batch} -l ${testdir}/test-harness.el -f batch-test-emacs ${testdir}
 
 .PHONY: check check-temacs
 check:
@@ -631,7 +633,7 @@
 	ignore POLL; \
 	check -access; \
 	suppress rui; \
-	runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \
+	runargs ${batch} -l ${srcdir}/../lisp/loadup.el run-temacs -vanilla; \
 	run' rtcmacs
 
 debug-temacs: ${EXE_TARGET}
--- a/src/alloc.c	Thu Mar 14 11:50:17 2002 +0000
+++ b/src/alloc.c	Fri Mar 15 07:43:43 2002 +0000
@@ -3415,6 +3415,7 @@
   /* Release hash tables for locate_file */
   Flocate_file_clear_hashing (Qt);
   uncache_home_directory ();
+  zero_out_command_line_status_vars ();
 
 #if defined(LOADHIST) && !(defined(LOADHIST_DUMPED) || \
 			   defined(LOADHIST_BUILTIN))
--- a/src/emacs.c	Thu Mar 14 11:50:17 2002 +0000
+++ b/src/emacs.c	Fri Mar 15 07:43:43 2002 +0000
@@ -434,9 +434,16 @@
 /* Nonzero means don't perform site-modules searches at startup */
 int inhibit_site_modules;
 
+/* Nonzero means don't load user-init or site-start file */
+int vanilla_inhibiting;
+
 /* Nonzero means don't respect early packages at startup */
 int inhibit_early_packages;
 
+/* Nonzero means don't respect any packages at startup -- act as if they
+   don't exist. */
+int inhibit_all_packages;
+
 /* Nonzero means don't load package autoloads at startup */
 int inhibit_autoloads;
 
@@ -597,12 +604,12 @@
 
 
 
-/* Test whether the next argument in ARGV matches SSTR or a prefix of
-   LSTR (at least MINLEN characters).  If so, then if VALPTR is non-null
-   (the argument is supposed to have a value) store in *VALPTR either
-   the next argument or the portion of this one after the equal sign.
-   ARGV is read starting at position *SKIPPTR; this index is advanced
-   by the number of arguments used.
+/* Test whether the next argument in ARGV matches SSTR or a prefix of LSTR
+   (at least MINLEN characters; if MINLEN is 0, set to size of LSTR).  If
+   so, then if VALPTR is non-null (the argument is supposed to have a
+   value) store in *VALPTR either the next argument or the portion of this
+   one after the equal sign.  ARGV is read starting at position *SKIPPTR;
+   this index is advanced by the number of arguments used.
 
    Too bad we can't just use getopt for all of this, but we don't have
    enough information to do it right.  */
@@ -635,6 +642,8 @@
     }
   arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL
 	    ? p - arg : (int) strlen (arg));
+  if (lstr && !minlen)
+    minlen = strlen (lstr);
   if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0)
     return 0;
   else if (valptr == NULL)
@@ -717,7 +726,7 @@
   /* 19-Jun-1995 -baw
    * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman
    * <cedman@princeton.edu>.  Note that even Carl doesn't know what this
-   * does; it was provided by NeXT, and it presumable makes NS's mallocator
+   * does; it was provided by NeXT, and it presumably makes NS's mallocator
    * work with dumping.  But malloc_jumpstart() and malloc_freezedry() in
    * unexnext.c are both completely undocumented, even in NS header files!
    * But hey, it solves all NS related memory problems, so who's
@@ -790,8 +799,14 @@
   inhibit_window_system = 1;
 #endif
 
-  /* Handle the -sd/--show-dump-id switch, which means show the hex dump_id and quit */
-  if (argmatch (argv, argc, "-sd", "--show-dump-id", 9, NULL, &skip_args))
+  /* NOTE NOTE NOTE: Keep the following args in sync with the big list of
+     arguments below in standard_args[], with the help text in startup.el,
+     and with the list of non-clobbered variables near where pdump_load()
+     is called! */
+  
+  /* Handle the -sd/--show-dump-id switch, which means show the hex dump_id
+     and quit */
+  if (argmatch (argv, argc, "-sd", "--show-dump-id", 0, NULL, &skip_args))
     {
 #ifdef PDUMP
       printf ("%08x\n", dump_id);
@@ -804,7 +819,7 @@
   /* Handle the -t switch, which specifies filename to use as terminal */
   {
     Extbyte *term;
-    if (argmatch (argv, argc, "-t", "--terminal", 4, &term, &skip_args))
+    if (argmatch (argv, argc, "-t", "--terminal", 0, &term, &skip_args))
       {
 	retry_close (0);
 	retry_close (1);
@@ -822,18 +837,17 @@
       }
   }
 
-  /* Handle the --no-dump-file/-nd switch, which means don't load the dump file (ignored when not using pdump) */
-  if (argmatch (argv, argc, "-nd", "--no-dump-file", 7, NULL, &skip_args))
-    {
-      nodumpfile = 1;
-    }
+  /* Handle the --no-dump-file/-nd switch, which means don't load the dump
+     file (ignored when not using pdump) */
+  if (argmatch (argv, argc, "-nd", "--no-dump-file", 0, NULL, &skip_args))
+    nodumpfile = 1;
 
   /* Handle -nw switch */
-  if (argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args))
+  if (argmatch (argv, argc, "-nw", "--no-windows", 0, NULL, &skip_args))
     inhibit_window_system = 1;
 
   /* Handle the -batch switch, which means don't do interactive display.  */
-  if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args))
+  if (argmatch (argv, argc, "-batch", "--batch", 0, NULL, &skip_args))
     {
 #if 0 /* I don't think this is correct. */
       inhibit_autoloads = 1;
@@ -846,59 +860,51 @@
      versions of Unicode-split API's even on Windows NT, which has
      full Unicode support.  This helps flush out problems in the code
      we've written to convert between ANSI and Unicode. */
-  if (argmatch (argv, argc, "-nuni", "--no-unicode-lib-calls", 6, NULL,
+  if (argmatch (argv, argc, "-nuni", "--no-unicode-lib-calls", 0, NULL,
 		&skip_args))
     no_mswin_unicode_lib_calls = 1;
 #endif /* WIN32_NATIVE */
 
-  /* #### is it correct that -debug-paths is handled here (and presumably
-     removed), and then checked again below? */
   if (argmatch (argv, argc, "-debug-paths", "--debug-paths",
-		11, NULL, &skip_args))
-      debug_paths = 1;
-
-  /* Partially handle -no-autoloads, -no-early-packages and -vanilla.  Packages */
-  /* are searched prior to the rest of the command line being parsed in */
-  /* startup.el */
+		0, NULL, &skip_args))
+    debug_paths = 1;
+
+  /* Handle (maybe partially) some inhibiting flags.  Packages are searched
+     prior to the rest of the command line being parsed in startup.el. */
+
+  if (argmatch (argv, argc, "-no-packages", "--no-packages",
+		0, NULL, &skip_args))
+    {
+      inhibit_all_packages = 1;
+      inhibit_early_packages = 1;
+      vanilla_inhibiting = 1;
+    }
+
   if (argmatch (argv, argc, "-no-early-packages", "--no-early-packages",
-		6, NULL, &skip_args))
+		0, NULL, &skip_args))
+    inhibit_early_packages = 1;
+
+#ifdef HAVE_SHLIB
+  if (argmatch (argv, argc, "-no-site-modules", "--no-site-modules",
+		0, NULL, &skip_args))
+#endif
+    inhibit_site_modules = 1;
+  
+  if (argmatch (argv, argc, "-vanilla", "--vanilla",
+		0, NULL, &skip_args))
     {
       inhibit_early_packages = 1;
-      skip_args--;
-    }
-#ifdef HAVE_SHLIB
-  if (argmatch (argv, argc, "-no-site-modules", "--no-site-modules",
-		9, NULL, &skip_args))
-    {
-      inhibit_site_modules = 1;
-      skip_args--;
-    }
-#else
-  inhibit_site_modules = 1;
-#endif
-  if (argmatch (argv, argc, "-vanilla", "--vanilla",
-		7, NULL, &skip_args))
-    {
-      inhibit_early_packages = 1;
-      skip_args--;
+      vanilla_inhibiting = 1;
     }
 
   if (argmatch (argv, argc, "-no-autoloads", "--no-autoloads",
-		7, NULL, &skip_args))
+		0, NULL, &skip_args))
     {
-      /* Inhibit everything */
       inhibit_autoloads = 1;
-      skip_args--;
+      inhibit_early_packages = 1;
+      vanilla_inhibiting = 1;
     }
 
-  if (argmatch (argv, argc, "-debug-paths", "--debug-paths",
-		6, NULL, &skip_args))
-    {
-      debug_paths = 1;
-      skip_args--;
-    }
-
-
   /* Partially handle the -version and -help switches: they imply -batch,
      but are not removed from the list. */
   if (argmatch (argv, argc, "-help", "--help",   3, NULL, &skip_args))
@@ -1042,16 +1048,18 @@
       XEmacs is getting at run-time.  Such variables must be saved here,
       and restored after loading the dumped data.
 
-      Boy, this is ugly, but how else to do it?
+      (Remember: Only LISP-visible options that are set up to this point
+      need to be listed here.)
       */
 
       /* noninteractive1 is saved in noninteractive, which isn't
 	 LISP-visible */
       int inhibit_early_packages_save = inhibit_early_packages;
       int inhibit_autoloads_save      = inhibit_autoloads;
+      int inhibit_all_packages_save   = inhibit_all_packages;
+      int vanilla_inhibiting_save     = vanilla_inhibiting;
       int debug_paths_save            = debug_paths;
-      /* #### Give inhibit-site-lisp a command switch?  If so, uncomment: */
-      /* int inhibit_site_lisp_save      = inhibit_site_lisp; */
+      int inhibit_site_lisp_save      = inhibit_site_lisp;
       int inhibit_site_modules_save   = inhibit_site_modules;
 
       initialized = pdump_load (argv[0]);
@@ -1060,9 +1068,10 @@
       noninteractive1        = noninteractive;
       inhibit_early_packages = inhibit_early_packages_save;
       inhibit_autoloads      = inhibit_autoloads_save;
+      inhibit_all_packages   = inhibit_all_packages_save;
+      vanilla_inhibiting     = vanilla_inhibiting_save;
       debug_paths            = debug_paths_save;
-      /* #### Give inhibit-site-lisp a command switch?  If so, uncomment: */
-      /* inhibit_site_lisp      = inhibit_site_lisp_save; */
+      inhibit_site_lisp      = inhibit_site_lisp_save;
       inhibit_site_modules   = inhibit_site_modules_save;
 
       if (initialized)
@@ -2316,7 +2325,8 @@
 
 static const struct standard_args standard_args[] =
 {
-  /* Handled by main_1 above: */
+  /* Handled by main_1 above: Each must have its own priority and must be
+     in the order mentioned in main_1. */
   { "-sd", "--show-dump-id", 105, 0 },
   { "-t", "--terminal", 100, 1 },
   { "-nd", "--no-dump-file", 95, 0 },
@@ -2326,27 +2336,27 @@
   { "-nuni", "--no-unicode-lib-calls", 83, 0 },
 #endif /* WIN32_NATIVE */
   { "-debug-paths", "--debug-paths", 82, 0 },
-  { "-help", "--help", 80, 0 },
-  { "-version", "--version", 75, 0 },
-  { "-V", 0, 75, 0 },
-  { "-d", "--display", 80, 1 },
-  { "-display", 0, 80, 1 },
-  { "-NXHost",  0, 79, 0 },
-  { "-MachLaunch", 0, 79, 0},
+  { "-no-packages", "--no-packages", 81, 0 },
+  { "-no-early-packages", "--no-early-packages", 80, 0 },
+  { "-no-site-modules", "--no-site-modules", 78, 0 },
+  { "-vanilla", "--vanilla", 76, 0 },
+  { "-no-autoloads", "--no-autoloads", 74, 0 },
+  { "-help", "--help", 72, 0 },
+  { "-version", "--version", 70, 0 },
+  { "-V", 0, 68, 0 },
+  { "-d", "--display", 66, 1 },
+  { "-display", 0, 64, 1 },
 
   /* Handled by command-line-early in startup.el: */
   { "-q", "--no-init-file", 50, 0 },
-  { "-unmapped", 0, 50, 0 },
   { "-no-init-file", 0, 50, 0 },
-  { "-vanilla", "--vanilla", 50, 0 },
-  { "-no-autoloads", "--no-autoloads", 50, 0 },
-  { "-no-site-file", "--no-site-file", 40, 0 },
-  { "-no-early-packages", "--no-early-packages", 35, 0 },
-  { "-u", "--user", 30, 1 },
-  { "-user", 0, 30, 1 },
-  { "-debug-init", "--debug-init", 20, 0 },
-  { "-debug-paths", "--debug-paths", 20, 0 },
-  { "-eol", "--enable-eol-detection", 20, 0 },
+  { "-no-site-file", "--no-site-file", 50, 0 },
+  { "-unmapped", "--unmapped", 50, 0 },
+  { "-u", "--user", 50, 1 },
+  { "-user", 0, 50, 1 },
+  { "-user-init-file", "--user-init-file", 50, 1 },
+  { "-user-init-directory", "--user-init-directory", 50, 1 },
+  { "-debug-init", "--debug-init", 50, 0 },
 
   /* Xt options: */
   { "-i", "--icon-type", 15, 0 },
@@ -2375,6 +2385,8 @@
   { "-hb", "--horizontal-scroll-bars", 5, 0 },
   { "-vb", "--vertical-scroll-bars", 5, 0 },
 
+  { "-eol", "--enable-eol-detection", 2, 0 },
+  { "-enable-eol-detection", 0, 2, 0 },
   /* These have the same priority as ordinary file name args,
      so they are not reordered with respect to those.  */
   { "-L", "--directory", 0, 1 },
@@ -3621,6 +3633,31 @@
   DEFSYMBOL (Qsave_buffers_kill_emacs);
 }
 
+/* Yuck!  These variables may get set from command-line options when
+   dumping; if we don't clear them, they will still be on once the dumped
+   XEmacs reloads. (not an issue with pdump, as we kludge around this in
+   main_1().) */
+
+void
+zero_out_command_line_status_vars (void)
+{
+  vanilla_inhibiting = 0;
+  inhibit_early_packages = 0;
+  inhibit_all_packages = 0;
+  inhibit_autoloads = 0;
+  debug_paths = 0;
+#ifndef INHIBIT_SITE_LISP
+  inhibit_site_lisp = 0;
+#else
+  inhibit_site_lisp = 1;
+#endif
+#ifndef INHIBIT_SITE_MODULES
+  inhibit_site_modules = 0;
+#else
+  inhibit_site_modules = 1;
+#endif
+}
+
 void
 vars_of_emacs (void)
 {
@@ -3650,11 +3687,12 @@
 */ );
 
 #if 0 /* FSFmacs */
-  xxDEFVAR_LISP ("installation-directory", &Vinstallation_directory,
-    "A directory within which to look for the `lib-src' and `etc' directories.\n"
-"This is non-nil when we can't find those directories in their standard\n"
-"installed locations, but we can find them\n"
-"near where the XEmacs executable was found.");
+  xxDEFVAR_LISP ("installation-directory", &Vinstallation_directory /*
+A directory within which to look for the `lib-src' and `etc' directories.
+This is non-nil when we can't find those directories in their standard
+installed locations, but we can find them ear where the XEmacs executable
+was found.
+*/ );
 #endif
 
   DEFVAR_LISP ("system-type", &Vsystem_type /*
@@ -3754,10 +3792,20 @@
 Non-nil means XEmacs is running without interactive terminal.
 */ );
 
+  DEFVAR_BOOL ("vanilla-inhibiting", &vanilla_inhibiting /*
+Set to non-nil when the user-init and site-start files should not be loaded.
+*/ );
+
   DEFVAR_BOOL ("inhibit-early-packages", &inhibit_early_packages /*
 Set to non-nil when the early packages should not be respected at startup.
 */ );
 
+  DEFVAR_BOOL ("inhibit-all-packages", &inhibit_all_packages /*
+Set to non-nil when the no packages should not be respected at startup.
+XEmacs will utterly ignore the packages -- not in load-path, not set up as
+autoloads, nothing.
+*/ );
+
   DEFVAR_BOOL ("inhibit-autoloads", &inhibit_autoloads /*
 Set to non-nil when autoloads should not be loaded at startup.
 */ );
--- a/src/lisp.h	Thu Mar 14 11:50:17 2002 +0000
+++ b/src/lisp.h	Fri Mar 15 07:43:43 2002 +0000
@@ -2849,6 +2849,7 @@
 void debug_break (void);
 int debug_can_access_memory (void *ptr, Bytecount len);
 void really_abort (void);
+void zero_out_command_line_status_vars (void);
 
 /* Defined in eval.c */
 DECLARE_DOESNT_RETURN (signal_error_1 (Lisp_Object, Lisp_Object));