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.

83 lines
3.1 KiB

  1. ;; Copyright (C) 2019 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. ;;; Debugger Breakpoint buffer mode settings
  14. (require 'load-relative)
  15. (require-relative-list '("menu" "key") "realgud-")
  16. (require-relative-list '("buffer/command") "realgud-buffer-")
  17. (declare-function realgud-populate-debugger-menu 'realgud-menu)
  18. (declare-function realgud-populate-common-keys 'realgud-menu)
  19. (declare-function realgud-cmdbuf-pat 'realgud-menu)
  20. (defvar realgud:breakpoints-menu nil
  21. "menu in Breakpoints buffer.")
  22. (defvar realgud-breakpoint-mode-map
  23. (let ((map (realgud-populate-debugger-menu (make-sparse-keymap))))
  24. (suppress-keymap map)
  25. (realgud-populate-common-keys map)
  26. (define-key map "r" 'realgud:breakpoint-init)
  27. (define-key map [double-mouse-1] 'realgud:follow-event)
  28. (define-key map [mouse-2] 'realgud:follow-event)
  29. (define-key map [enter] 'realgud:follow-event)
  30. (define-key map [mouse-3] 'realgud:follow-event)
  31. (define-key map [enter] 'realgud:follow-event)
  32. (define-key map [return] 'realgud:follow-point)
  33. (define-key map "l" 'realgud-recenter-arrow)
  34. (define-key map [frames-menu]
  35. (list 'menu-item "Specific Frames" 'realgud:frames-menu))
  36. ;; FIXME: these can go to a common routine. See also shortkey.el and
  37. ;; key.el
  38. (define-key map "q" 'realgud:cmd-quit)
  39. (define-key map "C" 'realgud-window-cmd-undisturb-src)
  40. (define-key map "B" 'realgud:window-brkpt)
  41. (define-key map "I" 'realgud:cmdbuf-info-describe)
  42. (define-key map "S" 'realgud-window-src-undisturb-cmd)
  43. map)
  44. "Keymap to navigate realgud breakpoints.
  45. \\{realgud-breakpoint-mode-map}")
  46. (defun realgud-breakpoint-mode (&optional cmdbuf)
  47. "Major mode for displaying the stack frames.
  48. \\{realgud-frames-mode-map}"
  49. (interactive)
  50. (kill-all-local-variables)
  51. (setq buffer-read-only 't)
  52. (setq major-mode 'realgud-breakpoint-mode)
  53. (setq mode-name "Realgud Breakpoints")
  54. ;; (set (make-local-variable 'realgud-secondary-buffer) t)
  55. (setq mode-line-process 'realgud-mode-line-process)
  56. (use-local-map realgud-breakpoint-mode-map)
  57. ;; FIXME: make buffer specific
  58. (if cmdbuf
  59. (let* ((font-lock-breakpoint-keywords
  60. (with-current-buffer cmdbuf
  61. (realgud-cmdbuf-pat "font-lock-breakpoint-keywords"))))
  62. (if font-lock-breakpoint-keywords
  63. (set (make-local-variable 'font-lock-defaults)
  64. (list font-lock-breakpoint-keywords)))
  65. ))
  66. ;; (run-mode-hooks 'realgud-breakpoint-mode-hook)
  67. )
  68. (provide-me "realgud-")