init-gud.el 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ;;; GUD
  2. ;;; Set GUD to display many windows by default.
  3. (setq gdb-many-windows t)
  4. ;;; Change GUD many-windows layout.
  5. (defun gdb-setup-windows ()
  6. "Layout the window pattern for `gdb-many-windows'.
  7. Do not set `gdb-show-main' to true as we handle it manually here."
  8. (setq gdb-source-window (selected-window))
  9. (gdb-display-locals-buffer)
  10. (delete-other-windows)
  11. (gdb-display-stack-buffer)
  12. (delete-other-windows)
  13. (gdb-display-breakpoints-buffer)
  14. (delete-other-windows)
  15. (switch-to-buffer
  16. (if gud-last-last-frame
  17. (gud-find-file (car gud-last-last-frame))
  18. (if gdb-main-file
  19. (gud-find-file gdb-main-file)
  20. ;; Put buffer list in window if we can't find a source file.
  21. (list-buffers-noselect))))
  22. (split-window-horizontally)
  23. (other-window 1)
  24. (split-window nil (/ ( * (window-height) 3) 4))
  25. (split-window nil (/ (window-height) 3))
  26. (gdb-set-window-buffer (gdb-locals-buffer-name))
  27. (split-window-horizontally)
  28. (other-window 1)
  29. (gdb-set-window-buffer (gdb-get-buffer-create 'gdb-inferior-io))
  30. (other-window 1)
  31. (gdb-set-window-buffer gud-comint-buffer)
  32. (other-window 1)
  33. (gdb-set-window-buffer (gdb-stack-buffer-name))
  34. (split-window-horizontally)
  35. (other-window 1)
  36. (gdb-set-window-buffer (gdb-breakpoints-buffer-name))
  37. (other-window 1))
  38. (provide 'init-gud)