]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/trepanx/track-mode.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / trepanx / track-mode.el
1 ;;; Copyright (C) 2010, 2012-2014 Rocky Bernstein <rocky@gnu.org>
2 ;;; Ruby "trepanx" Debugger tracking a comint or eshell buffer.
3
4 (eval-when-compile (require 'cl))
5 (require 'load-relative)
6 (require-relative-list '(
7 "../../common/cmds"
8 "../../common/menu"
9 "../../common/track"
10 "../../common/track-mode"
11 )
12 "realgud-")
13 (require-relative-list '("core" "init") "realgud:trepanx-")
14 (require-relative-list '("../../lang/ruby") "realgud-lang-")
15
16 (realgud-track-mode-vars "trepanx")
17
18 (declare-function realgud-track-mode(bool))
19
20 (declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
21 (declare-function realgud-track-mode 'realgud-track-mode)
22 (declare-function realgud-track-mode-hook 'realgud-track-mode)
23 (declare-function realgud-track-mode-setup 'realgud-track-mode)
24 (declare-function realgud:track-set-debugger 'realgud-track-mode)
25
26 (realgud:ruby-populate-command-keys trepanx-track-mode-map)
27
28 (define-key trepanx-track-mode-map
29 (kbd "C-c !x") 'realgud:rubinius-goto-Xagent-backtrace-line)
30 (define-key trepanx-track-mode-map
31 (kbd "C-c !!") 'realgud:ruby-goto-dollar-bang-line)
32
33 (defun trepanx-track-mode-hook()
34 (use-local-map trepanx-track-mode-map)
35 (message "trepanx track-mode-hook called")
36 )
37 (define-minor-mode trepanx-track-mode
38 "Minor mode for tracking trepanx source locations inside a process shell via realgud. trepanx is a Rubinius Ruby debugger.
39
40 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.
41
42 \\{trepanx-track-mode-map}"
43
44 :init-value nil
45 ;; :lighter " trepanx" ;; mode-line indicator from realgud-track is sufficient.
46 ;; The minor mode bindings.
47 :global nil
48 :group 'realgud:trepanx
49 :keymap trepanx-track-mode-map
50
51 (realgud:track-set-debugger "trepanx")
52 (if trepanx-track-mode
53 (progn
54 (realgud-track-mode-setup 't)
55 (trepanx-track-mode-hook))
56 (progn
57 (setq realgud-track-mode nil)
58 ))
59 )
60
61 (provide-me "realgud:trepanx-")