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.

84 lines
2.9 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. ;;; "trepanjs" Debugger tracking a comint or eshell buffer.
  14. (require 'load-relative)
  15. (require-relative-list '(
  16. "../../common/cmds"
  17. "../../common/menu"
  18. "../../common/track"
  19. "../../common/track-mode"
  20. "../../common/utils"
  21. )
  22. "realgud-")
  23. (require-relative-list '("core" "init") "realgud:trepanjs-")
  24. ;; (require-relative-list '("../../lang/js") "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-goto-line-for-pt 'realgud-track-mode)
  30. (declare-function realgud:remove-ansi-schmutz 'realgud:utils)
  31. (realgud-track-mode-vars "trepanjs")
  32. (define-key realgud-track-mode-map
  33. (kbd "C-c !!") 'realgud:goto-lang-backtrace-line)
  34. (define-key realgud-track-mode-map
  35. (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
  36. (declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
  37. (define-key trepanjs-track-mode-map
  38. (kbd "C-c !s") 'realgud:js-goto-syntax-error-line)
  39. (defun trepanjs-track-mode-hook()
  40. (if trepanjs-track-mode
  41. (progn
  42. (use-local-map trepanjs-track-mode-map)
  43. (realgud:remove-ansi-schmutz)
  44. (message "using trepanjs mode map")
  45. )
  46. (message "trepanjs track-mode-hook disable called"))
  47. )
  48. (define-minor-mode trepanjs-track-mode
  49. "Minor mode for tracking trepanjs source locations inside a process shell via realgud. trepanjs is a Ruby debugger.
  50. 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.
  51. \\{trepanjs-track-mode-map}
  52. "
  53. :init-value nil
  54. ;; :lighter " trepanjs" ;; mode-line indicator from realgud-track is sufficient.
  55. ;; The minor mode bindings.
  56. :global nil
  57. :group 'realgud:trepanjs
  58. :keymap trepanjs-track-mode-map
  59. (realgud:track-set-debugger "trepanjs")
  60. (if trepanjs-track-mode
  61. (progn
  62. (realgud-track-mode-setup 't)
  63. (trepanjs-track-mode-hook))
  64. (progn
  65. (setq realgud-track-mode nil)
  66. ))
  67. )
  68. (provide-me "realgud:trepanjs-")