847 |
It does nothing if FORM is already on the list for FILE. |
It does nothing if FORM is already on the list for FILE. |
848 |
FILE must match exactly. Normally FILE is the name of a library, |
FILE must match exactly. Normally FILE is the name of a library, |
849 |
with no directory or extension specified, since that is how `load' |
with no directory or extension specified, since that is how `load' |
850 |
is normally called." |
is normally called. |
851 |
;; Make sure `load-history' contains the files dumped with Emacs |
FILE can also be a feature (i.e. a symbol), in which case FORM is |
852 |
;; for the case that FILE is one of the files dumped with Emacs. |
evaluated whenever that feature is `provide'd." |
|
(load-symbol-file-load-history) |
|
|
;; Make sure there is an element for FILE. |
|
|
(or (assoc file after-load-alist) |
|
|
(setq after-load-alist (cons (list file) after-load-alist))) |
|
|
;; Add FORM to the element if it isn't there. |
|
853 |
(let ((elt (assoc file after-load-alist))) |
(let ((elt (assoc file after-load-alist))) |
854 |
(or (member form (cdr elt)) |
;; Make sure there is an element for FILE. |
855 |
(progn |
(unless elt (setq elt (list file)) (push elt after-load-alist)) |
856 |
(nconc elt (list form)) |
;; Add FORM to the element if it isn't there. |
857 |
;; If the file has been loaded already, run FORM right away. |
(unless (member form (cdr elt)) |
858 |
(and (assoc file load-history) |
(nconc elt (list form)) |
859 |
(eval form))))) |
;; If the file has been loaded already, run FORM right away. |
860 |
|
(if (if (symbolp file) |
861 |
|
(featurep file) |
862 |
|
;; Make sure `load-history' contains the files dumped with |
863 |
|
;; Emacs for the case that FILE is one of them. |
864 |
|
(load-symbol-file-load-history) |
865 |
|
(assoc file load-history)) |
866 |
|
(eval form)))) |
867 |
form) |
form) |
868 |
|
|
869 |
(defun eval-next-after-load (file) |
(defun eval-next-after-load (file) |
1536 |
|
|
1537 |
(defun functionp (object) |
(defun functionp (object) |
1538 |
"Non-nil iff OBJECT is a type of object that can be called as a function." |
"Non-nil iff OBJECT is a type of object that can be called as a function." |
1539 |
(or (and (symbolp object) |
(or (and (symbolp object) (fboundp object) |
|
(fboundp object) |
|
1540 |
(setq object (indirect-function object)) |
(setq object (indirect-function object)) |
1541 |
(eq (car-safe object) 'autoload) |
(eq (car-safe object) 'autoload) |
1542 |
(not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object))))))) |
(not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr object))))))) |
1543 |
(subrp object) (byte-code-function-p object) |
(subrp object) (byte-code-function-p object) |
1544 |
(eq (car-safe object) 'lambda))) |
(eq (car-safe object) 'lambda))) |
1545 |
|
|