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.

74 lines
2.4 KiB

  1. ;;; track-mode.el ---
  2. ;; Copyright (C) 2015-2016 Free Software Foundation, Inc
  3. ;; Author: Rocky Bernstein <rocky@gnu.org>
  4. ;; This program is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. ;; gdb tracking a comint or eshell buffer.
  15. (require 'load-relative)
  16. (require-relative-list '(
  17. "../../common/cmds"
  18. "../../common/menu"
  19. "../../common/track"
  20. "../../common/track-mode"
  21. )
  22. "realgud-")
  23. (require-relative-list '("core" "init") "realgud:gdb-")
  24. (realgud-track-mode-vars "realgud:gdb")
  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-enable 'realgud-track-mode)
  28. (declare-function realgud-track-mode-setup 'realgud-track-mode)
  29. (declare-function realgud:track-set-debugger 'realgud-track-mode)
  30. (define-key realgud:gdb-track-mode-map
  31. (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
  32. (defun realgud:gdb-track-mode-hook()
  33. (use-local-map realgud:gdb-track-mode-map)
  34. (realgud-track-mode-setup 't)
  35. (message "realgud:gdb track-mode-hook called")
  36. )
  37. (define-minor-mode realgud:gdb-track-mode
  38. "Minor mode for tracking gdb inside a process shell via realgud.
  39. 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.
  40. Key bindings:
  41. \\{realgud:gdb-track-mode-map}
  42. "
  43. :init-value nil
  44. ;; :lighter " gdb" ;; mode-line indicator from realgud-track is sufficient.
  45. ;; The minor mode bindings.
  46. :global nil
  47. :group 'realgud:gdb
  48. :keymap realgud:gdb-track-mode-map
  49. (if realgud:gdb-track-mode
  50. (progn
  51. (realgud:track-set-debugger "gdb")
  52. (realgud:gdb-track-mode-hook)
  53. (realgud:track-mode-enable))
  54. (progn
  55. (setq realgud-track-mode nil)
  56. ))
  57. )
  58. (provide-me "realgud:gdb-")
  59. ;;; track-mode.el ends here