Ar an triú lá de mí Feabhra, scríobh Ben Wing:
[...] If these files don't actually do anything, why not move
them down
below the basic init code and remove the comments about their
restrictions?
I'd suggest trying to move cl-*.el as high as possible so we can use
the stuff in them everywhere.
Maybe an order like this:
1. backquote
2. bytecomp-runtime
3. post-gc
4. subr
5. version
6. cl*
7. custom, cus-start
etc.
`replace' does not need to be so early -- despite the comment in
dumped-lisp, `version' doesn't use `match-string' any more. Also,
cus-start has some hacks to work around `replace' being so early,
which could be removed if replace were later.
Nothing in custom or cus-start depends on widget, so it should go later.
cl.el does depend on version.el.
Also, `custom-declare-variable-early' in subr.el doesn't appear to be
needed at all.
Possibly we should move `subr' after custom.
I’ve gone ahead with this. I don’t anticipate any problems, none of the
package code can realistically depend on the order of preloaded-file-list,
and any real problems will have been flushed out at build time.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1286914306 -3600
# Node ID d27c1ee1943b510e6e76337ee892a362dfa5f780
# Parent be436ac36ba448c42ea9e6305fb6ad2952be6955
Make the order of preloaded-file-list more sane.
lisp/ChangeLog addition:
2010-10-12 Aidan Kehoe <kehoea(a)parhasard.net>
* abbrev.el (fundamental-mode-abbrev-table, global-abbrev-table):
Create both these abbrev tables using the usual
#'define-abbrev-table calls, rather than attempting to
special-case them.
* cl-extra.el: Force cl-macs to be loaded here, if cl-extra.el is
being loaded interpreted. Previously other, later files would
redundantly call (load "cl-macs") when interpreted, it's more
reasonable to do it here, once.
* cmdloop.el (read-quoted-char-radix): Use defcustom here, we
don't have any dump-order dependencies that would prevent that.
* custom.el (eval-when-compile): Don't load cl-macs when
interpreted or when byte-compiling, rely on cl-extra.el in the
former case and the appropriate entry in bytecomp-load-hook in the
latter. Get rid of custom-declare-variable-list, we have no
dump-time dependencies that would require it.
* faces.el (eval-when-compile): Don't load cl-macs when
interpreted or when byte-compiling.
* packages.el: Remove some inaccurate comments.
* post-gc.el (cleanup-simple-finalizers): Use #'delete-if-not
here, now the order of preloaded-file-list has been changed to
make it available.
* subr.el (custom-declare-variable-list): Remove. No need for it.
Also remove a stub define-abbrev-table from this file, given the
current order of preloaded-file-list there's no need for it.
diff -r be436ac36ba4 -r d27c1ee1943b lisp/ChangeLog
--- a/lisp/ChangeLog Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/ChangeLog Tue Oct 12 21:11:46 2010 +0100
@@ -1,3 +1,30 @@
+2010-10-12 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * abbrev.el (fundamental-mode-abbrev-table, global-abbrev-table):
+ Create both these abbrev tables using the usual
+ #'define-abbrev-table calls, rather than attempting to
+ special-case them.
+ * cl-extra.el: Force cl-macs to be loaded here, if cl-extra.el is
+ being loaded interpreted. Previously other, later files would
+ redundantly call (load "cl-macs") when interpreted, it's more
+ reasonable to do it here, once.
+ * cmdloop.el (read-quoted-char-radix): Use defcustom here, we
+ don't have any dump-order dependencies that would prevent that.
+ * custom.el (eval-when-compile): Don't load cl-macs when
+ interpreted or when byte-compiling, rely on cl-extra.el in the
+ former case and the appropriate entry in bytecomp-load-hook in the
+ latter. Get rid of custom-declare-variable-list, we have no
+ dump-time dependencies that would require it.
+ * faces.el (eval-when-compile): Don't load cl-macs when
+ interpreted or when byte-compiling.
+ * packages.el: Remove some inaccurate comments.
+ * post-gc.el (cleanup-simple-finalizers): Use #'delete-if-not
+ here, now the order of preloaded-file-list has been changed to
+ make it available.
+ * subr.el (custom-declare-variable-list): Remove. No need for it.
+ Also remove a stub define-abbrev-table from this file, given the
+ current order of preloaded-file-list there's no need for it.
+
2010-10-10 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-constp) Forms quoted with FUNCTION are
diff -r be436ac36ba4 -r d27c1ee1943b lisp/abbrev.el
--- a/lisp/abbrev.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/abbrev.el Tue Oct 12 21:11:46 2010 +0100
@@ -120,31 +120,12 @@
(setplist sym (or count 0))
name))
+(define-abbrev-table 'fundamental-mode-abbrev-table nil)
+(and (eq major-mode 'fundamental-mode)
+ (not local-abbrev-table)
+ (setq local-abbrev-table fundamental-mode-abbrev-table))
-;; Fixup stuff from bootstrap def of define-abbrev-table in subr.el
-(let ((l abbrev-table-name-list))
- (while l
- (let ((fixup (car l)))
- (if (consp fixup)
- (progn
- (setq abbrev-table-name-list (delq fixup abbrev-table-name-list))
- (define-abbrev-table (car fixup) (cdr fixup))))
- (setq l (cdr l))))
- ;; These are no longer initialized by C code
- (if (not global-abbrev-table)
- (progn
- (setq global-abbrev-table (make-abbrev-table))
- (setq abbrev-table-name-list (cons 'global-abbrev-table
- abbrev-table-name-list))))
- (if (not fundamental-mode-abbrev-table)
- (progn
- (setq fundamental-mode-abbrev-table (make-abbrev-table))
- (setq abbrev-table-name-list (cons 'fundamental-mode-abbrev-table
- abbrev-table-name-list))))
- (and (eq major-mode 'fundamental-mode)
- (not local-abbrev-table)
- (setq local-abbrev-table fundamental-mode-abbrev-table)))
-
+(define-abbrev-table 'global-abbrev-table nil)
(defun define-global-abbrev (name expansion)
"Define ABBREV as a global abbreviation for EXPANSION."
diff -r be436ac36ba4 -r d27c1ee1943b lisp/cl-extra.el
--- a/lisp/cl-extra.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/cl-extra.el Tue Oct 12 21:11:46 2010 +0100
@@ -657,6 +657,11 @@
(prog1 (cl-prettyprint form)
(message ""))))
+;; XEmacs addition; force cl-macs to be available from here on when
+;; compiling files to be dumped. This is more reasonable than forcing other
+;; files to do the same, multiple times.
+(eval-when-compile (or (cl-compiling-file) (load "cl-macs")))
+
(run-hooks 'cl-extra-load-hook)
;; XEmacs addition
diff -r be436ac36ba4 -r d27c1ee1943b lisp/cmdloop.el
--- a/lisp/cmdloop.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/cmdloop.el Tue Oct 12 21:11:46 2010 +0100
@@ -564,12 +564,7 @@
;; BEGIN SYNCHED WITH FSF 21.2.
-(defvar read-quoted-char-radix 8
- "*Radix for \\[quoted-insert] and other uses of `read-quoted-char'.
-Legitimate radix values are 8, 10 and 16.")
-
-(custom-declare-variable-early
- 'read-quoted-char-radix 8
+(defcustom read-quoted-char-radix 8
"*Radix for \\[quoted-insert] and other uses of `read-quoted-char'.
Legitimate radix values are 8, 10 and 16."
:type '(choice (const 8) (const 10) (const 16))
diff -r be436ac36ba4 -r d27c1ee1943b lisp/custom.el
--- a/lisp/custom.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/custom.el Tue Oct 12 21:11:46 2010 +0100
@@ -44,12 +44,10 @@
(provide 'custom)
(eval-when-compile
- (load "cl-macs" nil t)
;; To elude warnings.
(require 'cus-face))
(autoload 'custom-declare-face "cus-face")
-(autoload 'defun* "cl-macs")
(require 'widget)
@@ -1056,12 +1054,7 @@
;;; The End.
-;; Process the defcustoms for variables loaded before this file.
-;; `custom-declare-variable-list' is defvar'd in subr.el. Utility programs
-;; run from temacs that do not load subr.el should defvar it themselves.
-;; (As of 21.5.11, make-docfile.el.)
-(while custom-declare-variable-list
- (apply 'custom-declare-variable (car custom-declare-variable-list))
- (setq custom-declare-variable-list (cdr custom-declare-variable-list)))
+;; XEmacs; we order preloaded-file-list such that there's no need for
+;; custom-declare-variable-list.
;; custom.el ends here
diff -r be436ac36ba4 -r d27c1ee1943b lisp/dumped-lisp.el
--- a/lisp/dumped-lisp.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/dumped-lisp.el Tue Oct 12 21:11:46 2010 +0100
@@ -23,28 +23,19 @@
"backquote" ; needed for defsubst etc.
"bytecomp-runtime" ; define defsubst
+ "subr" ; load the most basic Lisp functions
+ "cl"
+ "cl-extra" ; also loads cl-macs if we're running interpreted.
+ "cl-seq"
+ "post-gc"
+ "version"
+ "custom" ; Before the world so everything can be customized
+ "cus-start" ; for customization of builtin variables
"find-paths"
- "packages" ; Bootstrap run-time lisp environment
+ "packages"
"setup-paths"
-
- ;; use custom-declare-variable-early, not defcustom, in these files
-
- "subr" ; load the most basic Lisp functions
- "post-gc"
- "replace" ; match-string used in version.el.
-
- "version"
-
- "cl"
- "cl-extra"
- "cl-seq"
+ "replace"
"widget"
- "custom" ; Before the world so everything can be
- ; customized
- "cus-start" ; for customization of builtin variables
-
- ;; OK, you can use defcustom from here on
-
"cmdloop"
"keymap"
"syntax"
diff -r be436ac36ba4 -r d27c1ee1943b lisp/faces.el
--- a/lisp/faces.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/faces.el Tue Oct 12 21:11:46 2010 +0100
@@ -49,9 +49,7 @@
;; To elude the warnings for font functions. (Normally autoloaded when
;; font-create-object is called)
-(eval-when-compile
- (require 'font)
- (load "cl-macs"))
+(eval-when-compile (require 'font))
(defgroup faces nil
"Support for multiple text attributes (fonts, colors, ...)
diff -r be436ac36ba4 -r d27c1ee1943b lisp/packages.el
--- a/lisp/packages.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/packages.el Tue Oct 12 21:11:46 2010 +0100
@@ -31,23 +31,7 @@
;; This file is dumped with XEmacs.
;; This file provides low level facilities for XEmacs startup --
-;; particularly regarding the package setup. This code has to run in
-;; what we call "bare temacs" -- i.e. XEmacs without the usual Lisp
-;; environment. Pay special attention:
-
-;; - not to use the `lambda' macro. Use #'(lambda ...) instead.
-;; (this goes for any package loaded before `subr.el'.)
-;;
-;; - not to use macros, because they are not yet available (and this
-;; file must be loadable uncompiled.) Built in macros, such as
-;; `when' and `unless' are fine, of course.
-;;
-;; - not to use `defcustom'. If you must add user-customizable
-;; variables here, use `defvar', and add the variable to
-;; `cus-start.el'.
-
-;; Because of all this, make sure that the stuff you put here really
-;; belongs here.
+;; particularly regarding the package setup.
;; This file requires find-paths.el.
diff -r be436ac36ba4 -r d27c1ee1943b lisp/post-gc.el
--- a/lisp/post-gc.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/post-gc.el Tue Oct 12 21:11:46 2010 +0100
@@ -56,15 +56,8 @@
(defun cleanup-simple-finalizers (alist)
"Clean up `simple-finalizer-ephemerons'."
- ;; We have to do this by hand because DELETE-IF isn't defined yet.
- (let ((current simple-finalizer-ephemerons)
- (prev nil))
- (while (not (null current))
- (if (not (ephemeron-ref (car current)))
- (if (null prev)
- (setq simple-finalizer-ephemerons (cdr current))
- (setcdr prev (cdr current)))
- (setq prev current))
- (setq current (cdr current)))))
+ (and simple-finalizer-ephemerons
+ (setq simple-finalizer-ephemerons
+ (delete-if-not #'ephemeron-ref simple-finalizer-ephemerons))))
(add-hook 'post-gc-hook 'cleanup-simple-finalizers)
diff -r be436ac36ba4 -r d27c1ee1943b lisp/subr.el
--- a/lisp/subr.el Tue Oct 12 18:14:12 2010 +0100
+++ b/lisp/subr.el Tue Oct 12 21:11:46 2010 +0100
@@ -39,18 +39,9 @@
;; BEGIN SYNCHED WITH FSF 21.2
-;;; Code:
-(defvar custom-declare-variable-list nil
- "Record `defcustom' calls made before `custom.el' is loaded to handle
them.
-Each element of this list holds the arguments to one call to `defcustom'.")
+;; XEmacs; no need for custom-declare-variable-list, preloaded-file-list is
+;; ordered to make it unnecessary.
-;; Use this, rather than defcustom, in subr.el and other files loaded
-;; before custom.el. See dumped-lisp.el.
-(defun custom-declare-variable-early (&rest arguments)
- (setq custom-declare-variable-list
- (cons arguments custom-declare-variable-list)))
-
-
(defun macro-declaration-function (macro decl)
"Process a declaration found in a macro definition.
This is set as the value of the variable `macro-declaration-function'.
@@ -1586,19 +1577,6 @@
(define-function 'eval-in-buffer 'with-current-buffer)
(make-obsolete 'eval-in-buffer 'with-current-buffer)
-;;; The real defn is in abbrev.el but some early callers
-;;; (eg lisp-mode-abbrev-table) want this before abbrev.el is loaded...
-
-(if (not (fboundp 'define-abbrev-table))
- (progn
- (setq abbrev-table-name-list '())
- (fset 'define-abbrev-table
- (function (lambda (name defs)
- ;; These are fixed-up when abbrev.el loads.
- (setq abbrev-table-name-list
- (cons (cons name defs)
- abbrev-table-name-list)))))))
-
;;; `functionp' has been moved into C.
;;(defun functionp (object)
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.” --
Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches