* misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
alist for error message from ruby. * misc/inf-ruby.el (inferior-ruby-mode): fixed for Emacs. * misc/inf-ruby.el (ruby-send-region): compilation-parse-errors doesn't parse first line, so insert separators before each evaluations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d64fd035a
commit
75821a5afb
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Sat Sep 7 23:32:56 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
|
||||||
|
alist for error message from ruby.
|
||||||
|
|
||||||
|
* misc/inf-ruby.el (inferior-ruby-mode): fixed for Emacs.
|
||||||
|
|
||||||
|
* misc/inf-ruby.el (ruby-send-region): compilation-parse-errors
|
||||||
|
doesn't parse first line, so insert separators before each
|
||||||
|
evaluations.
|
||||||
|
|
||||||
Sat Sep 7 19:46:57 2002 Akinori MUSHA <knu@iDaemons.org>
|
Sat Sep 7 19:46:57 2002 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* lib/set.rb: Disallow Set.new(false). Add even more tests.
|
* lib/set.rb: Disallow Set.new(false). Add even more tests.
|
||||||
|
@ -35,6 +35,16 @@
|
|||||||
;;; HISTORY
|
;;; HISTORY
|
||||||
;;; senda - 8 Apr 1998: Created.
|
;;; senda - 8 Apr 1998: Created.
|
||||||
;;; $Log$
|
;;; $Log$
|
||||||
|
;;; Revision 1.6 2002/09/07 14:35:46 nobu
|
||||||
|
;;; * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
|
||||||
|
;;; alist for error message from ruby.
|
||||||
|
;;;
|
||||||
|
;;; * misc/inf-ruby.el (inferior-ruby-mode): fixed for Emacs.
|
||||||
|
;;;
|
||||||
|
;;; * misc/inf-ruby.el (ruby-send-region): compilation-parse-errors
|
||||||
|
;;; doesn't parse first line, so insert separators before each
|
||||||
|
;;; evaluations.
|
||||||
|
;;;
|
||||||
;;; Revision 1.5 2002/08/19 10:05:47 nobu
|
;;; Revision 1.5 2002/08/19 10:05:47 nobu
|
||||||
;;; * misc/inf-ruby.el (inf-ruby-keys): ruby-send-definition
|
;;; * misc/inf-ruby.el (inf-ruby-keys): ruby-send-definition
|
||||||
;;; conflicted with ruby-insert-end.
|
;;; conflicted with ruby-insert-end.
|
||||||
@ -122,10 +132,9 @@
|
|||||||
(defvar inferior-ruby-mode-map nil
|
(defvar inferior-ruby-mode-map nil
|
||||||
"*Mode map for inferior-ruby-mode")
|
"*Mode map for inferior-ruby-mode")
|
||||||
|
|
||||||
(pushnew '(ruby ("^\tfrom \\([^\(].*\\):\\([1-9][0-9]*\\):in \`.*\'$" 1 2))
|
(defconst inferior-ruby-error-regexp-alist
|
||||||
compilation-error-regexp-alist-alist)
|
'(("SyntaxError: compile error\n^\\([^\(].*\\):\\([1-9][0-9]*\\):" 1 2)
|
||||||
(pushnew '(ruby ("SyntaxError: compile error\n^\\([^\(].*\\):\\([1-9][0-9]*\\):" 1 2))
|
("^\tfrom \\([^\(].*\\):\\([1-9][0-9]*\\)\\(:in `.*'\\)?$" 1 2)))
|
||||||
compilation-error-regexp-alist-alist)
|
|
||||||
|
|
||||||
(cond ((not inferior-ruby-mode-map)
|
(cond ((not inferior-ruby-mode-map)
|
||||||
(setq inferior-ruby-mode-map
|
(setq inferior-ruby-mode-map
|
||||||
@ -200,8 +209,9 @@ to continue it."
|
|||||||
(use-local-map inferior-ruby-mode-map)
|
(use-local-map inferior-ruby-mode-map)
|
||||||
(setq comint-input-filter (function ruby-input-filter))
|
(setq comint-input-filter (function ruby-input-filter))
|
||||||
(setq comint-get-old-input (function ruby-get-old-input))
|
(setq comint-get-old-input (function ruby-get-old-input))
|
||||||
(compilation-minor-mode)
|
(compilation-shell-minor-mode t)
|
||||||
(compilation-build-compilation-error-regexp-alist)
|
(make-local-variable 'compilation-error-regexp-alist)
|
||||||
|
(setq compilation-error-regexp-alist inferior-ruby-error-regexp-alist)
|
||||||
(run-hooks 'inferior-ruby-mode-hook))
|
(run-hooks 'inferior-ruby-mode-hook))
|
||||||
|
|
||||||
(defvar inferior-ruby-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'"
|
(defvar inferior-ruby-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'"
|
||||||
@ -268,16 +278,28 @@ of `ruby-program-name'). Runs the hooks `inferior-ruby-mode-hook'
|
|||||||
"Template for irb here document terminator.
|
"Template for irb here document terminator.
|
||||||
Must not contain ruby meta characters.")
|
Must not contain ruby meta characters.")
|
||||||
|
|
||||||
|
(defconst ruby-eval-separator "")
|
||||||
|
|
||||||
(defun ruby-send-region (start end)
|
(defun ruby-send-region (start end)
|
||||||
"Send the current region to the inferior Ruby process."
|
"Send the current region to the inferior Ruby process."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(let (term (file (buffer-file-name)) line)
|
(let (term (file (buffer-file-name)) line)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(save-restriction
|
||||||
|
(widen)
|
||||||
|
(goto-char start)
|
||||||
|
(setq line (+ start (forward-line (- start)) 1))
|
||||||
(goto-char start)
|
(goto-char start)
|
||||||
(setq line (line-number))
|
|
||||||
(while (progn
|
(while (progn
|
||||||
(setq term (apply 'format ruby-send-terminator (random) (current-time)))
|
(setq term (apply 'format ruby-send-terminator (random) (current-time)))
|
||||||
(re-search-forward (concat "^" (regexp-quote term) "$") end t))))
|
(re-search-forward (concat "^" (regexp-quote term) "$") end t)))))
|
||||||
|
;; compilation-parse-errors parses from second line.
|
||||||
|
(save-excursion
|
||||||
|
(let ((m (process-mark (ruby-proc))))
|
||||||
|
(set-buffer (marker-buffer m))
|
||||||
|
(goto-char m)
|
||||||
|
(insert ruby-eval-separator "\n")
|
||||||
|
(set-marker m (point))))
|
||||||
(comint-send-string (ruby-proc) (format "eval <<'%s', nil, %S, %d\n" term file line))
|
(comint-send-string (ruby-proc) (format "eval <<'%s', nil, %S, %d\n" term file line))
|
||||||
(comint-send-region (ruby-proc) start end)
|
(comint-send-region (ruby-proc) start end)
|
||||||
(comint-send-string (ruby-proc) (concat "\n" term "\n"))))
|
(comint-send-string (ruby-proc) (concat "\n" term "\n"))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user