From dbc65a5e5bddaa8108bd5d43d900364f2ce1f57b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 27 Jun 2007 19:17:53 +0000 Subject: Use cl-loaddefs.el rather than manual autoloads. --- lisp/emacs-lisp/cl.el | 118 +++++++++++++++----------------------------------- 1 file changed, 35 insertions(+), 83 deletions(-) (limited to 'lisp/emacs-lisp/cl.el') diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 83dffb41b2d..41dc4432b3f 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -585,96 +585,48 @@ If ALIST is non-nil, the new pairs are prepended to it." ;;; Miscellaneous. -(defvar cl-fake-autoloads nil - "Non-nil means don't make CL functions autoload.") - ;;; Autoload the other portions of the package. ;; We want to replace the basic versions of dolist, dotimes, declare below. (fmakunbound 'dolist) (fmakunbound 'dotimes) (fmakunbound 'declare) -(mapcar (function - (lambda (set) - (let ((file (if cl-fake-autoloads "" (car set)))) - (mapcar (function - (lambda (func) - (autoload func (car set) nil nil (nth 1 set)))) - (cddr set))))) - '(("cl-extra" nil - coerce equalp cl-map-keymap maplist mapc mapl mapcan mapcon - cl-map-keymap cl-map-keymap-recursively cl-map-intervals - cl-map-overlays cl-set-frame-visible-p cl-float-limits - gcd lcm isqrt floor* ceiling* truncate* round* - mod* rem* signum random* make-random-state random-state-p - subseq concatenate cl-mapcar-many map some every notany - notevery revappend nreconc list-length tailp copy-tree get* getf - cl-set-getf cl-do-remf remprop cl-make-hash-table cl-hash-lookup - cl-gethash cl-puthash cl-remhash cl-clrhash cl-maphash cl-hash-table-p - cl-hash-table-count cl-progv-before cl-prettyexpand - cl-macroexpand-all) - ("cl-seq" nil - reduce fill replace remove* remove-if remove-if-not - delete* delete-if delete-if-not remove-duplicates - delete-duplicates substitute substitute-if substitute-if-not - nsubstitute nsubstitute-if nsubstitute-if-not find find-if - find-if-not position position-if position-if-not count count-if - count-if-not mismatch search sort* stable-sort merge member* - member-if member-if-not cl-adjoin assoc* assoc-if assoc-if-not - rassoc* rassoc-if rassoc-if-not union nunion intersection - nintersection set-difference nset-difference set-exclusive-or - nset-exclusive-or subsetp subst-if subst-if-not nsubst nsubst-if - nsubst-if-not sublis nsublis tree-equal) - ("cl-macs" nil - gensym gentemp typep cl-do-pop get-setf-method - cl-struct-setf-expander compiler-macroexpand cl-compile-time-init) - ("cl-macs" t - defun* defmacro* function* destructuring-bind eval-when - load-time-value case ecase typecase etypecase - block return return-from loop do do* dolist dotimes do-symbols - do-all-symbols psetq progv flet labels macrolet symbol-macrolet - lexical-let lexical-let* multiple-value-bind multiple-value-setq - locally the declare define-setf-method defsetf define-modify-macro - setf psetf remf shiftf rotatef letf letf* callf callf2 defstruct - check-type assert ignore-errors define-compiler-macro))) +(load "cl-loaddefs") ;;; Define data for indentation and edebug. -(mapcar (function - (lambda (entry) - (mapcar (function - (lambda (func) - (put func 'lisp-indent-function (nth 1 entry)) - (put func 'lisp-indent-hook (nth 1 entry)) - (or (get func 'edebug-form-spec) - (put func 'edebug-form-spec (nth 2 entry))))) - (car entry)))) - '(((defun* defmacro*) 2) - ((function*) nil - (&or symbolp ([&optional 'macro] 'lambda (&rest sexp) &rest form))) - ((eval-when) 1 (sexp &rest form)) - ((declare) nil (&rest sexp)) - ((the) 1 (sexp &rest form)) - ((case ecase typecase etypecase) 1 (form &rest (sexp &rest form))) - ((block return-from) 1 (sexp &rest form)) - ((return) nil (&optional form)) - ((do do*) 2 ((&rest &or symbolp (symbolp &optional form form)) - (form &rest form) - &rest form)) - ((do-symbols) 1 ((symbolp form &optional form form) &rest form)) - ((do-all-symbols) 1 ((symbolp form &optional form) &rest form)) - ((psetq setf psetf) nil edebug-setq-form) - ((progv) 2 (&rest form)) - ((flet labels macrolet) 1 - ((&rest (sexp sexp &rest form)) &rest form)) - ((symbol-macrolet lexical-let lexical-let*) 1 - ((&rest &or symbolp (symbolp form)) &rest form)) - ((multiple-value-bind) 2 ((&rest symbolp) &rest form)) - ((multiple-value-setq) 1 ((&rest symbolp) &rest form)) - ((incf decf remf pushnew shiftf rotatef) nil (&rest form)) - ((letf letf*) 1 ((&rest (&rest form)) &rest form)) - ((callf destructuring-bind) 2 (sexp form &rest form)) - ((callf2) 3 (sexp form form &rest form)) - ((loop) nil (&rest &or symbolp form)) - ((ignore-errors) 0 (&rest form)))) +(dolist (entry + '(((defun* defmacro*) 2) + ((function*) nil + (&or symbolp ([&optional 'macro] 'lambda (&rest sexp) &rest form))) + ((eval-when) 1 (sexp &rest form)) + ((declare) nil (&rest sexp)) + ((the) 1 (sexp &rest form)) + ((case ecase typecase etypecase) 1 (form &rest (sexp &rest form))) + ((block return-from) 1 (sexp &rest form)) + ((return) nil (&optional form)) + ((do do*) 2 ((&rest &or symbolp (symbolp &optional form form)) + (form &rest form) + &rest form)) + ((do-symbols) 1 ((symbolp form &optional form form) &rest form)) + ((do-all-symbols) 1 ((symbolp form &optional form) &rest form)) + ((psetq setf psetf) nil edebug-setq-form) + ((progv) 2 (&rest form)) + ((flet labels macrolet) 1 + ((&rest (sexp sexp &rest form)) &rest form)) + ((symbol-macrolet lexical-let lexical-let*) 1 + ((&rest &or symbolp (symbolp form)) &rest form)) + ((multiple-value-bind) 2 ((&rest symbolp) &rest form)) + ((multiple-value-setq) 1 ((&rest symbolp) &rest form)) + ((incf decf remf pushnew shiftf rotatef) nil (&rest form)) + ((letf letf*) 1 ((&rest (&rest form)) &rest form)) + ((callf destructuring-bind) 2 (sexp form &rest form)) + ((callf2) 3 (sexp form form &rest form)) + ((loop) nil (&rest &or symbolp form)) + ((ignore-errors) 0 (&rest form)))) + (dolist (func (car entry)) + (put func 'lisp-indent-function (nth 1 entry)) + (put func 'lisp-indent-hook (nth 1 entry)) + (or (get func 'edebug-form-spec) + (put func 'edebug-form-spec (nth 2 entry))))) ;;; This goes here so that cl-macs can find it if it loads right now. -- cgit v1.2.3 From b68f6e48fa149d7b4e2dabbcb135a5994f492f6f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 28 Jun 2007 15:09:21 +0000 Subject: Set edebug and indentation before loading cl-loaddefs.el so that its use of dolist doesn't load cl-macs. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/cl.el | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 25 deletions(-) (limited to 'lisp/emacs-lisp/cl.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c9ece986c5c..56987cff8e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-06-28 Stefan Monnier + + * emacs-lisp/cl.el: Set edebug and indentation before loading + cl-loaddefs.el so that its use of dolist doesn't load cl-macs. + 2007-06-28 Andreas Schwab * Makefile.in ($(lisp)/mh-e/mh-loaddefs.el): Depend on diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 41dc4432b3f..233df65ac91 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -113,8 +113,9 @@ a future Emacs interpreter will be able to use it.") (defun cl-cannot-unload () (error "Cannot unload the feature `cl'")) -;;; Generalized variables. These macros are defined here so that they -;;; can safely be used in .emacs files. +;;; Generalized variables. +;; These macros are defined here so that they +;; can safely be used in .emacs files. (defmacro incf (place &optional x) "Increment PLACE by X (1 by default). @@ -185,8 +186,8 @@ an element already on the list. ;;; Control structures. -;;; These macros are so simple and so often-used that it's better to have -;;; them all the time than to load them from cl-macs.el. +;; These macros are so simple and so often-used that it's better to have +;; them all the time than to load them from cl-macs.el. (defun cl-map-extents (&rest cl-args) (apply 'cl-map-overlays cl-args)) @@ -198,9 +199,10 @@ an element already on the list. (defalias 'cl-block-throw 'throw) -;;; Multiple values. True multiple values are not supported, or even -;;; simulated. Instead, multiple-value-bind and friends simply expect -;;; the target form to return the values as a list. +;;; Multiple values. +;; True multiple values are not supported, or even +;; simulated. Instead, multiple-value-bind and friends simply expect +;; the target form to return the values as a list. (defsubst values (&rest values) "Return multiple values, Common Lisp style. @@ -321,7 +323,7 @@ always returns nil." (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time))) -;;; The following are actually set by cl-float-limits. +;; The following are actually set by cl-float-limits. (defconst most-positive-float nil) (defconst most-negative-float nil) (defconst least-positive-float nil) @@ -585,14 +587,7 @@ If ALIST is non-nil, the new pairs are prepended to it." ;;; Miscellaneous. -;;; Autoload the other portions of the package. -;; We want to replace the basic versions of dolist, dotimes, declare below. -(fmakunbound 'dolist) -(fmakunbound 'dotimes) -(fmakunbound 'declare) -(load "cl-loaddefs") - -;;; Define data for indentation and edebug. +;; Define data for indentation and edebug. (dolist (entry '(((defun* defmacro*) 2) ((function*) nil @@ -628,14 +623,19 @@ If ALIST is non-nil, the new pairs are prepended to it." (or (get func 'edebug-form-spec) (put func 'edebug-form-spec (nth 2 entry))))) +;; Autoload the other portions of the package. +;; We want to replace the basic versions of dolist, dotimes, declare below. +(fmakunbound 'dolist) +(fmakunbound 'dotimes) +(fmakunbound 'declare) +(load "cl-loaddefs") -;;; This goes here so that cl-macs can find it if it loads right now. +;; This goes here so that cl-macs can find it if it loads right now. (provide 'cl-19) ; usage: (require 'cl-19 "cl") - -;;; Things to do after byte-compiler is loaded. -;;; As a side effect, we cause cl-macs to be loaded when compiling, so -;;; that the compiler-macros defined there will be present. +;; Things to do after byte-compiler is loaded. +;; As a side effect, we cause cl-macs to be loaded when compiling, so +;; that the compiler-macros defined there will be present. (defvar cl-hacked-flag nil) (defun cl-hack-byte-compiler () @@ -644,15 +644,15 @@ If ALIST is non-nil, the new pairs are prepended to it." (setq cl-hacked-flag t) ; Do it first, to prevent recursion. (cl-compile-time-init)))) ; In cl-macs.el. -;;; Try it now in case the compiler has already been loaded. +;; Try it now in case the compiler has already been loaded. (cl-hack-byte-compiler) -;;; Also make a hook in case compiler is loaded after this file. +;; Also make a hook in case compiler is loaded after this file. (add-hook 'bytecomp-load-hook 'cl-hack-byte-compiler) -;;; The following ensures that packages which expect the old-style cl.el -;;; will be happy with this one. +;; The following ensures that packages which expect the old-style cl.el +;; will be happy with this one. (provide 'cl) -- cgit v1.2.3 From 1cd643e793fc948e63c02ae8241f2d20d4fa068d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 10 Jul 2007 21:01:20 +0000 Subject: Load cl-loaddefs.el quietly. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/cl.el | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/cl.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2123e07d766..a7cf4d23121 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2007-07-10 Stefan Monnier + * emacs-lisp/cl.el: Load cl-loaddefs.el quietly. + * vc-arch.el (vc-arch-complete): Remove. (vc-arch-revision-completion-table): Use complete-with-action. diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 233df65ac91..f8b178ac07c 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -628,7 +628,7 @@ If ALIST is non-nil, the new pairs are prepended to it." (fmakunbound 'dolist) (fmakunbound 'dotimes) (fmakunbound 'declare) -(load "cl-loaddefs") +(load "cl-loaddefs" nil 'quiet) ;; This goes here so that cl-macs can find it if it loads right now. (provide 'cl-19) ; usage: (require 'cl-19 "cl") -- cgit v1.2.3