changeset 76904:ecc6f5a2f4cb

(gud-menu-map): Simplify. (gud-minor-mode-map): Add tool-bar like bindings to the text mode menubar.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 03 Apr 2007 01:07:16 +0000
parents 46d9bec9200e
children 624ef730616c
files lisp/progmodes/gud.el
diffstat 1 files changed, 41 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)))