From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Can't use tooltip of dictionary package in Emacs 23 Date: Mon, 19 Jun 2006 16:54:18 +0200 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <87odwp19id.fsf@baldur.nicundtas.de> References: <87k67e64zk.fsf@baldur.nicundtas.de> <1150689024.024155.181210@r2g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150731642 23687 80.91.229.2 (19 Jun 2006 15:40:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jun 2006 15:40:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 19 17:40:41 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FsLrW-0004Qg-Be for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jun 2006 17:40:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsLrV-0000Kc-Rh for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jun 2006 11:40:25 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news-stu1.dfn.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Original-NNTP-Posting-Host: dslb-084-063-054-150.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1150728859 20585 84.63.54.150 (19 Jun 2006 14:54:19 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original-NNTP-Posting-Date: Mon, 19 Jun 2006 14:54:19 +0000 (UTC) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVVVlBlsOJqkqifzOif vtFXdYWo4XLsAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABp0lE QVQ4y8WTzZabMAyFNRT2Fdh7TMIDOPbsY1D2QKP3f5VKJvzkdGbRbqoFB/TdK2EhAL8J+D/Af+vw X4PmVMq/6ZvdUTfvlqOUCfFkCGYDabx1hynEuIGmhefWJoTwWW3gJ1wo5J5eQINTcXMC6hrKMQTv pXwTFDzgmh0tXC5CxNF4ESBeoUgCCIqQSKRRqBrQ3IEQ6juUaIwkBY7ZgXd4ikOB2MaBiMYQSV7B SgoyRgs5KmqfAbHLYJKCeL2vpIQfHjsDhQB5SkgKynwhpBqqBGaC0uFw15TiVVUMUE9QxaQpaU4g KSTRDtpctZCPH0G5ZD7kHJ/wihfQmASgOYGw3etIpMkfIM8Kry+ik5KDaFCerqNB5LQCuun5V4Au EcWQZ6sxjsnte0VbNsSE7rxw+u38itadg30J0Mt2GJ/JGay6Rog3JyANU867bNxBGjTtOnRLwnOp puv5yfPS8/LgX+nY3cdS9FzNC3dtu7TxAH3vWsszc932UzXv4LYwMksdrqee+QC2Xyzz1BfMApl3 wLarZ8t2Vrk9OXLYf/zP579xvDf5DViQeyGEWlLHAAAAJnpUWHRDb21tZW50AAB42nMuSk0sSU1R KM8syVAIyUhVcPf0DQAAUucHI5DLZXAAAAAaelRYdEpQRUctQ29sb3JzcGFjZQAAeNozAgAAMwAz ERZ+YwAAACd6VFh0SlBFRy1TYW1wbGluZy1mYWN0b3JzAAB42jOqMNIxrDAEYQARgwLpZA8bYgAA AABJRU5ErkJggg== User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:mZTAu5ZPObcn4ris4JPS+KzXRYs= Original-Xref: shelby.stanford.edu gnu.emacs.help:139921 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35545 Archived-At: "pluskid" 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 -- A child of five could understand this! Fetch me a child of five!