From d221a49dcc28d46a7191b1748c0910615c2c6753 Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 20 Aug 2005 00:00:21 +0000 Subject: [PATCH] * riece-addon.el (riece-command-enable-addon): Redraw entire add-on list. (riece-command-disable-addon): Ditto. --- lisp/ChangeLog | 6 ++++++ lisp/riece-addon.el | 40 ++++++++++++++++------------------------ 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5fc2b20..f54cf56 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-08-20 Daiki Ueno + + * riece-addon.el (riece-command-enable-addon): Redraw entire + add-on list. + (riece-command-disable-addon): Ditto. + 2005-08-17 Daiki Ueno * riece-filter.el (riece-handle-message): Use diff --git a/lisp/riece-addon.el b/lisp/riece-addon.el index ef25aa0..532a328 100644 --- a/lisp/riece-addon.el +++ b/lisp/riece-addon.el @@ -315,18 +315,14 @@ Useful keys: (null (symbol-value enabled))))) t))))) (riece-enable-addon addon t) - (let ((enabled (intern-soft (concat (symbol-name addon) "-enabled")))) - (if (and (eq major-mode 'riece-addon-list-mode) - (get-text-property (point) 'riece-addon) - enabled (symbol-value enabled)) - (save-excursion - (beginning-of-line) - (let ((point (point)) - (inhibit-read-only t) - buffer-read-only) - (delete-char 1) - (insert "+") - (put-text-property point (point) 'riece-addon addon)))))) + (when (eq major-mode 'riece-addon-list-mode) + (riece-command-list-addons) + (let ((point (point-min))) + (while (not (eq (get-text-property point 'riece-addon) addon) + (setq point (next-single-property-change point + 'riece-addon)))) + (if point + (goto-char point))))) (defun riece-command-disable-addon (addon) (interactive @@ -346,18 +342,14 @@ Useful keys: (symbol-value enabled)))) t))))) (riece-disable-addon addon t) - (let ((enabled (intern-soft (concat (symbol-name addon) "-enabled")))) - (if (and (eq major-mode 'riece-addon-list-mode) - (get-text-property (point) 'riece-addon) - enabled (null (symbol-value enabled))) - (save-excursion - (beginning-of-line) - (let ((point (point)) - (inhibit-read-only t) - buffer-read-only) - (delete-char 1) - (insert "-") - (put-text-property point (point) 'riece-addon addon)))))) + (when (eq major-mode 'riece-addon-list-mode) + (riece-command-list-addons) + (let ((point (point-min))) + (while (not (eq (get-text-property point 'riece-addon) addon) + (setq point (next-single-property-change point + 'riece-addon)))) + (if point + (goto-char point))))) (provide 'riece-addon) -- 1.7.10.4