* riece-eval-ruby.el: New add-on.
* COMPILE (riece-modules): Add riece-eval-ruby.
* Makefile.am (EXTRA_DIST): Add riece-eval-ruby.el.
riece-toolbar
riece-eval
riece-google
- riece-keepalive))))
+ riece-keepalive
+ riece-eval-ruby))))
(defvar riece-icons
'("riece-command-quit.xpm"
2005-08-11 Daiki Ueno <ueno@unixuser.org>
+ * riece-ruby.el: Moved add-on stuff to riece-eval-ruby.el.
+
+ * riece-eval-ruby.el: New add-on.
+ * COMPILE (riece-modules): Add riece-eval-ruby.
+ * Makefile.am (EXTRA_DIST): Add riece-eval-ruby.el.
+
+2005-08-11 Daiki Ueno <ueno@unixuser.org>
+
* server.rb (Server::unescape): Fixed.
* riece-ruby.el: Implement add-on API.
riece-lsdb.el riece-xface.el riece-ctlseq.el riece-ignore.el \
riece-hangman.el riece-biff.el riece-kakasi.el riece-foolproof.el \
riece-yank.el riece-toolbar.el riece-eval.el riece-google.el \
- riece-keepalive.el url-riece.el \
+ riece-keepalive.el riece-eval-ruby.el url-riece.el \
riece-command-previous-channel.xpm riece-command-next-channel.xpm \
riece-submit-bug-report.xpm \
server.rb
--- /dev/null
+(require 'riece-ruby)
+(require 'riece-message)
+
+(defvar riece-eval-ruby-enabled nil)
+
+(defconst riece-eval-ruby-description
+ "Evaluate an input string as Ruby program.")
+
+(defun riece-eval-ruby-exit-handler (name)
+ (riece-ruby-inspect name)
+ (let* ((data (copy-sequence riece-ruby-data))
+ (length (length data))
+ (index 0))
+ (while (< index length)
+ (if (eq (aref data index) ?\n)
+ (aset data index ? ))
+ (setq index (1+ index)))
+ (riece-send-string
+ (format "NOTICE %s :%s\r\n"
+ (riece-identity-prefix
+ (riece-ruby-property name 'riece-eval-ruby-target))
+ data))
+ (riece-display-message
+ (riece-make-message (riece-current-nickname)
+ (riece-ruby-property name 'riece-eval-ruby-target)
+ data
+ 'notice))))
+
+(defun riece-eval-ruby-display-message-function (message)
+ (if (and riece-eval-ruby-enabled
+ (riece-message-own-p message)
+ (string-match "^,ruby\\s-+" (riece-message-text message)))
+ (let ((name (riece-ruby-execute
+ (substring (riece-message-text message)
+ (match-end 0)))))
+ (riece-ruby-set-property name
+ 'riece-eval-ruby-target
+ (riece-message-target message))
+ (riece-ruby-set-exit-handler name
+ #'riece-eval-ruby-exit-handler))))
+
+(defun riece-eval-ruby-insinuate ()
+ (add-hook 'riece-after-display-message-functions
+ 'riece-eval-ruby-display-message-function))
+
+(defun riece-eval-ruby-enable ()
+ (setq riece-eval-ruby-enabled t))
+
+(defun riece-eval-ruby-disable ()
+ (setq riece-eval-ruby-enabled nil))
+
+(provide 'riece-eval-ruby)
\ No newline at end of file
"An alist mapping from program name to the property list.
Use `riece-ruby-set-property' to set this variable.")
-(defvar riece-ruby-enabled nil)
-
-(defconst riece-ruby-description
- "Evaluate an input string as Ruby program.")
-
(defun riece-ruby-substitute-variables (program alist)
(setq program (copy-sequence program))
(while alist
(defun riece-ruby-property (name property)
(cdr (assoc property (cdr (assoc name riece-ruby-property-alist)))))
-(defun riece-ruby-exit-handler (name)
- (riece-ruby-inspect name)
- (let* ((data (copy-sequence riece-ruby-data))
- (length (length data))
- (index 0))
- (while (< index length)
- (if (eq (aref data index) ?\n)
- (aset data index ? ))
- (setq index (1+ index)))
- (riece-send-string
- (format "NOTICE %s :%s\r\n"
- (riece-identity-prefix
- (riece-ruby-property name 'riece-ruby-target))
- data))
- (riece-display-message
- (riece-make-message (riece-current-nickname)
- (riece-ruby-property name 'riece-ruby-target)
- data
- 'notice))))
-
-(defun riece-ruby-display-message-function (message)
- (if (and riece-ruby-enabled
- (riece-message-own-p message)
- (string-match "^,ruby\\s-+" (riece-message-text message)))
- (let ((name (riece-ruby-execute
- (substring (riece-message-text message)
- (match-end 0)))))
- (riece-ruby-set-property name
- 'riece-ruby-target
- (riece-message-target message))
- (riece-ruby-set-exit-handler name
- #'riece-ruby-exit-handler))))
-
-(defun riece-ruby-insinuate ()
- (add-hook 'riece-after-display-message-functions
- 'riece-ruby-display-message-function))
-
-(defun riece-ruby-enable ()
- (setq riece-ruby-enabled t))
-
-(defun riece-ruby-disable ()
- (setq riece-ruby-enabled nil))
-
(provide 'riece-ruby)
;;; riece-ruby.el ends here