From: ueno Date: Fri, 21 May 2004 05:20:01 +0000 (+0000) Subject: * riece-addon.el (riece-enable-addon): Check if riece-*-enable X-Git-Tag: riece-1_0_0~37 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b5f6d4764eb61ae66fb5a361b021bd38659bf38c;p=elisp%2Friece.git * riece-addon.el (riece-enable-addon): Check if riece-*-enable exists. (riece-disable-addon): Check if riece-*-disable exists. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 87d8b4e..15c8e29 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2004-05-21 Daiki Ueno + * riece-addon.el (riece-enable-addon): Check if riece-*-enable + exists. + (riece-disable-addon): Check if riece-*-disable exists. + +2004-05-21 Daiki Ueno + * riece-mini.el (riece-mini-enabled): New flag. (riece-mini-display-message-function): Check riece-mini-enabled. (riece-mini-enable): New function. diff --git a/lisp/riece-addon.el b/lisp/riece-addon.el index 7c09ec0..9eed0a5 100644 --- a/lisp/riece-addon.el +++ b/lisp/riece-addon.el @@ -93,25 +93,28 @@ (message "Add-on %S is insinuated" addon))) (defun riece-enable-addon (addon) - (let ((enabled (intern (concat (symbol-name addon) "-enabled")))) - (if (not (boundp enabled)) + (let ((enabled (intern-soft (concat (symbol-name addon) "-enabled")))) + (if (null enabled) (if riece-debug (message "Add-on %S doesn't support enable/disable" addon)) (if (symbol-value enabled) (if riece-debug (message "Can't enable add-on %S" addon)) - (funcall (intern (concat (symbol-name addon) "-enable"))) + (funcall (or (intern-soft (concat (symbol-name addon) "-enable")) + #'ignore)) (if riece-debug (message "Add-on %S enabled" addon)))))) (defun riece-disable-addon (addon) - (let ((enabled (intern (concat (symbol-name addon) "-enabled")))) - (if (not (boundp enabled)) + (let ((enabled (intern-soft (concat (symbol-name addon) "-enabled")))) + (if (null enabled) (if riece-debug (message "Add-on %S doesn't support enable/disable" addon)) (if (symbol-value enabled) (progn - (funcall (intern (concat (symbol-name (car addons)) "-disable"))) + (funcall (or (intern-soft (concat (symbol-name (car addons)) + "-disable")) + #'ignore)) (if riece-debug (message "Add-on %S disabled" (car addons)))) (if riece-debug