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