[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can't use tooltip of dictionary package in Emacs 23
From: |
Leon |
Subject: |
Re: Can't use tooltip of dictionary package in Emacs 23 |
Date: |
Sun, 25 Jun 2006 12:51:26 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux) |
Tassilo Horn <heimdall@uni-koblenz.de> writes:
> "pluskid" <pluskid.zju@gmail.com> writes:
>
> Hi,
>
>> You mentioned you looked on how dictionary.el implemented it. Can
>> you explain how it implement?
>
> Well, this is basically the code dictionary.el uses for tooltips on GNU
> Emacs:
>
> --8<---------------cut here---------------start------------->8---
> (defun dictionary-display-tooltip (event)
> "Search the current word in the `dictionary-tooltip-dictionary'."
> (interactive "e")
> ;; Process event and show tooltip
> )
>
> ;;;###autoload
> (defun dictionary-tooltip-mode (&optional arg)
> "Display tooltips for the current word"
> (interactive "P")
> ;; - snip -
> (add-hook 'tooltip-hook 'dictionary-display-tooltip)
> (make-local-variable 'track-mouse)
> (setq track-mouse on)))
> --8<---------------cut here---------------end--------------->8---
>
> By setting the `track-mouse' variable to a non-nil value, mouse motion
> events should be generated. When it's time to display a tooltip each
> function in `tooltip-hook' is called with an event which can be used to
> extract the word under the mouse pointer, etc.
>
> As a test case you could evaluate the following code in *scratch*.
>
> --8<---------------cut here---------------start------------->8---
> (progn
> (defun foo (event)
> (interactive "e")
> (message "Gotten Event")
> (tooltip-show "Huzzah!"))
> (add-hook 'tooltip-hook 'foo)
> (setq track-mouse t)
> (tooltip-mode 1))
> --8<---------------cut here---------------end--------------->8---
>
> On GNU Emacs 21 this should open tooltips with "Huzzah!" in it, and
> "Gotten Event" should be printed in the echo area. (Can someone test it?
> I don't have emacs 21 accessible right now.)
>
> On GNU Emacs 22 nothing happens -- it's even worse. All tooltips which
> appeared before, for example the modeline help, don't appear anymore
> after setting `track-mouse' to non-nil.
>
> Bye,
> Tassilo
Hope someone have time to take a look. It seems not very
complicated. Besides if the tooltip is enabled it will cause the mouse
to misbehave[1] (in emacs 22).
Footnotes:
[1] http://article.gmane.org/gmane.emacs.pretest.bugs/11443
--
Leon
- Can't use tooltip of dictionary package in Emacs 23, Chiyuan Zhang, 2006/06/18
- Re: Can't use tooltip of dictionary package in Emacs 23, Tassilo Horn, 2006/06/18
- Re: Can't use tooltip of dictionary package in Emacs 23, pluskid, 2006/06/19
- Re: Can't use tooltip of dictionary package in Emacs 23, Tassilo Horn, 2006/06/19
- Re: Can't use tooltip of dictionary package in Emacs 23,
Leon <=
- Message not available
- Re: Can't use tooltip of dictionary package in Emacs 23, pluskid, 2006/06/25
- Re: Can't use tooltip of dictionary package in Emacs 23, Leon, 2006/06/29
- Message not available
- Re: Can't use tooltip of dictionary package in Emacs 23, Tassilo Horn, 2006/06/29
- Re: Can't use tooltip of dictionary package in Emacs 23, Leon, 2006/06/29
- Message not available
- Re: Can't use tooltip of dictionary package in Emacs 23, Tassilo Horn, 2006/06/30
- Re: Can't use tooltip of dictionary package in Emacs 23, Leon, 2006/06/30