diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-04-10 10:09:49 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-04-10 10:09:49 +0000 |
commit | 4af06a86de87b9f12751fb155d10c1f9e453097a (patch) | |
tree | e3c9324afa79d453f6dc8c32c9d3c6922cde8c39 /sample | |
parent | 882c18e65ef38342cd2dc0d4cd5e643439c30a77 (diff) |
1.1b9_10 pre0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r-- | sample/inf-ruby.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sample/inf-ruby.el b/sample/inf-ruby.el index c7d5d363d7..317bf21d5f 100644 --- a/sample/inf-ruby.el +++ b/sample/inf-ruby.el @@ -146,6 +146,25 @@ so it only valid in rbc." (re-search-backward P) )) +(if (not (functionp 'replace-in-string)) + ;; simple version of replace-in-string in XEmacs + (defun replace-in-string (str regexp newtext) + "Replace all matches in STR for REGEXP with NEWTEXT string, + and returns the new string." + (let ((rtn-str "") + (start 0) + (special) + match prev-start) + (while (setq match (string-match regexp str start)) + (setq prev-start start + start (match-end 0) + rtn-str + (concat + rtn-str + (substring str prev-start match) newtext))) + (concat rtn-str (substring str start)))) +) + (defun ruby-get-old-input () "Snarf the sexp ending at point" (save-excursion |