]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/pdb/track-mode.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / pdb / track-mode.el
1 ;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; Python "pdb" 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:pdb-")
14
15 (realgud-track-mode-vars "pdb")
16
17 (declare-function realgud-track-mode '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-python-populate-command-keys pdb-track-mode-map)
23
24 (defun pdb-track-mode-hook()
25 (if pdb-track-mode
26 (progn
27 (use-local-map pdb-track-mode-map)
28 (message "using pdb mode map")
29 )
30 (message "pdb track-mode-hook disable called")
31 )
32 )
33
34 (define-minor-mode pdb-track-mode
35 "Minor mode for tracking pdb source locations inside a process shell via realgud. pdb is the stock Python debugger.
36
37 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.
38
39 a process shell.
40
41 \\{pdb-track-mode-map}
42 "
43 :init-value nil
44 ;; :lighter " pdb" ;; mode-line indicator from realgud-track is sufficient.
45 ;; The minor mode bindings.
46 :global nil
47 :group 'realgud:pdb
48 :keymap pdb-track-mode-map
49 (realgud:track-set-debugger "pdb")
50 (if pdb-track-mode
51 (progn
52 (realgud-track-mode-setup 't)
53 (pdb-track-mode-hook))
54 (progn
55 (setq realgud-track-mode nil)
56 ))
57 )
58
59 (provide-me "realgud:pdb-")