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: [PATCH] User-defined fringe tooltips (a request for review) Date: Sun, 31 Mar 2024 11:36:44 +0300 Message-ID: <86il12bxwj.fsf@gnu.org> References: <83sf3xgimq.fsf@gnu.org> <83plyzfoe4.fsf@gnu.org> <83plyxca0t.fsf@gnu.org> <8334vrczig.fsf@gnu.org> <86frwejkxe.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="872"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Vladimir Kazanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 31 10:37:15 2024 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 1rqqgl-000Aau-66 for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Mar 2024 10:37:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqqgL-0001Ti-BY; Sun, 31 Mar 2024 04:36:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqqgJ-0001TZ-BM for emacs-devel@gnu.org; Sun, 31 Mar 2024 04:36:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqqgJ-0005qK-2j; Sun, 31 Mar 2024 04:36:47 -0400 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=NVv7eeNo+bMk23mkYDr14tAWWKkZ90HeFrhsK3Ug41k=; b=BIo+CcIGBEbV /I3au5oJ/dwA9w+iLRXFkN3XUsMhYOS11hB08oqKM9ruQOo47/SWqrGXVoQFt+VoDSpri5yy0mesW 7fvr452xFsJU/Ltp4Y7hnCsD0IIx9NffXd+3eIw9dOFex4jQUakd5rRJBkfE3yrfTaflEx+DymXaL TeaS/FMCqAWVmWd0nTPJjbhcruGuAZf08n53btpLIKFjh9Z4zvTj/NAlVZnWC9hwENKkSHHuRdI5D Y1Fpmyu5ezCAty/UDwN4w10fjhVClOnPJQuTj9BW4IcbEP4TIVcQE6iCI4n1vOQUu4WN2lSlWAK0s NPfU8EGDrSG0HkpRo5t82w==; In-Reply-To: (message from Vladimir Kazanov on Wed, 27 Mar 2024 10:59:50 +0000) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317410 Archived-At: > From: Vladimir Kazanov > Date: Wed, 27 Mar 2024 10:59:50 +0000 > Cc: emacs-devel@gnu.org > > Attached is a v2 patch (for discussion, not yet finished) that > demonstrates the approach. Examples of what works and what doesn't: > > ;; single spec, list of specs, vector of specs all work now > (insert (propertize "foo" 'display '(right-fringe left-arrow warning > "right tooltip")))foo > (insert (propertize "foo" 'display '((left-fringe right-arrow > warning "left tooltip"))))foo > (insert (propertize "foo" 'display '[(right-fringe left-arrow > warning "right tooltip")])) Like I said earlier: I think it would be better to have the tooltip text in a separate property, not as part of the 'display' property spec. Also, I don't see a need for recording the positions in the glyph_row structure, because finding the glyph that corresponds to buffer/string text with that special property is easy enough.