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.

94 lines
3.1 KiB

  1. ;; Copyright (C) 2010, 2012-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. ;;; Ruby "trepan" Debugger tracking a comint or eshell buffer.
  12. (require 'load-relative)
  13. (require-relative-list '(
  14. "../../common/cmds"
  15. "../../common/menu"
  16. "../../common/track"
  17. "../../common/track-mode"
  18. )
  19. "realgud-")
  20. (require-relative-list '("core" "init") "realgud:trepan-")
  21. (require-relative-list '("../../lang/ruby") "realgud-lang-")
  22. (declare-function realgud-track-mode 'realgud-track-mode)
  23. (declare-function realgud-track-mode-hook 'realgud-track-mode)
  24. (declare-function realgud-track-mode-setup 'realgud-track-mode)
  25. (declare-function realgud:track-set-debugger 'realgud-track-mode)
  26. (declare-function realgud-goto-line-for-pt 'realgud-track-mode)
  27. (realgud-track-mode-vars "trepan")
  28. (define-key realgud-track-mode-map
  29. (kbd "C-c !!") 'realgud:goto-lang-backtrace-line)
  30. (define-key realgud-track-mode-map
  31. (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
  32. (declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
  33. (defun realgud:trepan-goto-control-frame-line (pt)
  34. "Display the location mentioned by a control-frame line
  35. described by PT."
  36. (interactive "d")
  37. (realgud-goto-line-for-pt pt "control-frame"))
  38. (defun realgud:trepan-goto-syntax-error-line (pt)
  39. "Display the location mentioned in a Syntax error line
  40. described by PT."
  41. (interactive "d")
  42. (realgud-goto-line-for-pt pt "syntax-error"))
  43. (realgud:ruby-populate-command-keys trepan-track-mode-map)
  44. (define-key trepan-track-mode-map
  45. (kbd "C-c !c") 'realgud:trepan-goto-control-frame-line)
  46. (define-key trepan-track-mode-map
  47. (kbd "C-c !s") 'realgud:trepan-goto-syntax-error-line)
  48. (defun trepan-track-mode-hook()
  49. (if trepan-track-mode
  50. (progn
  51. (use-local-map trepan-track-mode-map)
  52. (message "using trepan mode map")
  53. )
  54. (message "trepan track-mode-hook disable called"))
  55. )
  56. (define-minor-mode trepan-track-mode
  57. "Minor mode for tracking trepan source locations inside a process shell via realgud. trepan is a Ruby debugger.
  58. 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.
  59. \\{trepan-track-mode-map}
  60. "
  61. :init-value nil
  62. ;; :lighter " trepan" ;; mode-line indicator from realgud-track is sufficient.
  63. ;; The minor mode bindings.
  64. :global nil
  65. :group 'realgud:trepan
  66. :keymap trepan-track-mode-map
  67. (realgud:track-set-debugger "trepan")
  68. (if trepan-track-mode
  69. (progn
  70. (realgud-track-mode-setup 't)
  71. (trepan-track-mode-hook))
  72. (progn
  73. (setq realgud-track-mode nil)
  74. ))
  75. )
  76. (provide-me "realgud:trepan-")