Function: do-after-load-evaluation
do-after-load-evaluation is a byte-compiled function defined in
subr.el.gz.
Signature
(do-after-load-evaluation ABS-FILE)
Documentation
Evaluate all eval-after-load forms, if any, for ABS-FILE.
ABS-FILE, a string, should be the absolute true name of a file just loaded. This function is called directly from the C code.
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun do-after-load-evaluation (abs-file)
"Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
ABS-FILE, a string, should be the absolute true name of a file just loaded.
This function is called directly from the C code."
;; Run the relevant eval-after-load forms.
(dolist (a-l-element after-load-alist)
(when (and (stringp (car a-l-element))
(string-match-p (car a-l-element) abs-file))
;; discard the file name regexp
(mapc #'funcall (cdr a-l-element))))
;; Complain when the user uses obsolete files.
(when (string-match-p "/obsolete/[^/]*\\'" abs-file)
;; Maybe we should just use display-warning? This seems yucky...
(let* ((file (file-name-nondirectory abs-file))
(package (intern (substring file 0
(string-match "\\.elc?\\>" file))
obarray))
(msg (format "Package %s is deprecated" package))
(fun (lambda (msg) (message "%s" msg))))
(when (or (not (fboundp 'byte-compile-warning-enabled-p))
(byte-compile-warning-enabled-p 'obsolete package))
(cond
((bound-and-true-p byte-compile-current-file)
;; Don't warn about obsolete files using other obsolete files.
(unless (and (stringp byte-compile-current-file)
(string-match-p "/obsolete/[^/]*\\'"
(expand-file-name
byte-compile-current-file
byte-compile-root-dir)))
(byte-compile-warn "%s" msg)))
(noninteractive (funcall fun msg)) ;; No timer will be run!
(t (run-with-idle-timer 0 nil fun msg))))))
;; Finally, run any other hook.
(run-hook-with-args 'after-load-functions abs-file))