changeset 61608:6a8ebeaf5f56

(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.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 18 Apr 2005 00:29:45 +0000
parents 22de918e7a8c
children 143ba4d2beac
files lisp/tooltip.el
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/tooltip.el	Mon Apr 18 00:29:13 2005 +0000
+++ b/lisp/tooltip.el	Mon Apr 18 00:29:45 2005 +0000
@@ -139,10 +139,8 @@
   :tag "GUD buffers predicate"
   :group 'tooltip)
 
-(defcustom tooltip-use-echo-area nil
-  "Use the echo area instead of tooltip frames.
-This is only relevant GUD display, since otherwise it is equivalent to
-turning off Tooltip mode."
+(defcustom tooltip-gud-echo-area nil
+  "Use the echo area instead of frames for GUD tooltips."
   :type 'boolean
   :tag "Use echo area"
   :group 'tooltip)
@@ -291,17 +289,19 @@
       (push (cons key value) alist))
     alist))
 
-(defun tooltip-show (text)
+(defun tooltip-show (text gud-tip)
   "Show a tooltip window displaying TEXT.
 
-Text larger than `x-max-tooltip-size' (which see) is clipped.
+Text larger than `x-max-tooltip-size' is clipped.
 
 If the alist in `tooltip-frame-parameters' includes `left' and `top'
 parameters, they determine the x and y position where the tooltip
 is displayed.  Otherwise, the tooltip pops at offsets specified by
 `tooltip-x-offset' and `tooltip-y-offset' from the current mouse
-position."
-  (if tooltip-use-echo-area
+position.
+
+GUD-TIP is t if the tooltip is from a GUD session and nil otherwise."
+  (if (and gud-tip tooltip-gud-echo-area)
       (message "%s" text)
     (condition-case error
 	(let ((params (copy-sequence tooltip-frame-parameters))
@@ -417,7 +417,7 @@
 (defun tooltip-gud-process-output (process output)
   "Process debugger output and show it in a tooltip window."
   (set-process-filter process tooltip-gud-original-filter)
-  (tooltip-show (tooltip-strip-prompt process output)))
+  (tooltip-show (tooltip-strip-prompt process output) t))
 
 (defun tooltip-gud-print-command (expr)
   "Return a suitable command to print the expression EXPR.
@@ -463,8 +463,8 @@
   (tooltip-show
    (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
      (let ((string (buffer-string)))
-       ;; remove newline for tooltip-use-echo-area
-       (substring string 0 (- (length string) 1))))))
+       ;; remove newline for tooltip-gud-echo-area
+       (substring string 0 (- (length string) 1)))) t))
 
 
 ;;; Tooltip help.
@@ -497,7 +497,7 @@
 the timer with ID `tooltip-timeout-id' fires.
 Value is non-nil if this function handled the tip."
   (when (stringp tooltip-help-message)
-    (tooltip-show tooltip-help-message)
+    (tooltip-show tooltip-help-message nil)
     t))
 
 (provide 'tooltip)