Mercurial > emacs
diff lisp/subr.el @ 104977:1e1816f211ce
* lread.c (Fload): Don't output a message after loading an obsolete
package any more (done in Lisp now).
* subr.el (do-after-load-evaluation): Warn the user after loading an
obsolete package.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sat, 12 Sep 2009 03:35:40 +0000 |
parents | 566d2dc55a9d |
children | a4c2188bd87d |
line wrap: on
line diff
--- a/lisp/subr.el Sat Sep 12 02:42:22 2009 +0000 +++ b/lisp/subr.el Sat Sep 12 03:35:40 2009 +0000 @@ -1688,13 +1688,25 @@ (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." +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. (mapc #'(lambda (a-l-element) (when (and (stringp (car a-l-element)) (string-match-p (car a-l-element) abs-file)) ;; discard the file name regexp (mapc #'eval (cdr a-l-element)))) - after-load-alist)) + after-load-alist) + ;; Complain when the user uses obsolete files. + (when (equal "obsolete" + (file-name-nondirectory + (directory-file-name (file-name-directory abs-file)))) + (run-with-timer 0 nil + (lambda (file) + (message "Package %s is obsolete!" + (substring file 0 + (string-match "\\.elc?\\>" file)))) + (file-name-nondirectory abs-file)))) (defun eval-next-after-load (file) "Read the following input sexp, and run it whenever FILE is loaded.