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.

71 lines
2.2 KiB

  1. ;; Copyright (C) 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. ;;; "zshdb" 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:zshdb-")
  17. (require-relative "../../lang/posix-shell" nil "realgud-lang-")
  18. (declare-function realgud:track-set-debugger 'realgud-track-mode)
  19. (declare-function realgud-track-mode-setup 'realgud-track-mode)
  20. (declare-function realgud-posix-shell-populate-command-keys
  21. 'realgud-lang-posix-shell)
  22. (declare-function realgud:zshdb-remove-ansi-schmutz 'realgud:zshdb-core)
  23. (realgud-track-mode-vars "zshdb")
  24. (realgud-posix-shell-populate-command-keys zshdb-track-mode-map)
  25. (declare-function realgud-track-mode(bool))
  26. (defun zshdb-track-mode-hook()
  27. (if zshdb-track-mode
  28. (progn
  29. (use-local-map zshdb-track-mode-map)
  30. (realgud:zshdb-remove-ansi-schmutz)
  31. (message "using zshdb mode map")
  32. )
  33. (message "zshdb track-mode-hook disable called"))
  34. )
  35. (define-minor-mode zshdb-track-mode
  36. "Minor mode for tracking zshdb source locations inside a process shell via realgud. zshdb is a zsh debugger.
  37. 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.
  38. \\{zshdb-track-mode-map}
  39. "
  40. :init-value nil
  41. ;; :lighter " zshdb" ;; mode-line indicator from realgud-track is sufficient.
  42. ;; The minor mode bindings.
  43. :global nil
  44. :group 'realgud:zshdb
  45. :keymap zshdb-track-mode-map
  46. (realgud:track-set-debugger "zshdb")
  47. (if zshdb-track-mode
  48. (progn
  49. (realgud-track-mode-setup 't)
  50. (zshdb-track-mode-hook))
  51. (progn
  52. (setq realgud-track-mode nil)
  53. ))
  54. )
  55. (define-key zshdb-short-key-mode-map "T" 'realgud:cmd-backtrace)
  56. (provide-me "realgud:zshdb-")