以前 PHP 用に書いた関数を移植。リージョン選択して C-c C-r で実行。結果ウィンドウは q で削除できる。便利。 (defun my-ruby-eval-region () (interactive) (when (region-active-p) (let ((region-str (buffer-substring-no-properties (region-beginning) (region-end))) (result-buf "*ruby*") (temp-file (make-temp-file "my-ruby-eval-region-"))) (with-temp-file temp-file (insert (concat "require \"pp\"" "\n" region-str))) (shell-command (concat "ruby " te