diff lisp/package-admin.el @ 628:e545f3ec2337

[xemacs-hg @ 2001-07-14 08:42:16 by youngs] 2001-07-14 Sean MacLennan <seanm@storm.ca> * package-admin.el (package-install-hook): New. (package-delete-hook): New. (package-admin-add-single-file-package): Use package-delete-hook. * package-get.el (package-get): Use package-install-hook.
author youngs
date Sat, 14 Jul 2001 08:42:17 +0000
parents 3078fd1074e8
children a6c89d799f00
line wrap: on
line diff
--- a/lisp/package-admin.el	Thu Jul 12 06:29:10 2001 +0000
+++ b/lisp/package-admin.el	Sat Jul 14 08:42:17 2001 +0000
@@ -104,6 +104,16 @@
 unfortunately, contain spaces, so be careful in constructing any
 regexps.")
 
+(defvar package-install-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.")
+
+(defvar package-delete-hook nil
+  "*List of hook functions to be called when a package is deleted. The
+hook is called *before* the package is deleted. The hook function is passed
+two arguments: the package name, and the install directory.")
+
 ;;;###autoload
 (defun package-admin-add-single-file-package (file destdir &optional pkg-dir)
   "Install a single file Lisp package into XEmacs package hierarchy.
@@ -402,6 +412,7 @@
   (let ( (tmpbuf " *pkg-manifest*") manifest-file package-lispdir dirs file)
     (setq pkg-topdir (package-admin-get-install-dir package pkg-topdir))
     (setq manifest-file (package-admin-get-manifest-file pkg-topdir package))
+    (run-hook-with-args 'package-delete-hook package pkg-topdir)
     (if (file-exists-p manifest-file)
 	(progn
 	  ;; The manifest file exists!  Use it to delete the old distribution.