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.

81 lines
2.8 KiB

  1. ;; Copyright (C) 2011-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. ;; Perl trepanning Debugger tracking a comint buffer.
  8. (require 'load-relative)
  9. (require-relative-list '(
  10. "../../common/cmds"
  11. "../../common/menu"
  12. "../../common/track"
  13. "../../common/track-mode"
  14. )
  15. "realgud-")
  16. (require-relative-list '("core" "init") "realgud:trepanpl-")
  17. (require-relative-list '("../../lang/perl") "realgud-lang-")
  18. (realgud-track-mode-vars "realgud:trepanpl")
  19. (declare-function realgud-goto-line-for-pt 'realgud-track-mode)
  20. (declare-function realgud-track-mode 'realgud-track-mode)
  21. (declare-function realgud-track-mode-setup 'realgud-track-mode)
  22. (declare-function realgud:track-mode-hook 'realgud-track-mode)
  23. (declare-function realgud:track-set-debugger 'realgud-track-mode)
  24. (declare-function realgud-perl-populate-command-keys 'realgud-lang-perl)
  25. (defun realgud:trepanpl-goto-syntax-error-line (pt)
  26. "Display the location mentioned in a Syntax error line
  27. described by PT."
  28. (interactive "d")
  29. (realgud-goto-line-for-pt pt "syntax-error"))
  30. (define-key realgud:trepanpl-track-mode-map
  31. (kbd "C-c !s") 'realgud:trepanpl-goto-syntax-error-line)
  32. (realgud-perl-populate-command-keys realgud:trepanpl-track-mode-map)
  33. (defun realgud:trepanpl-track-mode-hook()
  34. (if realgud:trepanpl-track-mode
  35. (progn
  36. (use-local-map realgud:trepanpl-track-mode-map)
  37. (message "using trepanpl mode map")
  38. )
  39. (message "trepan.pl track-mode-hook disable called"))
  40. )
  41. (define-minor-mode realgud:trepanpl-track-mode
  42. "Minor mode for tracking trepan.pl source locations inside a
  43. process shell via realgud. trepan.pl is a Perl debugger see URL
  44. `https://metacpan.org/pod/Devel::Trepan'.
  45. If called interactively with no prefix argument, the mode is
  46. toggled. A prefix argument, captured as ARG, enables the mode if
  47. the argument is positive, and disables it otherwise.
  48. "
  49. :init-value nil
  50. ;; :lighter " trepanpl" ;; mode-line indicator from realgud-track is sufficient.
  51. ;; The minor mode bindings.
  52. :global nil
  53. :group 'realgud:trepanpl
  54. :keymap realgud:trepanpl-track-mode-map
  55. (realgud:track-set-debugger "trepan.pl")
  56. (if realgud:trepanpl-track-mode
  57. (progn
  58. (realgud-track-mode-setup 't)
  59. (realgud:trepanpl-track-mode-hook))
  60. (progn
  61. (setq realgud-track-mode nil)
  62. ))
  63. )
  64. (define-key realgud:trepanpl-short-key-mode-map "T" 'realgud:cmd-backtrace)
  65. (provide-me "realgud:trepanpl-")