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, 07 Apr 2024 21:40:34 +0300 Message-ID: <86le5pyq1p.fsf@gnu.org> References: <83sf3xgimq.fsf@gnu.org> <83plyzfoe4.fsf@gnu.org> <83plyxca0t.fsf@gnu.org> <8334vrczig.fsf@gnu.org> <86frwejkxe.fsf@gnu.org> <86il12bxwj.fsf@gnu.org> <86y19pz6j9.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9378"; 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 Apr 07 20:40:56 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 1rtXRo-0002Cg-8q for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Apr 2024 20:40:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtXRY-0007u2-7n; Sun, 07 Apr 2024 14:40:40 -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 1rtXRX-0007tp-8I for emacs-devel@gnu.org; Sun, 07 Apr 2024 14:40:39 -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 1rtXRW-0002nb-V1; Sun, 07 Apr 2024 14:40:39 -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=BSZsl+lBz+O2pV0YAbtZkuoVVzzB1B/EZ+kzag+d/s8=; b=BrsM57+jRKpb fHiypNhIMAhGS3aN62BOERILd/OqVhVjYFdfZZS1/MWB/2fkDvgnwoUXVtczDJC7R9++Z/3/96ICY +ReoPlwXOCTd5O0UoKgC066zMwXIjnsWt/0NhJYAidVAFOafuUDXqumvy0JM0TPozqA7Dn8YSgh3L kYRVOTdMfWfv0/Ksgei90g1Wk1HL/4FNB8e0ZU9JjxgHF3McPzqItl/B4Ph6/H2xAt/07LcCfFvvu pIfbvNFFkWAwJ+slQu12a5b/k7siPu68fLNxeKjqOefSppyLF6QHSnAy7diDy+u8ToS8ZSYM5ZGQD nzWE1OpT/hd+ODLrh28pcQ==; In-Reply-To: (message from Vladimir Kazanov on Sun, 7 Apr 2024 18:07:31 +0100) 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:317593 Archived-At: > From: Vladimir Kazanov > Date: Sun, 7 Apr 2024 18:07:31 +0100 > Cc: emacs-devel@gnu.org > > 1. Use the iterator it used in the display_line function to extract > tooltips from fringe-related display specs (patch v1). This needs > caching Lisp_Objects in glyph_row structures for future retrieval. > This is good because it looks in all specs everywhere, doesn't matter > if the text is visible or not. Bad because it needs storing additional > non-text values in glyph_row. > 2. Iterating over buffer text positions of the row (patch v2). Hard to > take into account all variants of text coming from buffers and > strings. This implementation only finds fringe-help in visible text of > the buffer. > 3. Iterating of glyphs of the row (patch v3). All visible text, both > from the buffer and strings, is visited by the implementation. > > I'd say that option 1 is best for user code as specs are retrieved uniformly. But it has a disadvantage of storing Lisp objects in the glyph row structure (which means basically to store them in the glyph matrices). I'd like to avoid that. > Option 3 is the cleanest implementation-wise but we'd have to document > limitations and the suggested solution. > > So if you're fine with this approach, I'll clean up the documentation > and provide a final patch based on option 3. Yes, please.