X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fpackage-admin.el;h=925f6de7bfc9a06be2c2492443c83483ca571d1c;hb=90070d2c0301420963c9cf38a9cf5c178f9e6589;hp=2f971ea966a33be4ad5a8484b7063f2b9498d3ec;hpb=98a6e4055a1fa624c592ac06f79287d55196ca37;p=chise%2Fxemacs-chise.git- diff --git a/lisp/package-admin.el b/lisp/package-admin.el index 2f971ea..925f6de 100644 --- a/lisp/package-admin.el +++ b/lisp/package-admin.el @@ -104,6 +104,16 @@ is already implicit, as `looking-at' is used. Filenames can, 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. @@ -165,13 +175,13 @@ or return a location appropriate for the package otherwise." (featurep package-feature) (setq autoload-dir (feature-file package-feature)) (setq autoload-dir (file-name-directory autoload-dir)) - (member autoload-dir late-package-load-path)) + (member autoload-dir (append early-package-load-path late-package-load-path))) ;; Find the corresponding entry in late-package (setq pkg-dir (car-safe (member-if (lambda (h) (string-match (concat "^" (regexp-quote h)) autoload-dir)) - late-packages)))) + (append (cdr early-packages) late-packages))))) (if pkg-dir pkg-dir ;; Ok we need to guess @@ -402,6 +412,7 @@ PACKAGE is a symbol, not a string." (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. @@ -428,7 +439,7 @@ PACKAGE is a symbol, not a string." ;; Make sure that the file is writable. ;; (This is important under MS Windows.) ;; I do not know why it important under MS Windows but - ;; 1. It bombs out out when the file does not exist. This can be condition-cased + ;; 1. It bombs out when the file does not exist. This can be condition-cased ;; 2. If I removed the write permissions, I do not want XEmacs to just ignore them. ;; If it wants to, XEmacs may ask, but that is about all ;; (set-file-modes file 438) ;; 438 -> #o666