From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Side effects in `tooltip-show' Date: Mon, 17 Jan 2022 14:41:49 +0200 Message-ID: <83pmoqwn3m.fsf@gnu.org> References: <87czkr87yv.fsf.ref@yahoo.com> <87czkr87yv.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38885"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 17 14:42:37 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9SHM-0009vY-MK for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jan 2022 14:42:36 +0100 Original-Received: from localhost ([::1]:57374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9SHL-0000Mf-5S for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jan 2022 08:42:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9RKj-0005Uz-7B for emacs-devel@gnu.org; Mon, 17 Jan 2022 07:42:01 -0500 Original-Received: from [2001:470:142:3::e] (port=36270 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9RKg-0001yi-RF; Mon, 17 Jan 2022 07:41:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mzi5WWggKnG3fxy8WF83L1C4NJ13BvvYGPvNLSXRssc=; b=SoVYmKNt3tOW CrInPdZVOrOklnpv6E2/muxXbYLuPM1BcyjpTOdOwFS+qy0hRHUa6VW10s9jtWpphlJg7/BY4VOkS gPV+6UZ9t/nHIJFpgVNW1Ydz6AmSzrEoIG7iUy4oPRvBWPPmd+j9l7TFkN7Q5lMHFysDrGbObvaJd jQSlKNk0iQJPY3J23PCJBEpeMH2BO6/VRTlViSupYo9npy5qltbwisAzSToZ2lQdKB67wTk1B62Xx GzF1mEfX3RFngzCtpgzs79+4EgAuJ1cg0mdmUy6agIxhGZ7eqW+VLaWPuiJXXyTloYBoACIdvSeG8 HIosm32TbsKQsuBVVKtgew==; Original-Received: from [87.69.77.57] (port=1984 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9RKg-0006zf-Tg; Mon, 17 Jan 2022 07:41:59 -0500 In-Reply-To: <87czkr87yv.fsf@yahoo.com> (message from Po Lu on Mon, 17 Jan 2022 09:30:16 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284874 Archived-At: > From: Po Lu > Date: Mon, 17 Jan 2022 09:30:16 +0800 > > I'd like to install a fix for a regression in the release branch: since > `equal-including-properties' is used in Emac 28 to compare tooltip > strings with their previous values, this branch in tooltip-show-help is > never reached: > > ((equal-including-properties previous-help msg) > ;; Same help as before (but possibly the mouse has moved). > ;; Keep what we have. > ) > > Because tooltip-show mutates the text properties of any string passed to > it. This causes a lot of flicker when the mouse is moved around. > > The fix is to copy the string passed to `tooltip-show' before modifying > its text properties, like this: I'm not happy about consing a new string each time we have a help-echo event. That'd definitely increase the GC pressure, which is undesirable. 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?