From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Side effects in `tooltip-show'
Date: Mon, 17 Jan 2022 21:29:53 +0800 [thread overview]
Message-ID: <87czkq7ani.fsf@yahoo.com> (raw)
In-Reply-To: <83iluiwl9f.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 17 Jan 2022 15:21:32 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Po Lu <luangruo@yahoo.com>
>> Cc: emacs-devel@gnu.org
>> Date: Mon, 17 Jan 2022 21:00:46 +0800
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > How about using 'equal' to compare the strings instead? What are the
>> > chances that two help-echo strings of 2 different tooltips will
>> > compare equal without the properties, but not with the properties?
>>
>> That's fine by me as well, but the resulting minor snafu where the
>> tooltip might not be updated if the string contents are identical should
>> be documented somewhere, I think.
>
> In the comments to the code that makes these comparisons, I think.
Thanks. Would you mind if I installed this on the release branch?
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 1cf16fdb5d..1355eecfcd 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -383,9 +383,12 @@ tooltip-show-help
;; Cancel display. This also cancels a delayed tip, if
;; there is one.
(tooltip-hide))
- ((equal-including-properties previous-help msg)
- ;; Same help as before (but possibly the mouse has moved).
- ;; Keep what we have.
+ ((equal previous-help msg)
+ ;; Same help as before (but possibly the mouse has
+ ;; moved or the text properties have changed). Keep
+ ;; what we have. If only text properties have changed,
+ ;; the tooltip won't be updated, but that shouldn't
+ ;; occur often enough to be noticable.
)
(t
;; A different help. Remove a previous tooltip, and
next prev parent reply other threads:[~2022-01-17 13:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87czkr87yv.fsf.ref@yahoo.com>
2022-01-17 1:30 ` Side effects in `tooltip-show' Po Lu
2022-01-17 12:41 ` Eli Zaretskii
2022-01-17 13:00 ` Po Lu
2022-01-17 13:21 ` Eli Zaretskii
2022-01-17 13:29 ` Po Lu [this message]
2022-01-17 13:40 ` Eli Zaretskii
2022-01-17 13:41 ` Po Lu
2022-01-18 7:23 ` Pankaj Jangid
2022-01-18 7:55 ` Po Lu
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czkq7ani.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.