]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/trepan3k/track-mode.el
fb5fe77938d0127cc30891041ded5c3be3eccb0f
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / trepan3k / track-mode.el
1 ;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; Python "trepan3k" Debugger tracking a comint 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:trepan3k-")
14 (require-relative-list '("../../lang/python") "realgud-lang-")
15
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-python-populate-command-keys 'realgud-lang-python)
21
22 (realgud-track-mode-vars "trepan3k")
23
24 (declare-function realgud-track-mode(bool))
25
26 (realgud-python-populate-command-keys trepan3k-track-mode-map)
27
28 (defun trepan3k-track-mode-hook()
29 (if trepan3k-track-mode
30 (progn
31 (use-local-map trepan3k-track-mode-map)
32 (message "using trepan3k mode map")
33 )
34 (message "trepan3k track-mode-hook disable called")
35 )
36 )
37
38 (define-minor-mode trepan3k-track-mode
39 "Minor mode for tracking trepan3k source locations inside a process shell via realgud. trepan3k is a Python debugger. See URL `http://code.google.com/p/python3-trepan/'.
40
41 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.
42
43 \\{trepan3k-track-mode-map}
44 "
45 :init-value nil
46 ;; :lighter " trepan3k" ;; mode-line indicator from realgud-track is sufficient.
47 ;; The minor mode bindings.
48 :global nil
49 :group 'realgud:trepan3k
50 :keymap trepan3k-track-mode-map
51 (realgud:track-set-debugger "trepan3k")
52 (if trepan3k-track-mode
53 (progn
54 (realgud-track-mode-setup 't)
55 (trepan3k-track-mode-hook))
56 (progn
57 (setq realgud-track-mode nil)
58 ))
59 )
60
61 (define-key trepan3k-short-key-mode-map "T" 'realgud:cmd-backtrace)
62
63 (provide-me "realgud:trepan3k-")