;;; tooltips for GUD
;;; Customizable settings
+
+;;;###autoload
+(define-minor-mode gud-tooltip-mode
+ "Toggle the display of GUD tooltips."
+ :global t
+ :group 'gud
+ :group 'tooltip
+ (require 'tooltip)
+ (if gud-tooltip-mode
+ (progn
+ (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
+ (add-hook 'pre-command-hook 'tooltip-hide)
+ (add-hook 'tooltip-hook 'gud-tooltip-tips)
+ (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
+ (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
+ (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
+ (remove-hook 'tooltip-hook 'gud-tooltip-tips)
+ (define-key global-map [mouse-movement] 'ignore)))
+ (gud-tooltip-activate-mouse-motions-if-enabled)
+ (if (and
+ gud-comint-buffer
+ (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
+ (with-current-buffer gud-comint-buffer
+ (memq gud-minor-mode '(gdbmi gdba))))
+ (if gud-tooltip-mode
+ (progn
+ (dolist (buffer (buffer-list))
+ (unless (eq buffer gud-comint-buffer)
+ (with-current-buffer buffer
+ (when (and (memq gud-minor-mode '(gdbmi gdba))
+ (not (string-match "\\`\\*.+\\*\\'"
+ (buffer-name))))
+ (make-local-variable 'gdb-define-alist)
+ (gdb-create-define-alist)
+ (add-hook 'after-save-hook
+ 'gdb-create-define-alist nil t))))))
+ (kill-local-variable 'gdb-define-alist)
+ (remove-hook 'after-save-hook 'gdb-create-define-alist t))))
+
(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode)
- "List of modes for which to enable GUD tips."
+ "List of modes for which to enable GUD tooltips."
:type 'sexp
:tag "GUD modes"
+ :group 'gud
:group 'tooltip)
(defcustom gud-tooltip-display
only tooltips in the buffer containing the overlay arrow."
:type 'sexp
:tag "GUD buffers predicate"
+ :group 'gud
:group 'tooltip)
(defcustom gud-tooltip-echo-area nil
"Use the echo area instead of frames for GUD tooltips."
:type 'boolean
- :tag "Use echo area"
+ :group 'gud
:group 'tooltip)
(define-obsolete-variable-alias 'tooltip-gud-modes
(define-obsolete-function-alias 'tooltip-gud-toggle-dereference
'toggle-gud-tooltip-dereference "22.1")
-;;;###autoload
-(define-minor-mode gud-tooltip-mode
- "Toggle the display of GUD tooltips."
- :global t
- :group 'gud
- (require 'tooltip)
- (if gud-tooltip-mode
- (progn
- (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
- (add-hook 'pre-command-hook 'tooltip-hide)
- (add-hook 'tooltip-hook 'gud-tooltip-tips)
- (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
- (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
- (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
- (remove-hook 'tooltip-hook 'gud-tooltip-tips)
- (define-key global-map [mouse-movement] 'ignore)))
- (gud-tooltip-activate-mouse-motions-if-enabled)
- (if (and
- gud-comint-buffer
- (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
- (with-current-buffer gud-comint-buffer
- (memq gud-minor-mode '(gdbmi gdba))))
- (if gud-tooltip-mode
- (progn
- (dolist (buffer (buffer-list))
- (unless (eq buffer gud-comint-buffer)
- (with-current-buffer buffer
- (when (and (memq gud-minor-mode '(gdbmi gdba))
- (not (string-match "\\`\\*.+\\*\\'"
- (buffer-name))))
- (make-local-variable 'gdb-define-alist)
- (gdb-create-define-alist)
- (add-hook 'after-save-hook
- 'gdb-create-define-alist nil t))))))
- (kill-local-variable 'gdb-define-alist)
- (remove-hook 'after-save-hook 'gdb-create-define-alist t))))
-
; This will only display data that comes in one chunk.
; Larger arrays (say 400 elements) are displayed in
; the tooltip incompletely and spill over into the gud buffer.