;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers
-;; Copyright (C) 1992-1996, 1998, 2000-2013 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1992-1996, 1998, 2000-2013 Free Software Foundation, Inc.
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Maintainer: FSF
:group 'gud)
(global-set-key (vconcat gud-key-prefix "\C-l") 'gud-refresh)
-(define-key ctl-x-map " " 'gud-break) ;; backward compatibility hack
+;; (define-key ctl-x-map " " 'gud-break); backward compatibility hack
(defvar gud-marker-filter nil)
(put 'gud-marker-filter 'permanent-local t)
(when buf
;; Copy `gud-minor-mode' to the found buffer to turn on the menu.
(with-current-buffer buf
- (set (make-local-variable 'gud-minor-mode) minor-mode)
- (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+ (setq-local gud-minor-mode minor-mode)
+ (if (boundp 'tool-bar-map) ; not --without-x
+ (setq-local tool-bar-map gud-tool-bar-map))
(when (and gud-tooltip-mode
(eq gud-minor-mode 'gdbmi))
(make-local-variable 'gdb-define-alist)
(defvar gud-filter-pending-text nil
"Non-nil means this is text that has been saved for later in `gud-filter'.")
+;; One of the nice features of GDB is its impressive support for
+;; context-sensitive command completion. We preserve that feature
+;; in the GUD buffer by using a GDB command designed just for Emacs.
+
+(defvar gud-gdb-completion-function nil
+ "Completion function for GDB commands.
+It receives two arguments: COMMAND, the prefix for which we seek
+completion; and CONTEXT, the text before COMMAND on the line.
+It should return a list of completion strings.")
+
;; If in gdb mode, gdb-mi is loaded.
(declare-function gdb-restore-windows "gdb-mi" ())
(setq gud-filter-pending-text nil)
(run-hooks 'gud-gdb-mode-hook))
-;; One of the nice features of GDB is its impressive support for
-;; context-sensitive command completion. We preserve that feature
-;; in the GUD buffer by using a GDB command designed just for Emacs.
-
-(defvar gud-gdb-completion-function nil
- "Completion function for GDB commands.
-It receives two arguments: COMMAND, the prefix for which we seek
-completion; and CONTEXT, the text before COMMAND on the line.
-It should return a list of completion strings.")
-
;; The completion process filter indicates when it is finished.
(defvar gud-gdb-fetch-lines-in-progress)
(split-string
;; Eliminate any subclass references in the class
;; name string. These start with a "$"
- ((lambda (x)
- (if (string-match "$.*" x)
- (replace-match "" t t x) p))
- p)
+ (if (string-match "$.*" p)
+ (replace-match "" t t p) p)
"\\.") "/")
".java"))
(cplist (append gud-jdb-sourcepath gud-jdb-classpath))
(setq mode-line-process '(":%s"))
(define-key (current-local-map) "\C-c\C-l" 'gud-refresh)
(set (make-local-variable 'gud-last-frame) nil)
- (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+ (if (boundp 'tool-bar-map) ; not --without-x
+ (setq-local tool-bar-map gud-tool-bar-map))
(make-local-variable 'comint-prompt-regexp)
;; Don't put repeated commands in command history many times.
(set (make-local-variable 'comint-input-ignoredups) t)
;;; Customizable settings
+(defvar tooltip-mode)
+
;;;###autoload
(define-minor-mode gud-tooltip-mode
"Toggle the display of GUD tooltips.
:group 'gud
:group 'tooltip)
+(make-obsolete-variable 'gud-tooltip-echo-area
+ "disable Tooltip mode instead" "24.4" 'set)
+
;;; Reacting on mouse movements
(defun gud-tooltip-change-major-mode ()
"Process debugger output and show it in a tooltip window."
(remove-function (process-filter process) #'gud-tooltip-process-output)
(tooltip-show (tooltip-strip-prompt process output)
- (or gud-tooltip-echo-area tooltip-use-echo-area)))
+ (or gud-tooltip-echo-area tooltip-use-echo-area
+ (not tooltip-mode))))
(defun gud-tooltip-print-command (expr)
"Return a suitable command to print the expression EXPR."
(unless (null define-elt)
(tooltip-show
(cdr define-elt)
- (or gud-tooltip-echo-area tooltip-use-echo-area))
+ (or gud-tooltip-echo-area tooltip-use-echo-area
+ (not tooltip-mode)))
expr))))
(when gud-tooltip-dereference
(setq expr (concat "*" expr)))