けいじゅ@日本ラショナルソフトウェアです. In [ruby-list :7990 ] the message: "[ruby-list:7990] Re: dbm ", on May/19 11:25(JST) Yukihiro Matsumoto writes: >まつもと ゆきひろです >|#あと、irb と相性のいい ruby のバージョン教えてください(_ _) >これは石塚さんに聞いてみないと…. これは私のせいというかrubyのバグに由来する部分が多いんですが(;_; ruby-1.1b9_12ぐらいが一番マッチしているみたいです. そうでなければ, rubyの最新版に, 今in.commingにputした irb-0.2.1.12.tgzをお使い下さ い. そのときに, irb --single-irb で実行していただくと[ruby-dev:2687]の問題も回避できます. この, irbは大部実装が変わっていまして, rubyのトークンをほぼ完璧に識別 できるようになったモジュールirb-scanner.rbを用いています. ちょっと不安 でもないでもないので, irb1.rbという前バージョンも一緒に添付しています. もう1つ, rtags.rbのドラフトバージョンも添付しています. ただ問題があり まして, rubyのdefはインデントしているので, インデントが変わった時でも 検索できるようにするために, 以下の関数をemacs上で上書きする必要があり ます. ;; (defun etags-ruby-goto-tag-location (tag-info) (defun etags-goto-tag-location (tag-info) (let ((startpos (cdr (cdr tag-info))) (line (car (cdr tag-info))) offset found pat) (if (eq (car tag-info) t) ;; Direct file tag. (cond (line (goto-line line)) (startpos (goto-char startpos)) (t (error "etags.el BUG: bogus direct file tag"))) ;; This constant is 1/2 the initial search window. ;; There is no sense in making it too small, ;; since just going around the loop once probably ;; costs about as much as searching 2000 chars. (setq offset 1000 found nil pat (concat (if (eq selective-display t) "\\(^\\|\^m\\\)\\s_*" "^\\s_*") (regexp-quote (car tag-info)))) ;; The character position in the tags table is 0-origin. ;; Convert it to a 1-origin Emacs character position. (if startpos (setq startpos (1+ startpos))) ;; If no char pos was given, try the given line number. (or startpos (if line (setq startpos (progn (goto-line line) (point))))) (or startpos (setq startpos (point-min))) ;; First see if the tag is right at the specified location. (goto-char startpos) (setq found (looking-at pat)) (while (and (not found) (progn (goto-char (- startpos offset)) (not (bobp)))) (setq found (re-search-forward pat (+ startpos offset) t) offset (* 3 offset))) ; expand search window (or found (re-search-forward pat nil t) (error "Rerun etags: `%s' not found in %s" pat buffer-file-name))) ;; Position point at the right place ;; if the search string matched an extra Ctrl-m at the beginning. (and (eq selective-display t) (looking-at "\^m") (forward-char 1)) (beginning-of-line))) でも, これを定義すると他のソースファイルでのetagsの動作も変わっちゃう のでどうしようかなと思っています... etags.elを見ると言語毎にカスタマイ ズできそうなんですけど, 難しくて良くわかりません(;_; # 誰か助けてくれると嬉しいなあ... ついでに, 以下のファイルをputしました. e2mmap-1.1.1.6.tgz --- ruby-1.1b17前後両方対応できる版 tracer-0.2.1.8.tgz --- irbと統合できる版 shell-0.1.1.1.tgz --- [ruby-list: 7262]で話したshell機能をrubyで実 装したもの __ ................................石塚 圭樹@日本ラショナルソフトェア... ----------------------------------->> e-mail: keiju / rational.com <<---