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.

80 lines
2.7 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. ;;; Mode for parsing various kinds of backtraces found in JavaScript
  14. (require 'load-relative)
  15. (require-relative-list '(
  16. "../../common/cmds"
  17. "../../common/menu"
  18. "../../common/track-mode"
  19. "../../common/backtrack-mode"
  20. )
  21. "realgud-")
  22. (require-relative-list '("core" "init") "realgud:trepanjs-")
  23. (require-relative-list '("../../lang/ruby") "realgud-lang-")
  24. (realgud-backtrack-mode-vars "trepanjs")
  25. (set-keymap-parent trepanjs-backtrack-mode-map realgud-backtrack-mode-map)
  26. (declare-function realgud-backtrack-mode 'realgud-common-backtrack-mode)
  27. (declare-function realgud-backtrack-set-debugger 'realgud-common-backtrack-mode)
  28. (declare-function realgud-goto-line-for-pt 'realgud-common-backtrack-mode)
  29. (declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
  30. (defun realgud:trepanjs-goto-control-frame-line (pt)
  31. "Display the location mentioned by a control-frame line
  32. described by PT."
  33. (interactive "d")
  34. (realgud-goto-line-for-pt pt "control-frame"))
  35. (realgud:ruby-populate-command-keys trepanjs-backtrack-mode-map)
  36. (define-key trepanjs-backtrack-mode-map
  37. (kbd "C-c !c") 'realgud:trepanjs-goto-control-frame-line)
  38. (define-minor-mode trepanjs-backtrack-mode
  39. "Minor mode for tracking ruby debugging inside a file which may not have process shell.
  40. \\{trepanjs-backtrack-mode-map}
  41. "
  42. :init-value nil
  43. ;; :lighter " trepanjs" ;; mode-line indicator from realgud-track is sufficient.
  44. ;; The minor mode bindings.
  45. :global nil
  46. :group 'realgud:trepanjs
  47. :keymap trepanjs-backtrack-mode-map
  48. (realgud-backtrack-set-debugger "trepanjs")
  49. (if trepanjs-backtrack-mode
  50. (progn
  51. (realgud-backtrack-mode 't)
  52. (run-mode-hooks (intern (trepanjs-backtrack-mode-hook))))
  53. (progn
  54. (realgud-backtrack-mode nil)
  55. ))
  56. )
  57. (defun trepanjs-backtrack-mode-hook()
  58. (if trepanjs-backtrack-mode
  59. (progn
  60. (use-local-map trepanjs-backtrack-mode-map)
  61. (message "using trepanjs mode map")
  62. )
  63. (message "trepanjs backtrack-mode-hook disable called"))
  64. )
  65. (provide-me "realgud:trepanjs-")