Index: lisp/package-get.el =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/package-get.el,v retrieving revision 1.5 diff -u -r1.5 package-get.el --- package-get.el 1998/04/24 21:34:04 1.5 +++ package-get.el 1998/05/12 00:25:32 @@ -167,8 +167,8 @@ ;; Load a fresh copy (load "package-get-base.el") (mapcar (lambda (pkg) - (package-get-all - (car pkg) nil)) + (package-get-all + (car pkg) nil)) packages-package-list)) (defun package-get-all (package version &optional fetched-packages) @@ -403,4 +403,57 @@ (setq packages (cdr packages))) found)) +(defun package-get-custom () + "Fetch and install the latest versions of all customized packages." + (interactive) + ;; Load a fresh copy + (load "package-get-base.el") + (load "package-get-custom.el") + (mapcar (lambda (pkg) + (if (eval (intern (concat (symbol-name (car pkg)) "-package"))) + (package-get-all (car pkg) nil)) + t) + package-get-base)) + +(defun package-get-ever-installedp (pkg &optional notused) + (string-match "-package$" (symbol-name pkg)) + (custom-initialize-set + pkg + (if (package-get-info-find-package + packages-package-list + (intern (substring (symbol-name pkg) 0 (match-beginning 0)))) + t))) + +(defun package-get-create-custom () + "Creates a package customization file package-get-custom.el. +Entries in the customization file are retrieved from package-get-base.el." + (interactive) + ;; Load a fresh copy + (load "package-get-base.el") + (let ((custom-buffer (find-file-noselect "package-get-custom.el")) + (pkg-groups nil)) + (insert-string + (concat "(defgroup packages nil\n" + " \"Configure XEmacs package\"\n" + " :group 'emacs)\n\n") custom-buffer) + + (mapcar (lambda (pkg) + (let ((category (plist-get (car (cdr pkg)) 'category))) + (or (memq (intern category) pkg-groups) + (progn + (setq pkg-groups (cons (intern category) pkg-groups)) + (insert-string + (concat "(defgroup " category "-packages nil\n" + " \"" category " package group\"\n" + " :group 'packages)\n\n") custom-buffer))) + + (insert-string + (concat "(defcustom " (symbol-name (car pkg)) + "-package nil \n" + " \"" (plist-get (car (cdr pkg)) 'description) "\"\n" + " :group '" category "-packages\n" + " :initialize 'package-get-ever-installedp\n" + " :type 'boolean)\n\n") custom-buffer))) + package-get-base)) + ) ;;; package-get.el ends here