Mercurial > hg > xemacs-beta
changeset 5284:d27c1ee1943b
Make the order of preloaded-file-list more sane.
lisp/ChangeLog addition:
2010-10-12 Aidan Kehoe <kehoea@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.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 12 Oct 2010 21:11:46 +0100 |
parents | be436ac36ba4 |
children | 99de5fd48e87 |
files | lisp/ChangeLog lisp/abbrev.el lisp/cl-extra.el lisp/cmdloop.el lisp/custom.el lisp/dumped-lisp.el lisp/faces.el lisp/packages.el lisp/post-gc.el lisp/subr.el |
diffstat | 10 files changed, 56 insertions(+), 111 deletions(-) [+] |
line wrap: on
line diff
--- 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@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@parhasard.net> * bytecomp.el (byte-compile-constp) Forms quoted with FUNCTION are
--- 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."
--- 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
--- 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))
--- 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
--- 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 - "find-paths" - "packages" ; Bootstrap run-time lisp environment - "setup-paths" - - ;; use custom-declare-variable-early, not defcustom, in these files - "subr" ; load the most basic Lisp functions + "cl" + "cl-extra" ; also loads cl-macs if we're running interpreted. + "cl-seq" "post-gc" - "replace" ; match-string used in version.el. - "version" - - "cl" - "cl-extra" - "cl-seq" + "custom" ; Before the world so everything can be customized + "cus-start" ; for customization of builtin variables + "find-paths" + "packages" + "setup-paths" + "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"
--- 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, ...)
--- 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.
--- 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)
--- 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)