Fixed.
[riece] / lisp / riece-eval.el
index c54079f..4969bf5 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-eval.el --- eval add-on
+;;; riece-eval.el --- evaluate input string as an elisp form
 ;; Copyright (C) 2005 OHASHI Akira
 
 ;; Author: OHASHI Akira <bg66@koka-in.org>
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
-;; This add-on evaluates an input string as lisp object and sends a result
-;; as notice. Note the risky of this add-on.
-
-;; To use, add the following line to your ~/.riece/init.el:
-;; (add-to-list 'riece-addons 'riece-eval)
+;; NOTE: This is an add-on module for Riece.
 
 ;;; Code:
 
@@ -35,7 +31,7 @@
 (require 'riece-message)
 
 (defgroup riece-eval nil
-  "Evaluate an input string as lisp object."
+  "Evaluate an input string as an elisp form."
   :prefix "riece-"
   :group 'riece)
 
   :type 'boolean
   :group 'riece-eval)
 
-(defvar riece-eval-enabled nil)
-
 (defconst riece-eval-description
-  "Evaluate an input string as lisp object.")
+  "Evaluate an input string as an elisp form.")
 
 (defun riece-eval-display-message-function (message)
-  (when (and riece-eval-enabled
+  (when (and (get 'riece-eval 'riece-addon-enabled)
             (riece-message-own-p message)
             (string-match riece-eval-regexp (riece-message-text message)))
     (let* ((form (match-string 1 (riece-message-text message)))
   (add-hook 'riece-after-display-message-functions
            'riece-eval-display-message-function))
 
-(defun riece-eval-enable ()
-  (setq riece-eval-enabled t))
-
-(defun riece-eval-disable ()
-  (setq riece-eval-enabled nil))
+(defun riece-eval-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-eval-display-message-function))
 
 (provide 'riece-eval)