1 ;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; Ruby "trepan" Debugger tracking a comint or eshell buffer.
4 (eval-when-compile (require 'cl))
5 (require 'load-relative)
6 (require-relative-list '(
10 "../../common/track-mode"
13 (require-relative-list '("core" "init") "realgud:trepan-")
14 (require-relative-list '("../../lang/ruby") "realgud-lang-")
16 (declare-function realgud-track-mode 'realgud-track-mode)
17 (declare-function realgud-track-mode-hook 'realgud-track-mode)
18 (declare-function realgud-track-mode-setup 'realgud-track-mode)
19 (declare-function realgud:track-set-debugger 'realgud-track-mode)
20 (declare-function realgud-goto-line-for-pt 'realgud-track-mode)
22 (realgud-track-mode-vars "trepan")
24 (define-key realgud-track-mode-map
25 (kbd "C-c !!") 'realgud:goto-lang-backtrace-line)
26 (define-key realgud-track-mode-map
27 (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
29 (declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
31 (defun realgud:trepan-goto-control-frame-line (pt)
32 "Display the location mentioned by a control-frame line
35 (realgud-goto-line-for-pt pt "control-frame"))
37 (defun realgud:trepan-goto-syntax-error-line (pt)
38 "Display the location mentioned in a Syntax error line
41 (realgud-goto-line-for-pt pt "syntax-error"))
43 (realgud:ruby-populate-command-keys trepan-track-mode-map)
45 (define-key trepan-track-mode-map
46 (kbd "C-c !c") 'realgud:trepan-goto-control-frame-line)
47 (define-key trepan-track-mode-map
48 (kbd "C-c !s") 'realgud:trepan-goto-syntax-error-line)
50 (defun trepan-track-mode-hook()
53 (use-local-map trepan-track-mode-map)
54 (message "using trepan mode map")
56 (message "trepan track-mode-hook disable called"))
59 (define-minor-mode trepan-track-mode
60 "Minor mode for tracking trepan source locations inside a process shell via realgud. trepan is a Ruby debugger.
62 If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise.
64 \\{trepan-track-mode-map}
67 ;; :lighter " trepan" ;; mode-line indicator from realgud-track is sufficient.
68 ;; The minor mode bindings.
70 :group 'realgud:trepan
71 :keymap trepan-track-mode-map
72 (realgud:track-set-debugger "trepan")
75 (realgud-track-mode-setup 't)
76 (trepan-track-mode-hook))
78 (setq realgud-track-mode nil)
82 (provide-me "realgud:trepan-")