comparison lisp/tooltip.el @ 61161:22abf0130979

(tooltip-show-help-function): Don't fixup message here.
author Kim F. Storm <storm@cua.dk>
date Thu, 31 Mar 2005 10:10:39 +0000
parents dd51ca9ed348
children 19480ce3528d 7a3341d65a12
comparison
equal deleted inserted replaced
61160:2bc2e06d78aa 61161:22abf0130979
467 "The last help message received via `tooltip-show-help-function'.") 467 "The last help message received via `tooltip-show-help-function'.")
468 468
469 (defun tooltip-show-help-function (msg) 469 (defun tooltip-show-help-function (msg)
470 "Function installed as `show-help-function'. 470 "Function installed as `show-help-function'.
471 MSG is either a help string to display, or nil to cancel the display." 471 MSG is either a help string to display, or nil to cancel the display."
472 (let ((previous-help tooltip-help-message) 472 (let ((previous-help tooltip-help-message))
473 mp pos)
474 (if (and mouse-1-click-follows-link
475 (stringp msg)
476 (save-match-data
477 (string-match "^mouse-2" msg))
478 (setq mp (mouse-pixel-position))
479 (consp (setq pos (cdr mp)))
480 (car pos) (>= (car pos) 0)
481 (cdr pos) (>= (cdr pos) 0)
482 (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp)))
483 (windowp (posn-window pos)))
484 (with-current-buffer (window-buffer (posn-window pos))
485 (if (mouse-on-link-p pos)
486 (setq msg (concat
487 (cond
488 ((eq mouse-1-click-follows-link 'double) "double-")
489 ((and (integerp mouse-1-click-follows-link)
490 (< mouse-1-click-follows-link 0)) "Long ")
491 (t ""))
492 "mouse-1" (substring msg 7))))))
493 (setq tooltip-help-message msg) 473 (setq tooltip-help-message msg)
494 (cond ((null msg) 474 (cond ((null msg)
495 ;; Cancel display. This also cancels a delayed tip, if 475 ;; Cancel display. This also cancels a delayed tip, if
496 ;; there is one. 476 ;; there is one.
497 (tooltip-hide)) 477 (tooltip-hide))