From: Klaus Berndl <Klaus.Berndl@sdm.de>
Subject: Question for help-echo property
Date: 07 Dec 2002 10:43:24 +0100 [thread overview]
Message-ID: <un0niuptv.fsf@sdm.de> (raw)
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
next reply other threads:[~2002-12-07 9:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-07 9:43 Klaus Berndl [this message]
[not found] ` <m2vg25biet.fsf@nyaumo.btinternet.com>
2002-12-09 8:31 ` Question for help-echo property Klaus Berndl
2002-12-10 0:04 ` Jason Rumney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=un0niuptv.fsf@sdm.de \
--to=klaus.berndl@sdm.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).