Mercurial > emacs
comparison lisp/progmodes/gud.el @ 67890:a6271fd07ee3
(gud-tooltip-dereference): Rename from toggle-gud-tooltip-dereference.
(gud-tooltip-print-command): Move concatenation of "*" to expr to...
(gud-tooltip-tips): ...here when dereferencing.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Thu, 29 Dec 2005 02:03:20 +0000 |
parents | dda3dc3d3548 |
children | cbb3942260ab |
comparison
equal
deleted
inserted
replaced
67889:7ee3fee734b9 | 67890:a6271fd07ee3 |
---|---|
3341 | 3341 |
3342 (defvar gud-tooltip-event nil | 3342 (defvar gud-tooltip-event nil |
3343 "The mouse movement event that led to a tooltip display. | 3343 "The mouse movement event that led to a tooltip display. |
3344 This event can be examined by forms in GUD-TOOLTIP-DISPLAY.") | 3344 This event can be examined by forms in GUD-TOOLTIP-DISPLAY.") |
3345 | 3345 |
3346 (defun toggle-gud-tooltip-dereference () | 3346 (defun gud-tooltip-dereference () |
3347 "Toggle whether tooltips should show `* expr' or `expr'." | 3347 "Toggle whether tooltips should show `* expr' or `expr'. |
3348 (interactive) | 3348 With arg, dereference expr iff arg is positive." |
3349 (setq gud-tooltip-dereference (not gud-tooltip-dereference)) | 3349 (interactive "P") |
3350 (when (interactive-p) | 3350 (setq gud-tooltip-dereference |
3351 (message "Dereferencing is now %s." | 3351 (if (null arg) |
3352 (if gud-tooltip-dereference "on" "off")))) | 3352 (not gud-tooltip-dereference) |
3353 (> (prefix-numeric-value arg) 0))) | |
3354 (message "Dereferencing is now %s." | |
3355 (if gud-tooltip-dereference "on" "off"))) | |
3353 | 3356 |
3354 (define-obsolete-function-alias 'tooltip-gud-toggle-dereference | 3357 (define-obsolete-function-alias 'tooltip-gud-toggle-dereference |
3355 'toggle-gud-tooltip-dereference "22.1") | 3358 'gud-tooltip-dereference "22.1") |
3356 | 3359 |
3357 ; This will only display data that comes in one chunk. | 3360 ; This will only display data that comes in one chunk. |
3358 ; Larger arrays (say 400 elements) are displayed in | 3361 ; Larger arrays (say 400 elements) are displayed in |
3359 ; the tooltip incompletely and spill over into the gud buffer. | 3362 ; the tooltip incompletely and spill over into the gud buffer. |
3360 ; Switching the process-filter creates timing problems and | 3363 ; Switching the process-filter creates timing problems and |
3365 (set-process-filter process gud-tooltip-original-filter) | 3368 (set-process-filter process gud-tooltip-original-filter) |
3366 (tooltip-show (tooltip-strip-prompt process output) | 3369 (tooltip-show (tooltip-strip-prompt process output) |
3367 (or gud-tooltip-echo-area tooltip-use-echo-area))) | 3370 (or gud-tooltip-echo-area tooltip-use-echo-area))) |
3368 | 3371 |
3369 (defun gud-tooltip-print-command (expr) | 3372 (defun gud-tooltip-print-command (expr) |
3370 "Return a suitable command to print the expression EXPR. | 3373 "Return a suitable command to print the expression EXPR." |
3371 If GUD-TOOLTIP-DEREFERENCE is t, also prepend a `*' to EXPR." | |
3372 (when gud-tooltip-dereference | |
3373 (setq expr (concat "*" expr))) | |
3374 (case gud-minor-mode | 3374 (case gud-minor-mode |
3375 (gdba (concat "server print " expr)) | 3375 (gdba (concat "server print " expr)) |
3376 ((dbx gdbmi) (concat "print " expr)) | 3376 ((dbx gdbmi) (concat "print " expr)) |
3377 (xdb (concat "p " expr)) | 3377 (xdb (concat "p " expr)) |
3378 (sdb (concat expr "/")) | 3378 (sdb (concat expr "/")) |
3410 (unless (null define-elt) | 3410 (unless (null define-elt) |
3411 (tooltip-show | 3411 (tooltip-show |
3412 (cdr define-elt) | 3412 (cdr define-elt) |
3413 (or gud-tooltip-echo-area tooltip-use-echo-area)) | 3413 (or gud-tooltip-echo-area tooltip-use-echo-area)) |
3414 expr)))) | 3414 expr)))) |
3415 (when gud-tooltip-dereference | |
3416 (setq expr (concat "*" expr))) | |
3415 (let ((cmd (gud-tooltip-print-command expr))) | 3417 (let ((cmd (gud-tooltip-print-command expr))) |
3416 (when (and gud-tooltip-mode (eq gud-minor-mode 'gdb)) | 3418 (when (and gud-tooltip-mode (eq gud-minor-mode 'gdb)) |
3417 (gud-tooltip-mode -1) | 3419 (gud-tooltip-mode -1) |
3418 (message-box "Using GUD tooltips in this mode is unsafe\n\ | 3420 (message-box "Using GUD tooltips in this mode is unsafe\n\ |
3419 so they have been disabled.")) | 3421 so they have been disabled.")) |