# HG changeset patch # User Nick Roberts # Date 1132057649 0 # Node ID a3db1720a1010a1896c594e64671834db1b508a4 # Parent 10f616ac16f14b993762bcb62333ecd6fe27a3be (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. diff -r 10f616ac16f1 -r a3db1720a101 lisp/progmodes/gud.el --- a/lisp/progmodes/gud.el Tue Nov 15 12:25:49 2005 +0000 +++ b/lisp/progmodes/gud.el Tue Nov 15 12:27:29 2005 +0000 @@ -122,6 +122,11 @@ (info "(emacs)GDB Graphical Interface") (info "(emacs)Debuggers")))) +(defun gud-tool-bar-item-visible-no-fringe () + (not (or (eq (buffer-local-value 'major-mode (window-buffer)) 'speedbar-mode) + (and (memq gud-minor-mode '(gdbmi gdba)) + (> (car (window-fringes)) 0))))) + (easy-mmode-defmap gud-menu-map '(([help] "Info" . gud-goto-info) ([tooltips] menu-item "Toggle GUD tooltips" gud-tooltip-mode @@ -132,23 +137,26 @@ ([refresh] "Refresh" . gud-refresh) ([run] menu-item "Run" gud-run :enable (and (not gud-running) - (memq gud-minor-mode '(gdbmi gdba gdb dbx jdb)))) + (memq gud-minor-mode '(gdbmi gdb dbx jdb))) + :visible (not (eq gud-minor-mode 'gdba))) + ([go] menu-item "Run/Continue" gud-go + :enable (not gud-running) + :visible (eq gud-minor-mode 'gdba)) + ([stop] menu-item "Stop" comint-interrupt-subjob + :enable gud-running) ([until] menu-item "Continue to selection" gud-until :enable (and (not gud-running) (memq gud-minor-mode '(gdbmi gdba gdb perldb))) - :visible (not (and (memq gud-minor-mode '(gdbmi gdba)) - (> (car (window-fringes)) 0)))) + :visible (gud-tool-bar-item-visible-no-fringe)) ([remove] menu-item "Remove Breakpoint" gud-remove :enable (not gud-running) - :visible (not (and (memq gud-minor-mode '(gdbmi gdba)) - (> (car (window-fringes)) 0)))) + :visible (gud-tool-bar-item-visible-no-fringe)) ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak :enable (memq gud-minor-mode '(gdbmi gdba gdb sdb xdb bashdb))) ([break] menu-item "Set Breakpoint" gud-break :enable (not gud-running) - :visible (not (and (memq gud-minor-mode '(gdbmi gdba)) - (> (car (window-fringes)) 0)))) + :visible (gud-tool-bar-item-visible-no-fringe)) ([up] menu-item "Up Stack" gud-up :enable (and (not gud-running) (memq gud-minor-mode @@ -163,7 +171,7 @@ :visible (and (string-equal (buffer-local-value 'gud-target-name gud-comint-buffer) "emacs") - (memq gud-minor-mode '(gdbmi gdba)))) + (eq gud-minor-mode 'gdba))) ([print*] menu-item "Print Dereference" gud-pstar :enable (and (not gud-running) (memq gud-minor-mode '(gdbmi gdba gdb)))) @@ -187,7 +195,8 @@ ([next] menu-item "Next Line" gud-next :enable (not gud-running)) ([cont] menu-item "Continue" gud-cont - :enable (not gud-running))) + :enable (not gud-running) + :visible (not (eq gud-minor-mode 'gdba)))) "Menu for `gud-mode'." :name "Gud") @@ -213,10 +222,12 @@ (gud-pstar . "gud/pstar") (gud-pp . "gud/pp") (gud-watch . "gud/watch") - (gud-cont . "gud/cont") + (gud-finish . "gud/finish") (gud-until . "gud/until") - (gud-finish . "gud/finish") + (gud-cont . "gud/cont") (gud-run . "gud/run") + (gud-go . "gud/go") + (comint-interrupt-subjob . "gud/stop") ;; gud-s, gud-si etc. instead of gud-step, ;; gud-stepi, to avoid file-name clashes on DOS ;; 8+3 filesystems.