(tooltip-gud-tips-setup): New function.
(tooltip-gud-tips-p): Add :set to call tooltip-gud-tips-setup. (tooltip-mode): Call tooltip-gud-tips-setup. (tooltip-gud-tips): Use `gud-basic-call' instead of process-send-string, so the prompt gets frobbed appropriately. Handle nil return value from `tooltip-gud-print-command'.
This commit is contained in:
parent
0e40b80948
commit
c39e89832a
1 changed files with 25 additions and 20 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;; tooltip.el --- Show tooltip windows
|
;;; tooltip.el --- Show tooltip windows
|
||||||
|
|
||||||
;; Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
;; Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
;; Author: Gerd Moellmann <gerd@acm.org>
|
;; Author: Gerd Moellmann <gerd@acm.org>
|
||||||
;; Keywords: help c mouse tools
|
;; Keywords: help c mouse tools
|
||||||
|
@ -93,6 +93,9 @@ Do so after `tooltip-short-delay'."
|
||||||
"*Non-nil means show tooltips in GUD sessions."
|
"*Non-nil means show tooltips in GUD sessions."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:tag "GUD"
|
:tag "GUD"
|
||||||
|
:set #'(lambda (symbol on)
|
||||||
|
(setq tooltip-gud-tips-p on)
|
||||||
|
(if on (tooltip-gud-tips-setup)))
|
||||||
:group 'tooltip)
|
:group 'tooltip)
|
||||||
|
|
||||||
|
|
||||||
|
@ -184,7 +187,11 @@ With ARG, turn tooltip mode on if and only if ARG is positive."
|
||||||
;; `ignore' is the default binding for mouse movements.
|
;; `ignore' is the default binding for mouse movements.
|
||||||
(define-key global-map [mouse-movement]
|
(define-key global-map [mouse-movement]
|
||||||
(if on 'tooltip-mouse-motion 'ignore))
|
(if on 'tooltip-mouse-motion 'ignore))
|
||||||
(when (and on tooltip-gud-tips-p)
|
(tooltip-gud-tips-setup)))
|
||||||
|
|
||||||
|
(defun tooltip-gud-tips-setup ()
|
||||||
|
"Setup debugger mode-hooks for tooltips."
|
||||||
|
(when (and tooltip-mode tooltip-gud-tips-p)
|
||||||
(global-set-key [S-mouse-3] 'tooltip-gud-toggle-dereference)
|
(global-set-key [S-mouse-3] 'tooltip-gud-toggle-dereference)
|
||||||
(add-hook 'gdb-mode-hook
|
(add-hook 'gdb-mode-hook
|
||||||
#'(lambda () (setq tooltip-gud-debugger 'gdb)))
|
#'(lambda () (setq tooltip-gud-debugger 'gdb)))
|
||||||
|
@ -195,9 +202,7 @@ With ARG, turn tooltip mode on if and only if ARG is positive."
|
||||||
(add-hook 'xdb-mode-hook
|
(add-hook 'xdb-mode-hook
|
||||||
#'(lambda () (setq tooltip-gud-debugger 'xdb)))
|
#'(lambda () (setq tooltip-gud-debugger 'xdb)))
|
||||||
(add-hook 'perldb-mode-hook
|
(add-hook 'perldb-mode-hook
|
||||||
#'(lambda () (setq tooltip-gud-debugger 'perldb))))))
|
#'(lambda () (setq tooltip-gud-debugger 'perldb)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Timeout for tooltip display
|
;;; Timeout for tooltip display
|
||||||
|
|
||||||
|
@ -416,12 +421,12 @@ This function must return nil if it doesn't handle EVENT."
|
||||||
(eval (cons 'and tooltip-gud-display))))
|
(eval (cons 'and tooltip-gud-display))))
|
||||||
(let ((expr (tooltip-expr-to-print event)))
|
(let ((expr (tooltip-expr-to-print event)))
|
||||||
(when expr
|
(when expr
|
||||||
|
(let ((cmd (tooltip-gud-print-command expr)))
|
||||||
|
(unless (null cmd) ; CMD can be nil if unknown debugger
|
||||||
(setq tooltip-gud-original-filter (process-filter process))
|
(setq tooltip-gud-original-filter (process-filter process))
|
||||||
(set-process-filter process 'tooltip-gud-process-output)
|
(set-process-filter process 'tooltip-gud-process-output)
|
||||||
(process-send-string
|
(gud-basic-call cmd)
|
||||||
process (concat (tooltip-gud-print-command expr) "\n"))
|
expr)))))))
|
||||||
expr)))))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Tooltip help.
|
;;; Tooltip help.
|
||||||
|
|
Loading…
Add table
Reference in a new issue