From: ueno Date: Thu, 25 Aug 2005 09:35:40 +0000 (+0000) Subject: * riece-addon.el (riece-uninstall-addon): New function. X-Git-Tag: channel-coding-branchpoint~74 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=120f9bfa9a0faaf574c437150786f164a3d69b6f;p=elisp%2Friece.git * riece-addon.el (riece-uninstall-addon): New function. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 08cc76d..16746a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,7 @@ riece-addon-dependencies instead of riece-addons. (riece-command-enable-addon): Ditto. (riece-command-disable-addon): Ditto. + (riece-uninstall-addon): New function. 2005-08-25 Daiki Ueno diff --git a/lisp/riece-addon.el b/lisp/riece-addon.el index 2f35d5b..68a99b9 100644 --- a/lisp/riece-addon.el +++ b/lisp/riece-addon.el @@ -196,12 +196,36 @@ (defun riece-insinuate-addon (addon &optional verbose) (if (get addon 'riece-addon-insinuated) (if verbose - (message "Add-on %S is alread insinuated" addon)) + (message "Add-on %S is already insinuated" addon)) (funcall (intern (concat (symbol-name addon) "-insinuate"))) (put addon 'riece-addon-insinuated t) (if verbose (message "Add-on %S is insinuated" addon)))) +(defun riece-uninstall-addon (addon &optional verbose) + (if (not (get addon 'riece-addon-insinuated)) + (if verbose + (message "Add-on %S is not insinuated" addon)) + (let ((entry (assq addon riece-addon-dependencies)) + (enabled (intern-soft (concat (symbol-name addon) "-enabled")))) + (if entry + (if (cdr entry) + (if (= (length (cdr entry)) 1) + (error "%S depends %S" (car (cdr entry)) addon) + (error "%s depends %S" (mapconcat #'identity (cdr entry) ",") + addon)) + (if (and enabled + (symbol-value enabled)) + (riece-disable-addon addon verbose)) + (funcall (or (intern-soft (concat (symbol-name addon) + "-uninstall")) + #'ignore)) + (setq riece-addon-dependencies + (delq entry riece-addon-dependencies)) + (put addon 'riece-addon-insinuated nil))) + (if verbose + (message "Add-on %S is uninstalled" addon))))) + (defun riece-enable-addon (addon &optional verbose) (let ((enabled (intern-soft (concat (symbol-name addon) "-enabled")))) (if (null enabled)