Commit 1d6197fb authored by Nick Roberts's avatar Nick Roberts
Browse files

(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.
parent 01c515bb
...@@ -139,10 +139,8 @@ only tooltips in the buffer containing the overlay arrow." ...@@ -139,10 +139,8 @@ only tooltips in the buffer containing the overlay arrow."
:tag "GUD buffers predicate" :tag "GUD buffers predicate"
:group 'tooltip) :group 'tooltip)
(defcustom tooltip-use-echo-area nil (defcustom tooltip-gud-echo-area nil
"Use the echo area instead of tooltip frames. "Use the echo area instead of frames for GUD tooltips."
This is only relevant GUD display, since otherwise it is equivalent to
turning off Tooltip mode."
:type 'boolean :type 'boolean
:tag "Use echo area" :tag "Use echo area"
:group 'tooltip) :group 'tooltip)
...@@ -291,17 +289,19 @@ change the existing association. Value is the resulting alist." ...@@ -291,17 +289,19 @@ change the existing association. Value is the resulting alist."
(push (cons key value) alist)) (push (cons key value) alist))
alist)) alist))
(defun tooltip-show (text) (defun tooltip-show (text gud-tip)
"Show a tooltip window displaying TEXT. "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' If the alist in `tooltip-frame-parameters' includes `left' and `top'
parameters, they determine the x and y position where the tooltip parameters, they determine the x and y position where the tooltip
is displayed. Otherwise, the tooltip pops at offsets specified by is displayed. Otherwise, the tooltip pops at offsets specified by
`tooltip-x-offset' and `tooltip-y-offset' from the current mouse `tooltip-x-offset' and `tooltip-y-offset' from the current mouse
position." position.
(if tooltip-use-echo-area
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) (message "%s" text)
(condition-case error (condition-case error
(let ((params (copy-sequence tooltip-frame-parameters)) (let ((params (copy-sequence tooltip-frame-parameters))
...@@ -417,7 +417,7 @@ This event can be examined by forms in TOOLTIP-GUD-DISPLAY.") ...@@ -417,7 +417,7 @@ This event can be examined by forms in TOOLTIP-GUD-DISPLAY.")
(defun tooltip-gud-process-output (process output) (defun tooltip-gud-process-output (process output)
"Process debugger output and show it in a tooltip window." "Process debugger output and show it in a tooltip window."
(set-process-filter process tooltip-gud-original-filter) (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) (defun tooltip-gud-print-command (expr)
"Return a suitable command to print the expression EXPR. "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,8 +463,8 @@ This function must return nil if it doesn't handle EVENT."
(tooltip-show (tooltip-show
(with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
(let ((string (buffer-string))) (let ((string (buffer-string)))
;; remove newline for tooltip-use-echo-area ;; remove newline for tooltip-gud-echo-area
(substring string 0 (- (length string) 1)))))) (substring string 0 (- (length string) 1)))) t))
;;; Tooltip help. ;;; Tooltip help.
...@@ -497,7 +497,7 @@ This is installed on the hook `tooltip-hook', which is run when ...@@ -497,7 +497,7 @@ This is installed on the hook `tooltip-hook', which is run when
the timer with ID `tooltip-timeout-id' fires. the timer with ID `tooltip-timeout-id' fires.
Value is non-nil if this function handled the tip." Value is non-nil if this function handled the tip."
(when (stringp tooltip-help-message) (when (stringp tooltip-help-message)
(tooltip-show tooltip-help-message) (tooltip-show tooltip-help-message nil)
t)) t))
(provide 'tooltip) (provide 'tooltip)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment