From: ueno Date: Thu, 11 Aug 2005 09:22:18 +0000 (+0000) Subject: * riece-eval-ruby.el (riece-eval-ruby-prefix-regexp): New user option. X-Git-Tag: channel-coding-branchpoint~149 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=18ca47a918666103473bc8b440a2c55a0429360f;p=elisp%2Friece.git * riece-eval-ruby.el (riece-eval-ruby-prefix-regexp): New user option. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6255ff5..9b46ee9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2005-08-11 Daiki Ueno + * riece-eval-ruby.el (riece-eval-ruby-prefix-regexp): New user option. + * riece-hangman.el (riece-hangman-hello-regexp): Changed regexp. (riece-hangman-bye-regexp): Changed regexp. diff --git a/lisp/riece-eval-ruby.el b/lisp/riece-eval-ruby.el index cd7ce66..5d7b789 100644 --- a/lisp/riece-eval-ruby.el +++ b/lisp/riece-eval-ruby.el @@ -1,4 +1,4 @@ -;;; riece-eval-ruby.el --- evaluate ruby expression +;;; riece-eval-ruby.el --- evaluate Ruby programs in channels ;; Copyright (C) 1998-2005 Daiki Ueno ;; Author: Daiki Ueno @@ -32,6 +32,15 @@ (require 'riece-ruby) (require 'riece-message) +(defgroup riece-eval-ruby nil + "Evaluate Ruby programs in channels." + :group 'riece) + +(defcustom riece-eval-ruby-prefix-regexp "^,ruby\\s-+" + "Pattern of of the prefix for sending Ruby programs." + :type 'string + :group 'riece-eval-ruby) + (defvar riece-eval-ruby-enabled nil) (defconst riece-eval-ruby-description @@ -60,7 +69,8 @@ (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))) + (string-match riece-eval-ruby-prefix-regexp + (riece-message-text message))) (let ((name (riece-ruby-execute (substring (riece-message-text message) (match-end 0)))))