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.

77 lines
2.7 KiB

  1. ;; Copyright (C) 2010-2012, 2014-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. ;;
  14. ;; Python "trepan2" Debugger tracking in a comint or eshell buffer.
  15. (require 'load-relative)
  16. (require-relative-list '(
  17. "../../common/cmds"
  18. "../../common/menu"
  19. "../../common/track"
  20. "../../common/track-mode"
  21. )
  22. "realgud-")
  23. (require-relative-list '("core" "init") "realgud:trepan2-")
  24. (require-relative-list '("../../lang/python") "realgud-lang-")
  25. (declare-function realgud-track-mode 'realgud-track-mode)
  26. (declare-function realgud-track-mode-hook 'realgud-track-mode)
  27. (declare-function realgud-track-mode-setup 'realgud-track-mode)
  28. (declare-function realgud:track-set-debugger 'realgud-track-mode)
  29. (declare-function realgud-python-populate-command-keys 'realgud-lang-python)
  30. (realgud-track-mode-vars "trepan2")
  31. (realgud-python-populate-command-keys trepan2-track-mode-map)
  32. (defun trepan2-track-mode-hook()
  33. (if trepan2-track-mode
  34. (progn
  35. (use-local-map trepan2-track-mode-map)
  36. (message "using trepan2 mode map")
  37. )
  38. (message "trepan2 track-mode-hook disable called")
  39. )
  40. )
  41. (define-minor-mode trepan2-track-mode
  42. "Minor mode for tracking trepan2 source locations inside a process shell via realgud. trepan2 is a Python debugger. See URL `https://github.com/rocky/emacs-dbgr/rocky/python2-trepan/'.
  43. 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.
  44. \\{trepan2-track-mode-map}
  45. "
  46. :init-value nil
  47. ;; :lighter " trepan2" ;; mode-line indicator from realgud-track is sufficient.
  48. ;; The minor mode bindings.
  49. :global nil
  50. :group 'realgud:trepan2
  51. :keymap trepan2-track-mode-map
  52. (realgud:track-set-debugger "trepan2")
  53. (if trepan2-track-mode
  54. (progn
  55. (realgud-track-mode-setup 't)
  56. (trepan2-track-mode-hook))
  57. (progn
  58. (setq realgud-track-mode nil)
  59. ))
  60. )
  61. (define-key trepan2-short-key-mode-map "T" 'realgud:cmd-backtrace)
  62. (provide-me "realgud:trepan2-")