emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in tooltip handling


From: Tassilo Horn
Subject: Re: Bug in tooltip handling
Date: Tue, 04 Jul 2006 10:49:54 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Nick Roberts <address@hidden> writes:

Hi Nick,

> I don't know what dictionary-el or your mode do but, if possible, its
> best to add tooltips through the `help-echo' text property.

My mode [1] opens a tooltip with translations of the word you're
pointing at. The translation is done by an external Ruby script. Of
course the translation process should only run if the user points at the
word for a given amount of time (e.g. `tooltip-delay').

The problem with `help-echo' is that I would have to propertize every
word in the buffer before tooltips would be available, thus I would have
to call that external script on every word. This would take a lot of
time and memory consumtion would increase dramatically, because every
word would hold a set of possible translations in its `help-echo'
property.

Most of this work would be superfluous anyway, because normally the user
knows most words and only needs translations of a handfull new words.

Another thing with `help-echo' is that I would need to propertize newly
typed words on the fly. (Ok, this should be possible somehow, flyspell
does this, too.)

> If dictionary-el is generally useful and it needs GUD-type tooltips
> then the best way to do this might be to make it part of Emacs.

dictionary-el is quite similar, but instead querying an external Ruby
script it queries a dict server, so it's more general than simple
word-translation, but IMHO most dict dictionaries are quite outdated (at
least the translation dicts), which was the reason to write my own
tool. To make it short: I would not include it, but the author may think
different.

Currently I'm fine with

  (require 'gud)
  (gud-tooltip-mode 1)
  [...]

The only drawback of this is that I load too much (the whole GUD stuff
instead of only the tooltip functionality), thus consuming a little more
memory than necessary. Another drawback is that on every mouse event
`gud-tooltip-tips' is executed (returning nil). If this is all, that's
no big problem for me.

Anyway, I think those event-based tooltips are useful for a lot of tasks
where calculation of the tooltip contents is time-intensive and should
not be performed beforehand. So splitting it out into an own library
`event-tooltip' or so would be a good idea.

Bye,
Tassilo

Footnotes: 
[1] http://www.uni-koblenz.de/%7Eheimdall/apps.php
-- 
A child of five could understand this! Fetch me a child of five!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]