# HG changeset patch # User Nick Roberts # Date 1175562436 0 # Node ID ecc6f5a2f4cb0335e184405a70410c549e1957d9 # Parent 46d9bec9200ebe3321b1c7dd1d1da0997bf69aae (gud-menu-map): Simplify. (gud-minor-mode-map): Add tool-bar like bindings to the text mode menubar. diff -r 46d9bec9200e -r ecc6f5a2f4cb lisp/progmodes/gud.el --- a/lisp/progmodes/gud.el Tue Apr 03 01:06:47 2007 +0000 +++ b/lisp/progmodes/gud.el Tue Apr 03 01:07:16 2007 +0000 @@ -147,8 +147,7 @@ ([refresh] "Refresh" . gud-refresh) ([run] menu-item "Run" gud-run :enable (not gud-running) - :visible (and (memq gud-minor-mode '(gdbmi gdb dbx jdb)) - (not (eq gud-minor-mode 'gdba)))) + :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) ([go] menu-item (if gdb-active-process "Continue" "Run") gud-go :visible (and (not gud-running) (eq gud-minor-mode 'gdba))) @@ -214,7 +213,46 @@ :name "Gud") (easy-mmode-defmap gud-minor-mode-map - `(([menu-bar debug] . ("Gud" . ,gud-menu-map))) + (append + `(([menu-bar debug] . ("Gud" . ,gud-menu-map))) + ;; Get tool bar like functionality from the menu bar on a text only + ;; terminal. + (unless window-system + `(([menu-bar down] + . (,(propertize "down" 'face 'font-lock-doc-face) . gud-down)) + ([menu-bar up] + . (,(propertize "up" 'face 'font-lock-doc-face) . gud-up)) + ([menu-bar finish] + . (,(propertize "finish" 'face 'font-lock-doc-face) . gud-finish)) + ([menu-bar step] + . (,(propertize "step" 'face 'font-lock-doc-face) . gud-step)) + ([menu-bar next] + . (,(propertize "next" 'face 'font-lock-doc-face) . gud-next)) + ([menu-bar until] menu-item + ,(propertize "until" 'face 'font-lock-doc-face) gud-until + :visible (memq gud-minor-mode '(gdbmi gdba gdb perldb))) + ([menu-bar cont] menu-item + ,(propertize "cont" 'face 'font-lock-doc-face) gud-cont + :visible (not (eq gud-minor-mode 'gdba))) + ([menu-bar run] menu-item + ,(propertize "run" 'face 'font-lock-doc-face) gud-run + :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) + ([menu-bar go] menu-item + ,(propertize "go" 'face 'font-lock-doc-face) gud-go + :visible (and (not gud-running) + (eq gud-minor-mode 'gdba))) + ([menu-bar stop] menu-item + ,(propertize "stop" 'face 'font-lock-doc-face) gud-stop-subjob + :visible (or (not (eq gud-minor-mode 'gdba)) + (and gud-running + (eq gud-minor-mode 'gdba)))) + ([menu-bar print] + . (,(propertize "print" 'face 'font-lock-doc-face) . gud-print)) + ([menu-bar tools] . undefined) + ([menu-bar buffer] . undefined) + ([menu-bar options] . undefined) + ([menu-bar edit] . undefined) + ([menu-bar file] . undefined)))) "Map used in visited files.") (let ((m (assq 'gud-minor-mode minor-mode-map-alist)))