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: Wed, 27 Mar 2024 14:14:27 +0200 Message-ID: <86le63j2ho.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="25050"; 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 Wed Mar 27 13:15:26 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 1rpSBi-0006Ga-I7 for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Mar 2024 13:15:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpSAr-0001wy-VG; Wed, 27 Mar 2024 08:14:33 -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 1rpSAp-0001wj-Q7 for emacs-devel@gnu.org; Wed, 27 Mar 2024 08:14:31 -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 1rpSAp-00032R-Dj; Wed, 27 Mar 2024 08:14:31 -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=CbNwvlCA/vvDWGjK5IdSW1r7OJTgiQGKFnSezzAEgxc=; b=WgIC0DgRk5nA 7iuUkyQ/6jwh8372hiPR9TwUpkwcUIqwgyWp5osIidSiUiw2NhKLQJIicxfsWK3aQ/Ygfts8Q+LuB DLGUOkMc+DjSSK6yJY/3UEV1j0KRRBXCLiKlB7jYH1owb+JG6+R6Dk1c6Zt/QVVAUbLQhqqchFLEd kddn2fxW77tMPxWBLL8EleYvk6Xsu+LKx0RC/gFKMp7JUmMDv/UNQgyn/lwjtsqStHqEmU8E47MMJ nAtiPAVuCXI61/gAjAHxroGjw4IvIMmUPDDl34OAj7OkhY9E0SFy49+M+10sbSqKSv/d/XJ+GoDdi w/GgJszBp0zOcjSEqHBPXA==; In-Reply-To: (message from Vladimir Kazanov on Tue, 26 Mar 2024 22:16:02 +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:317334 Archived-At: > From: Vladimir Kazanov > Date: Tue, 26 Mar 2024 22:16:02 +0000 > Cc: emacs-devel@gnu.org > > > However, I think there's an easy way of making the implementation > > easier: just introduce a new overlay property called, say, > > fringe-help-echo, and put that property on the same text as the > > display property which produces the fringe. Then the code in > > note_fringe_highlight should simply check if the text which yielded > > the fringe bitmap also has this special property on it, and if so, > > display the tooltip. > > Maybe an even easier solution would work: > > 1. Record buffer position of the fringe display spec in struct it. > Then move it to glyph_row the same way user_fringe_bitmap_id's are > copied over. When you say "move it", what is "it" in this case? > 2. In note_fringe_highlight it becomes easy to retrieve the fringe > display spec using a single call to get_char_property_and_overlay(), > no need to iterate over a line, or have the implementation detail leak > into text properties. Why do you need to retrieve the display spec in note_fringe_highlight? > What I don't really understand is whether I should handle overlays > with after-string/before-string properties. Ideally, yes. Is there some complication there that would make those overlays special? > Should I just go through all overlays touching the spec position and > parse into the after-string/before-string as well? Not sure I understand the question, but maybe if you answer the ones above, I will understand, or this question will answer itself. > Pardon the many questions, display code has many moving parts. No need to apologize. Thanks for working on this.