* riece-async.el (riece-async-open-network-stream): Locate Ruby
authorueno <ueno>
Sat, 13 Aug 2005 09:06:08 +0000 (09:06 +0000)
committerueno <ueno>
Sat, 13 Aug 2005 09:06:08 +0000 (09:06 +0000)
script file in riece-data-directory.
* riece-toolbar.el (riece-make-toolbar-from-menu): Locate Ruby
script file in riece-data-directory.
* riece-ruby.el (riece-ruby-execute): Locate Ruby script file in
riece-data-directory.
* riece-options.el (riece-data-directory): New user option.

lisp/ChangeLog
lisp/riece-async.el
lisp/riece-identity.el
lisp/riece-options.el
lisp/riece-ruby.el
lisp/riece-toolbar.el

index b8a3a8f..f723e34 100644 (file)
@@ -1,5 +1,13 @@
 2005-08-13  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-async.el (riece-async-open-network-stream): Locate Ruby
+       script file in riece-data-directory.
+       * riece-toolbar.el (riece-make-toolbar-from-menu): Locate Ruby
+       script file in riece-data-directory.
+       * riece-ruby.el (riece-ruby-execute): Locate Ruby script file in
+       riece-data-directory.
+       * riece-options.el (riece-data-directory): New user option.
+
        * riece-ruby.el (riece-ruby-execute): Bind process-connection-type
        to nil.
 
index 8ec6fd2..1434c73 100644 (file)
@@ -69,16 +69,11 @@ assumed that the file is in the same directory of this file.")
 
 ;;;###autoload
 (defun riece-async-open-network-stream (name buffer host service)
-  (let* ((process-connection-type nil)
+  (let* (process-connection-type
         (process
          (apply #'start-process name buffer riece-ruby-command
-                (if (file-name-absolute-p riece-ruby-server-program)
-                    riece-async-server-program
-                  (expand-file-name
-                   riece-async-server-program
-                   (file-name-directory
-                    (locate-library
-                     (symbol-file 'riece-async-open-network-stream)))))
+                (expand-file-name riece-async-server-program
+                                  riece-data-directory)
                 riece-async-server-program-arguments)))
     (if buffer
        (save-excursion
index 09c45bf..adada4c 100644 (file)
@@ -43,11 +43,11 @@ RFC2812, 2.2 \"Character codes\" says:
    equivalence of two nicknames or channel names.")
 
 (defun riece-identity-prefix (identity)
-  "Return the component sans its server from IDENTITY."
+  "Return the component sans its server name from IDENTITY."
   (aref identity 0))
 
 (defun riece-identity-server (identity)
-  "Return the server component in IDENTITY."
+  "Return the server name component in IDENTITY."
   (aref identity 1))
 
 (defun riece-make-identity (prefix server)
@@ -55,7 +55,7 @@ RFC2812, 2.2 \"Character codes\" says:
   (vector prefix server))
 
 (defun riece-identity-equal (ident1 ident2)
-  "Return t, if IDENT1 and IDENT2 is equal."
+  "Return t, if IDENT1 and IDENT2 are equal."
   (and (riece-identity-equal-no-server
        (riece-identity-prefix ident1)
        (riece-identity-prefix ident2))
@@ -76,7 +76,7 @@ RFC2812, 2.2 \"Character codes\" says:
     prefix))
 
 (defun riece-identity-equal-no-server (prefix1 prefix2)
-  "Return t, if IDENT1 and IDENT2 is equal without server part."
+  "Return t, if IDENT1 and IDENT2 are equal without server part."
   (equal (riece-identity-canonicalize-prefix prefix1)
         (riece-identity-canonicalize-prefix prefix2)))
 
index d694dba..2d39612 100644 (file)
@@ -76,7 +76,7 @@ See the document of the function `recenter'."
   :group 'riece-looks)
 
 (defcustom riece-directory (expand-file-name "~/.riece")
-  "Where to look for data files."
+  "Where to look for startup files."
   :type 'directory
   :group 'riece-options)
 
@@ -86,6 +86,14 @@ See the document of the function `recenter'."
   :type 'directory
   :group 'riece-options)
 
+(defcustom riece-data-directory
+  (if (fboundp 'locate-data-directory)
+      (locate-data-directory "riece")
+    (file-name-directory (locate-library (symbol-file 'riece-data-directory))))
+  "Where to look for data files."
+  :type 'directory
+  :group 'riece-options)
+
 (defcustom riece-variables-file
   (expand-file-name "init" riece-directory)
   "Where to look for variables."
index 12d29ef..290fecb 100644 (file)
@@ -262,13 +262,8 @@ Return a string name assigned by the server."
       (setq riece-ruby-process
            (apply #'start-process "riece-ruby" (generate-new-buffer " *Ruby*")
                   riece-ruby-command
-                  (if (file-name-absolute-p riece-ruby-server-program)
-                      riece-ruby-server-program
-                    (expand-file-name
-                     riece-ruby-server-program
-                     (file-name-directory
-                      (locate-library
-                       (symbol-file 'riece-ruby-execute)))))
+                  (expand-file-name riece-ruby-server-program
+                                    riece-data-directory)
                   riece-ruby-server-program-arguments))
       (process-kill-without-query riece-ruby-process)
       (set-process-filter riece-ruby-process #'riece-ruby-filter)
index fc22878..3c076e5 100644 (file)
            (let ((pointer items)
                  toolbar
                  file
-                 menu-item
-                 (riece-data-directory (locate-data-directory "riece")))
+                 menu-item)
              (while pointer
                (setq file (locate-file (symbol-name (car pointer))
-                                       (if riece-data-directory
-                                           (cons riece-data-directory
-                                                 load-path)
-                                         load-path)
+                                       (cons riece-data-directory load-path)
                                        '(".xpm" ".pbm" ".xbm"))
                      menu-item (riece-toolbar-find-menu-item (car pointer)))
                (if (and file (file-exists-p file))