emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/subr.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/subr.el
Date: Tue, 15 Sep 2009 03:39:45 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/09/15 03:39:44

Modified files:
        etc            : NEWS 
        lisp           : ChangeLog subr.el 

Log message:
        (after-load-functions): New hook.
        (do-after-load-evaluation): Run it.  Use string-match-p to detect
        `obsolete' packages, rather than painfully extracting the relevant
        directory name.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/NEWS?cvsroot=emacs&r1=1.2082&r2=1.2083
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16171&r2=1.16172
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/subr.el?cvsroot=emacs&r1=1.652&r2=1.653

Patches:
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.2082
retrieving revision 1.2083
diff -u -b -r1.2082 -r1.2083
--- etc/NEWS    15 Sep 2009 02:38:20 -0000      1.2082
+++ etc/NEWS    15 Sep 2009 03:39:40 -0000      1.2083
@@ -210,6 +210,8 @@
 
 * Lisp changes in Emacs 23.2
 
+** New hook `after-load-functions' run after loading an Elisp file.
+
 ** You can control which binding is preferentially shown in menus and
 docstrings by adding a `:advertised-binding' property to the corresponding
 command's symbol.  That property can hold a single binding or a list

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16171
retrieving revision 1.16172
diff -u -b -r1.16171 -r1.16172
--- lisp/ChangeLog      15 Sep 2009 02:37:28 -0000      1.16171
+++ lisp/ChangeLog      15 Sep 2009 03:39:41 -0000      1.16172
@@ -1,3 +1,10 @@
+2009-09-15  Stefan Monnier  <address@hidden>
+
+       * subr.el (after-load-functions): New hook.
+       (do-after-load-evaluation): Run it.  Use string-match-p to detect
+       `obsolete' packages, rather than painfully extracting the relevant
+       directory name.
+
 2009-09-15  Glenn Morris  <address@hidden>
 
        * apropos.el (apropos-documentation-check-doc-file): Avoid assignment to

Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.652
retrieving revision 1.653
diff -u -b -r1.652 -r1.653
--- lisp/subr.el        12 Sep 2009 03:55:50 -0000      1.652
+++ lisp/subr.el        15 Sep 2009 03:39:44 -0000      1.653
@@ -1670,6 +1670,11 @@
          (featurep file))
        (eval form))))
 
+(defvar after-load-functions nil
+  "Special hook run after loading a file.
+Each function there is called with a single argument, the absolute
+name of the file just loaded.")
+
 (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.
@@ -1682,15 +1687,15 @@
              (mapc #'eval (cdr a-l-element))))
        after-load-alist)
   ;; Complain when the user uses obsolete files.
-  (when (equal "obsolete"
-               (file-name-nondirectory
-                (directory-file-name (file-name-directory abs-file))))
+  (when (string-match-p "/obsolete/[^/]*\\'" 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))))
+                    (file-name-nondirectory abs-file)))
+  ;; Finally, run any other hook.
+  (run-hook-with-args 'after-load-functions abs-file))
 
 (defun eval-next-after-load (file)
   "Read the following input sexp, and run it whenever FILE is loaded.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]