Don't use old-style backquote in doc/ptexinfmt.el.
[riece] / lisp / riece-google.el
index f9c7ef0..465d068 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-google.el --- Interface to Google API
+;;; riece-google.el --- search keywords by Google
 ;; 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 searches keywords by Google.
+;; NOTE: This is an add-on module for Riece.
 
 ;; Ruby code was stolen (and modified) from nadoka.
 
-;; To use, add the following line to your ~/.riece/init.el:
-;; (add-to-list 'riece-addons 'riece-google)
-
 ;;; Code:
 
 (require 'riece-message)
 
 (defgroup riece-google nil
-  "Interface to Google API."
+  "Search keywords by Google."
   :prefix "riece-"
   :group 'riece)
 
@@ -139,7 +136,7 @@ rescue Exception => e
 end
 ")
   "Ruby program for searching by Google."
-  :type 'list
+  :type 'sexp
   :group 'riece-google)
 
 (defcustom riece-google-license-key nil
@@ -148,7 +145,7 @@ end
   :group 'riece-google)
 
 (defcustom riece-google-default-lang '("lang_en" "lang_ja")
-  "*Default language for search keywords."
+  "*Default language for searching keywords."
   :type '(repeat (choice (const "lang_en" :tag "English")
                         (const "lang_ja" :tag "Japanese")
                         (string :tag "The other language")))
@@ -157,15 +154,13 @@ end
 (defconst riece-google-regexp
   "^go\\(o+\\)gle\\(:\\([a-z]+\\)\\)?>\\s-*\\(.*\\)")
 
-(defvar riece-google-enabled nil)
-
 (defconst riece-google-description
   "Search keywords by Google.")
 
 (defvar riece-google-target nil)
 
 (defun riece-google-display-message-function (message)
-  (when (and riece-google-enabled
+  (when (and (get 'riece-google 'riece-addon-enabled)
             (stringp riece-google-license-key)
             (string-match riece-google-regexp (riece-message-text message)))
     (let ((keywords (match-string 4 (riece-message-text message)))
@@ -237,11 +232,9 @@ end
   (add-hook 'riece-after-display-message-functions
            'riece-google-display-message-function))
 
-(defun riece-google-enable ()
-  (setq riece-google-enabled t))
-
-(defun riece-google-disable ()
-  (setq riece-google-enabled nil))
+(defun riece-google-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-google-display-message-function))
 
 (provide 'riece-google)