Mercurial > emacs
comparison lisp/progmodes/gud.el @ 66887:a3db1720a101
(gud-menu-map, gud-tool-bar-map): Re-define buttons and include new ones.
(gud-tool-bar-item-visible-no-fringe): New function.
(gud-menu-map): Use it.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Tue, 15 Nov 2005 12:27:29 +0000 |
parents | 4e016bc4dac4 |
children | b9eae5edf0dc |
comparison
equal
deleted
inserted
replaced
66886:10f616ac16f1 | 66887:a3db1720a101 |
---|---|
120 (select-frame (make-frame))) | 120 (select-frame (make-frame))) |
121 (if (memq gud-minor-mode '(gdbmi gdba)) | 121 (if (memq gud-minor-mode '(gdbmi gdba)) |
122 (info "(emacs)GDB Graphical Interface") | 122 (info "(emacs)GDB Graphical Interface") |
123 (info "(emacs)Debuggers")))) | 123 (info "(emacs)Debuggers")))) |
124 | 124 |
125 (defun gud-tool-bar-item-visible-no-fringe () | |
126 (not (or (eq (buffer-local-value 'major-mode (window-buffer)) 'speedbar-mode) | |
127 (and (memq gud-minor-mode '(gdbmi gdba)) | |
128 (> (car (window-fringes)) 0))))) | |
129 | |
125 (easy-mmode-defmap gud-menu-map | 130 (easy-mmode-defmap gud-menu-map |
126 '(([help] "Info" . gud-goto-info) | 131 '(([help] "Info" . gud-goto-info) |
127 ([tooltips] menu-item "Toggle GUD tooltips" gud-tooltip-mode | 132 ([tooltips] menu-item "Toggle GUD tooltips" gud-tooltip-mode |
128 :enable (and (not emacs-basic-display) | 133 :enable (and (not emacs-basic-display) |
129 (display-graphic-p) | 134 (display-graphic-p) |
130 (fboundp 'x-show-tip)) | 135 (fboundp 'x-show-tip)) |
131 :button (:toggle . gud-tooltip-mode)) | 136 :button (:toggle . gud-tooltip-mode)) |
132 ([refresh] "Refresh" . gud-refresh) | 137 ([refresh] "Refresh" . gud-refresh) |
133 ([run] menu-item "Run" gud-run | 138 ([run] menu-item "Run" gud-run |
134 :enable (and (not gud-running) | 139 :enable (and (not gud-running) |
135 (memq gud-minor-mode '(gdbmi gdba gdb dbx jdb)))) | 140 (memq gud-minor-mode '(gdbmi gdb dbx jdb))) |
141 :visible (not (eq gud-minor-mode 'gdba))) | |
142 ([go] menu-item "Run/Continue" gud-go | |
143 :enable (not gud-running) | |
144 :visible (eq gud-minor-mode 'gdba)) | |
145 ([stop] menu-item "Stop" comint-interrupt-subjob | |
146 :enable gud-running) | |
136 ([until] menu-item "Continue to selection" gud-until | 147 ([until] menu-item "Continue to selection" gud-until |
137 :enable (and (not gud-running) | 148 :enable (and (not gud-running) |
138 (memq gud-minor-mode '(gdbmi gdba gdb perldb))) | 149 (memq gud-minor-mode '(gdbmi gdba gdb perldb))) |
139 :visible (not (and (memq gud-minor-mode '(gdbmi gdba)) | 150 :visible (gud-tool-bar-item-visible-no-fringe)) |
140 (> (car (window-fringes)) 0)))) | |
141 ([remove] menu-item "Remove Breakpoint" gud-remove | 151 ([remove] menu-item "Remove Breakpoint" gud-remove |
142 :enable (not gud-running) | 152 :enable (not gud-running) |
143 :visible (not (and (memq gud-minor-mode '(gdbmi gdba)) | 153 :visible (gud-tool-bar-item-visible-no-fringe)) |
144 (> (car (window-fringes)) 0)))) | |
145 ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak | 154 ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak |
146 :enable (memq gud-minor-mode | 155 :enable (memq gud-minor-mode |
147 '(gdbmi gdba gdb sdb xdb bashdb))) | 156 '(gdbmi gdba gdb sdb xdb bashdb))) |
148 ([break] menu-item "Set Breakpoint" gud-break | 157 ([break] menu-item "Set Breakpoint" gud-break |
149 :enable (not gud-running) | 158 :enable (not gud-running) |
150 :visible (not (and (memq gud-minor-mode '(gdbmi gdba)) | 159 :visible (gud-tool-bar-item-visible-no-fringe)) |
151 (> (car (window-fringes)) 0)))) | |
152 ([up] menu-item "Up Stack" gud-up | 160 ([up] menu-item "Up Stack" gud-up |
153 :enable (and (not gud-running) | 161 :enable (and (not gud-running) |
154 (memq gud-minor-mode | 162 (memq gud-minor-mode |
155 '(gdbmi gdba gdb dbx xdb jdb pdb bashdb)))) | 163 '(gdbmi gdba gdb dbx xdb jdb pdb bashdb)))) |
156 ([down] menu-item "Down Stack" gud-down | 164 ([down] menu-item "Down Stack" gud-down |
161 :enable (and (not gud-running) | 169 :enable (and (not gud-running) |
162 gdb-active-process) | 170 gdb-active-process) |
163 :visible (and (string-equal | 171 :visible (and (string-equal |
164 (buffer-local-value | 172 (buffer-local-value |
165 'gud-target-name gud-comint-buffer) "emacs") | 173 'gud-target-name gud-comint-buffer) "emacs") |
166 (memq gud-minor-mode '(gdbmi gdba)))) | 174 (eq gud-minor-mode 'gdba))) |
167 ([print*] menu-item "Print Dereference" gud-pstar | 175 ([print*] menu-item "Print Dereference" gud-pstar |
168 :enable (and (not gud-running) | 176 :enable (and (not gud-running) |
169 (memq gud-minor-mode '(gdbmi gdba gdb)))) | 177 (memq gud-minor-mode '(gdbmi gdba gdb)))) |
170 ([print] menu-item "Print Expression" gud-print | 178 ([print] menu-item "Print Expression" gud-print |
171 :enable (not gud-running)) | 179 :enable (not gud-running)) |
185 ([step] menu-item "Step Line" gud-step | 193 ([step] menu-item "Step Line" gud-step |
186 :enable (not gud-running)) | 194 :enable (not gud-running)) |
187 ([next] menu-item "Next Line" gud-next | 195 ([next] menu-item "Next Line" gud-next |
188 :enable (not gud-running)) | 196 :enable (not gud-running)) |
189 ([cont] menu-item "Continue" gud-cont | 197 ([cont] menu-item "Continue" gud-cont |
190 :enable (not gud-running))) | 198 :enable (not gud-running) |
199 :visible (not (eq gud-minor-mode 'gdba)))) | |
191 "Menu for `gud-mode'." | 200 "Menu for `gud-mode'." |
192 :name "Gud") | 201 :name "Gud") |
193 | 202 |
194 (easy-mmode-defmap gud-minor-mode-map | 203 (easy-mmode-defmap gud-minor-mode-map |
195 `(([menu-bar debug] . ("Gud" . ,gud-menu-map))) | 204 `(([menu-bar debug] . ("Gud" . ,gud-menu-map))) |
211 (gud-remove . "gud/remove") | 220 (gud-remove . "gud/remove") |
212 (gud-print . "gud/print") | 221 (gud-print . "gud/print") |
213 (gud-pstar . "gud/pstar") | 222 (gud-pstar . "gud/pstar") |
214 (gud-pp . "gud/pp") | 223 (gud-pp . "gud/pp") |
215 (gud-watch . "gud/watch") | 224 (gud-watch . "gud/watch") |
225 (gud-finish . "gud/finish") | |
226 (gud-until . "gud/until") | |
216 (gud-cont . "gud/cont") | 227 (gud-cont . "gud/cont") |
217 (gud-until . "gud/until") | |
218 (gud-finish . "gud/finish") | |
219 (gud-run . "gud/run") | 228 (gud-run . "gud/run") |
229 (gud-go . "gud/go") | |
230 (comint-interrupt-subjob . "gud/stop") | |
220 ;; gud-s, gud-si etc. instead of gud-step, | 231 ;; gud-s, gud-si etc. instead of gud-step, |
221 ;; gud-stepi, to avoid file-name clashes on DOS | 232 ;; gud-stepi, to avoid file-name clashes on DOS |
222 ;; 8+3 filesystems. | 233 ;; 8+3 filesystems. |
223 (gud-next . "gud/next") | 234 (gud-next . "gud/next") |
224 (gud-step . "gud/step") | 235 (gud-step . "gud/step") |