Personal emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.5 KiB

  1. ;; Copyright (C) 2015-2016 Free Software Foundation, Inc
  2. ;; Author: Rocky Bernstein <rocky@gnu.org>
  3. ;; This program is free software; you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;; This program is distributed in the hope that it will be useful,
  8. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ;; GNU General Public License for more details.
  11. ;; You should have received a copy of the GNU General Public License
  12. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ;; Python "pdb" Debugger tracking a comint buffer.
  14. (require 'load-relative)
  15. (require-relative-list '(
  16. "../../common/cmds"
  17. "../../common/menu"
  18. "../../common/track"
  19. "../../common/track-mode"
  20. )
  21. "realgud-")
  22. (require-relative-list '("core" "init") "realgud:pdb-")
  23. (realgud-track-mode-vars "pdb")
  24. (declare-function realgud-track-mode 'realgud-track-mode)
  25. (declare-function realgud-track-mode-setup 'realgud-track-mode)
  26. (declare-function realgud:track-set-debugger 'realgud-track-mode)
  27. (declare-function realgud-python-populate-command-keys 'realgud-lang-python)
  28. (realgud-python-populate-command-keys pdb-track-mode-map)
  29. (defun pdb-track-mode-hook()
  30. (if pdb-track-mode
  31. (progn
  32. (use-local-map pdb-track-mode-map)
  33. (message "using pdb mode map")
  34. )
  35. (message "pdb track-mode-hook disable called")
  36. )
  37. )
  38. (define-minor-mode pdb-track-mode
  39. "Minor mode for tracking pdb source locations inside a process shell via realgud. pdb is the stock Python debugger.
  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. a process shell.
  42. \\{pdb-track-mode-map}
  43. "
  44. :init-value nil
  45. ;; :lighter " pdb" ;; mode-line indicator from realgud-track is sufficient.
  46. ;; The minor mode bindings.
  47. :global nil
  48. :group 'realgud:pdb
  49. :keymap pdb-track-mode-map
  50. (realgud:track-set-debugger "pdb")
  51. (if pdb-track-mode
  52. (progn
  53. (realgud-track-mode-setup 't)
  54. (pdb-track-mode-hook))
  55. (progn
  56. (setq realgud-track-mode nil)
  57. ))
  58. )
  59. (provide-me "realgud:pdb-")