aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2002-11-30 20:57:48 +0000
committerNick Roberts2002-11-30 20:57:48 +0000
commite057060c2d106c3732cedb06b86fd92a9a4e4110 (patch)
tree9de5e2e11816bfa9205b40a3d4716d593c819b10
parent6b1dc940a837196555e5d846ab72d1875a721005 (diff)
downloademacs-e057060c2d106c3732cedb06b86fd92a9a4e4110.tar.gz
emacs-e057060c2d106c3732cedb06b86fd92a9a4e4110.zip
(gdb-many-windows): Define as a minor mode.
(toggle-gdb-windows): Remove. (Patch from Stefan Monnier)
-rw-r--r--lisp/gdb-ui.el39
1 files changed, 7 insertions, 32 deletions
diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el
index e5f7dc6eb2b..e72b6605d43 100644
--- a/lisp/gdb-ui.el
+++ b/lisp/gdb-ui.el
@@ -31,12 +31,6 @@
31 31
32(require 'gud) 32(require 'gud)
33 33
34(defcustom gdb-many-windows t
35 "If t, using gdba, start gdb with ancillary buffers visible.
36Use `toggle-gdb-windows' to change this value during a gdb session"
37 :type 'boolean
38 :group 'gud)
39
40(defvar gdb-main-or-pc nil "Initialisation for Assembler buffer.") 34(defvar gdb-main-or-pc nil "Initialisation for Assembler buffer.")
41(defvar gdb-current-address nil) 35(defvar gdb-current-address nil)
42(defvar gdb-display-in-progress nil) 36(defvar gdb-display-in-progress nil)
@@ -90,7 +84,7 @@ the GUD and the source buffer.
90 84
91The following interactive lisp functions help control operation : 85The following interactive lisp functions help control operation :
92 86
93`toggle-gdb-windows' - Toggle the number of windows gdb uses. 87`gdb-many-windows' - Toggle the number of windows gdb uses.
94`gdb-restore-windows' - to restore the layout if its lost. 88`gdb-restore-windows' - to restore the layout if its lost.
95`gdb-quit' - to delete (most) of the buffers used by gdb." 89`gdb-quit' - to delete (most) of the buffers used by gdb."
96 90
@@ -2074,10 +2068,6 @@ buffer."
2074(if (display-graphic-p) 2068(if (display-graphic-p)
2075 (gdb-make-frames-menu gud-minor-mode-map)) 2069 (gdb-make-frames-menu gud-minor-mode-map))
2076 2070
2077;; end of functions from gdba.el
2078
2079;; new functions for gdb-ui.el
2080
2081(defvar gdb-main-file nil "Source file from which program execution begins.") 2071(defvar gdb-main-file nil "Source file from which program execution begins.")
2082 2072
2083;; layout for all the windows 2073;; layout for all the windows
@@ -2109,6 +2099,12 @@ buffer."
2109 (switch-to-buffer (gdb-breakpoints-buffer-name)) 2099 (switch-to-buffer (gdb-breakpoints-buffer-name))
2110 (other-window 1)) 2100 (other-window 1))
2111 2101
2102(define-minor-mode gdb-many-windows
2103 "Toggle the number of windows in the basic arrangement."
2104 :group 'gud
2105 :init-value t
2106 (gdb-restore-windows))
2107
2112(defun gdb-restore-windows () 2108(defun gdb-restore-windows ()
2113 "Restore the basic arrangement of windows used by gdba. 2109 "Restore the basic arrangement of windows used by gdba.
2114This arrangement depends on the value of `gdb-many-windows'." 2110This arrangement depends on the value of `gdb-many-windows'."
@@ -2129,27 +2125,6 @@ This arrangement depends on the value of `gdb-many-windows'."
2129 (gud-find-file gdb-main-file))) 2125 (gud-find-file gdb-main-file)))
2130 (other-window 1))) 2126 (other-window 1)))
2131 2127
2132(defun toggle-gdb-windows ()
2133 "Toggle the number of windows in the basic arrangement."
2134 (interactive)
2135 (if gdb-many-windows
2136 (progn
2137 (switch-to-buffer gud-comint-buffer)
2138 (delete-other-windows)
2139 (split-window)
2140 (other-window 1)
2141 (switch-to-buffer
2142 (if gud-last-last-frame
2143 (gud-find-file (car gud-last-last-frame))
2144 (gud-find-file gdb-main-file)))
2145 (other-window 1)
2146 (setq gdb-many-windows nil))
2147;else
2148 (switch-to-buffer gud-comint-buffer)
2149 (delete-other-windows)
2150 (gdb-setup-windows)
2151 (setq gdb-many-windows t)))
2152
2153(defconst breakpoint-xpm-data "/* XPM */ 2128(defconst breakpoint-xpm-data "/* XPM */
2154static char *magick[] = { 2129static char *magick[] = {
2155/* columns rows colors chars-per-pixel */ 2130/* columns rows colors chars-per-pixel */