This is a simple little patch to add a hook to the `package-get'
function. After a successful get, this hook would be called with the
package name and the install directory. I plan to use this to
auto-magically install my patches when I use `pui-list-packages'.
It might also be useful to have a package remove hook, but I
currently don't see a use for it.
2000-11-08 Sean MacLennan <seanm(a)storm.ca>
* package-get.el (package-get-hook): add a hook for successful gets
Index: package-get.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/package-get.el,v
retrieving revision 1.13.2.30
diff -u -r1.13.2.30 package-get.el
--- package-get.el 2000/11/06 05:44:10 1.13.2.30
+++ package-get.el 2000/11/08 05:29:53
@@ -160,6 +160,11 @@
be lexically ordered. It is debatable if it makes sense to have more than
one version of a package available.")
+(defvar package-get-hook nil
+ "*List of hook functions to be called when a new package is successfully
+installed. The hook function is passed two arguments: the package name, and
+the install directory.")
+
(defcustom package-get-dir (temp-directory)
"*Where to store temporary files for staging."
:tag "Temporary directory"
@@ -864,6 +869,7 @@
(if (package-get-init-package (package-admin-get-lispdir
install-dir package))
(progn
+ (run-hook-with-args 'package-get-hook package install-dir)
(message "Added package `%s'" package)
(sit-for 0)
)