Mercurial > emacs
diff lisp/tooltip.el @ 90068:eac554634bfa
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-79
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-735
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-747
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 25 Dec 2004 02:00:25 +0000 |
parents | f2ebccfa87d4 3d934eda2724 |
children | bf0d492ea2d5 |
line wrap: on
line diff
--- a/lisp/tooltip.el Tue Dec 14 09:27:49 2004 +0000 +++ b/lisp/tooltip.el Sat Dec 25 02:00:25 2004 +0000 @@ -1,6 +1,7 @@ ;;; tooltip.el --- show tooltip windows -;; Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004 +;; Free Software Foundation, Inc. ;; Author: Gerd Moellmann <gerd@acm.org> ;; Keywords: help c mouse tools @@ -476,7 +477,25 @@ (defun tooltip-show-help-function (msg) "Function installed as `show-help-function'. MSG is either a help string to display, or nil to cancel the display." - (let ((previous-help tooltip-help-message)) + (let ((previous-help tooltip-help-message) + mp pos) + (if (and mouse-1-click-follows-link + (stringp msg) + (save-match-data + (string-match "^mouse-2" msg)) + (setq mp (mouse-pixel-position)) + (consp (setq pos (cdr mp))) + (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp))) + (windowp (posn-window pos))) + (with-current-buffer (window-buffer (posn-window pos)) + (if (mouse-on-link-p (posn-point pos)) + (setq msg (concat + (cond + ((eq mouse-1-click-follows-link 'double) "double-") + ((and (integerp mouse-1-click-follows-link) + (< mouse-1-click-follows-link 0)) "Long ") + (t "")) + "mouse-1" (substring msg 7)))))) (setq tooltip-help-message msg) (cond ((null msg) ;; Cancel display. This also cancels a delayed tip, if