From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Klaus Berndl Newsgroups: gmane.emacs.help Subject: Question for help-echo property Date: 07 Dec 2002 10:43:24 +0100 Organization: sd&m AG, Muenchen, Germany Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1039285911 23695 80.91.224.249 (7 Dec 2002 18:31:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 7 Dec 2002 18:31:51 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Kjjx-0006A1-00 for ; Sat, 07 Dec 2002 19:31:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18KjBV-0006az-00 for gnu-help-gnu-emacs@m.gmane.org; Sat, 07 Dec 2002 12:56:13 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!news.sdm.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 99 Original-NNTP-Posting-Host: callin40.muc.sdm.de Original-X-Trace: solti3.muc.sdm.de 1039254203 22248 195.125.139.40 (7 Dec 2002 09:43:23 GMT) Original-X-Complaints-To: usenet@news.sdm.de Original-NNTP-Posting-Date: 7 Dec 2002 09:43:23 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:107831 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:4388 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4388 I have a problem with a function as value for the help-echo property (I'm not sure if this is a bug or if i have not understood the help-echo stuff right?!) Please do the following test (I'm using NTEmacs 21.2. with Windows XP): 1. Start a vanilla Emacs with "emacs -q -no-site-file" 2. Evaluate the following small code in the *scratch* buffer: (defun klaus-insert-line (text) (let ((p (point))) (insert text) (put-text-property p (+ p (length text)) 'mouse-face 'highlight) (put-text-property p (+ p (length text)) 'help-echo 'klaus-help-echo-fn) (insert "\n"))) (defun klaus-help-echo-fn (win obj pos) (message "Position: %d" pos)) (defun klaus-test () (interactive) (klaus-insert-line "This is a test line") (klaus-insert-line "here is another one") (klaus-insert-line "Line Line Line") (klaus-insert-line "I think this is enough") (klaus-insert-line "last line")) 3. Call M-x klaus-test RET at the end of the scratch buffer. Then you will have the following text inserted: This is a test line here is another one Line Line Line I think this is enough last line Now please begin to move the mouse over the newly inserted text, e.g. over the 'T' in the first line "This is a test line". OK, then in the minibuffer "Position: 765" is displayed (or whatever position the 'T' has). Fine! But now continue moving the mouse down slowly over the first chars in every line, ie. you move from the 'T' to the 'h', stop, then over the 'L', stop, the 'I', stop and at least over the 'l' of the last line. If i understand the help-echo stuff right, after every move the displayed position should be change, because after every move another position is under the mouse pointer. But what happens is: If you begin moving over the 'T' then a the position of the 'T' is displayed, but this position is never changes after the following moves, ie. the function 'klaus-help-echo-fn' is only called once! Even more: After every move from a buffer-position which has *NO* help-echo property to a position which *HAS* a help-property all is working fine (ie. the correct position of the character under the mouse is displayed) but after a move from a position which *has* *already* a help-echo property to a new position which has a help-property too nothing happens, means the help-echo-property function is *NOT* called. ==> Seems the help-echo function 'klaus-help-echo-fn' is only called if moving the mouse from a "no-help-echo"-property to a position with a help-echo-property but not if moving from one help-echo-property-position to another one? is this a bug or a feature? ;-) Another aspect: If i use a string instead a function for the help-property all is working fine: Please change the function 'klaus-insert-line' as follows: (defun klaus-insert-line (text) (let ((p (point))) (insert text) (put-text-property p (+ p (length text)) 'mouse-face 'highlight) (put-text-property p (+ p (length text)) 'help-echo text) (insert "\n"))) Now the help-echo property has the text of the line as value instead of a function. Now performing the same test as described above all is working fine, i.e. regardless from where i move always the right text is displayed in the minibuffer! Sorry for this long text but i do not know how to describe my problem in a shorter way... Any thoughts of the Gurus? BTW: If i remember right, the stuff with a function as value for the help-property has already worked well, and i suppose this was with Emacs 21.1. Now I'm using 21.2.! Is is possible that concerning help-echo something has changed?? But unfortuntelly i can not say at 100% if my suspicion is right! Many thanks in advance! Klaus -- Klaus Berndl mailto: klaus.berndl@sdm.de sd&m AG http://www.sdm.de software design & management Thomas-Dehler-Str. 27, 81737 München, Germany Tel +49 89 63812-392, Fax -220