aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2005-04-18 00:29:45 +0000
committerNick Roberts2005-04-18 00:29:45 +0000
commit1d6197fb8794bd87db1f69f3a3da8b281a1e187b (patch)
tree5de11531e4575dd00c1cb3d3cdf5e1a816b03b20
parent01c515bba383fac899cf661e70c498507e65b571 (diff)
downloademacs-1d6197fb8794bd87db1f69f3a3da8b281a1e187b.tar.gz
emacs-1d6197fb8794bd87db1f69f3a3da8b281a1e187b.zip
(tooltip-gud-echo-area): Rename from
tooltip-use-echo-area. (tooltip-show, tooltip-gud-process-output, gdb-tooltip-print) (tooltip-help-tips): Allow GUD tooltips to be displayed in echo area independently of where help tooltips are displayed.
-rw-r--r--lisp/tooltip.el24
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index f0620003cd6..c903dbac523 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -139,10 +139,8 @@ only tooltips in the buffer containing the overlay arrow."
139 :tag "GUD buffers predicate" 139 :tag "GUD buffers predicate"
140 :group 'tooltip) 140 :group 'tooltip)
141 141
142(defcustom tooltip-use-echo-area nil 142(defcustom tooltip-gud-echo-area nil
143 "Use the echo area instead of tooltip frames. 143 "Use the echo area instead of frames for GUD tooltips."
144This is only relevant GUD display, since otherwise it is equivalent to
145turning off Tooltip mode."
146 :type 'boolean 144 :type 'boolean
147 :tag "Use echo area" 145 :tag "Use echo area"
148 :group 'tooltip) 146 :group 'tooltip)
@@ -291,17 +289,19 @@ change the existing association. Value is the resulting alist."
291 (push (cons key value) alist)) 289 (push (cons key value) alist))
292 alist)) 290 alist))
293 291
294(defun tooltip-show (text) 292(defun tooltip-show (text gud-tip)
295 "Show a tooltip window displaying TEXT. 293 "Show a tooltip window displaying TEXT.
296 294
297Text larger than `x-max-tooltip-size' (which see) is clipped. 295Text larger than `x-max-tooltip-size' is clipped.
298 296
299If the alist in `tooltip-frame-parameters' includes `left' and `top' 297If the alist in `tooltip-frame-parameters' includes `left' and `top'
300parameters, they determine the x and y position where the tooltip 298parameters, they determine the x and y position where the tooltip
301is displayed. Otherwise, the tooltip pops at offsets specified by 299is displayed. Otherwise, the tooltip pops at offsets specified by
302`tooltip-x-offset' and `tooltip-y-offset' from the current mouse 300`tooltip-x-offset' and `tooltip-y-offset' from the current mouse
303position." 301position.
304 (if tooltip-use-echo-area 302
303GUD-TIP is t if the tooltip is from a GUD session and nil otherwise."
304 (if (and gud-tip tooltip-gud-echo-area)
305 (message "%s" text) 305 (message "%s" text)
306 (condition-case error 306 (condition-case error
307 (let ((params (copy-sequence tooltip-frame-parameters)) 307 (let ((params (copy-sequence tooltip-frame-parameters))
@@ -417,7 +417,7 @@ This event can be examined by forms in TOOLTIP-GUD-DISPLAY.")
417(defun tooltip-gud-process-output (process output) 417(defun tooltip-gud-process-output (process output)
418 "Process debugger output and show it in a tooltip window." 418 "Process debugger output and show it in a tooltip window."
419 (set-process-filter process tooltip-gud-original-filter) 419 (set-process-filter process tooltip-gud-original-filter)
420 (tooltip-show (tooltip-strip-prompt process output))) 420 (tooltip-show (tooltip-strip-prompt process output) t))
421 421
422(defun tooltip-gud-print-command (expr) 422(defun tooltip-gud-print-command (expr)
423 "Return a suitable command to print the expression EXPR. 423 "Return a suitable command to print the expression EXPR.
@@ -463,8 +463,8 @@ This function must return nil if it doesn't handle EVENT."
463 (tooltip-show 463 (tooltip-show
464 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) 464 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
465 (let ((string (buffer-string))) 465 (let ((string (buffer-string)))
466 ;; remove newline for tooltip-use-echo-area 466 ;; remove newline for tooltip-gud-echo-area
467 (substring string 0 (- (length string) 1)))))) 467 (substring string 0 (- (length string) 1)))) t))
468 468
469 469
470;;; Tooltip help. 470;;; Tooltip help.
@@ -497,7 +497,7 @@ This is installed on the hook `tooltip-hook', which is run when
497the timer with ID `tooltip-timeout-id' fires. 497the timer with ID `tooltip-timeout-id' fires.
498Value is non-nil if this function handled the tip." 498Value is non-nil if this function handled the tip."
499 (when (stringp tooltip-help-message) 499 (when (stringp tooltip-help-message)
500 (tooltip-show tooltip-help-message) 500 (tooltip-show tooltip-help-message nil)
501 t)) 501 t))
502 502
503(provide 'tooltip) 503(provide 'tooltip)