From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vladimir Kazanov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] User-defined fringe tooltips (a request for review) Date: Wed, 27 Mar 2024 12:48:04 +0000 Message-ID: References: <83sf3xgimq.fsf@gnu.org> <83plyzfoe4.fsf@gnu.org> <83plyxca0t.fsf@gnu.org> <8334vrczig.fsf@gnu.org> <86frwejkxe.fsf@gnu.org> <86le63j2ho.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18424"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 27 13:49:09 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 1rpSiL-0004ea-0W for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Mar 2024 13:49:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpShZ-00078W-SX; Wed, 27 Mar 2024 08:48:22 -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 1rpShY-00077o-CV for emacs-devel@gnu.org; Wed, 27 Mar 2024 08:48:20 -0400 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpShW-00045k-Qp; Wed, 27 Mar 2024 08:48:20 -0400 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-513dd2d2415so7168910e87.3; Wed, 27 Mar 2024 05:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711543696; x=1712148496; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=I1rSSuKN8T41W5CiSXkcr7ko41ISnYJbZIdY4vcE34A=; b=UeXlXLHF2+mgT/jnn0G7AqfzIzu1Wx5cSk3YnlWTAMdeRviGFV58agrg97KD3maOb6 G6dIGpJRDWB4BEAQEUKC3WMPEpybmuKXHj7o+70Osk/jfwikL9mDvpppBfG88VJsm/PQ 3BU46Lt98OS0mMrcLy9Zsod4Ufs/6mVThuIcFza7DUB64dopVU2QJplRGSEsRHo5GsI+ aSsmecL9O7cpS7FYwYWloqv/iqaWNFQ55iVC05HvbHT7chulLJJGSYcf7NWXYCdQXq3+ YuipwFmR997pU0CWAoSO96OrMaJqsIJRyBV5GnoQ6m1A25ZKwk4MwMAO8o0Q/zsszWXe mmEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711543696; x=1712148496; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=I1rSSuKN8T41W5CiSXkcr7ko41ISnYJbZIdY4vcE34A=; b=JgHMVMFMJcW7u5ZU4iO24IHR1eNJoGbwI/V7pAbCSb4woxPIw6i+kIOS8N5P8uDNZY +otUaVXZ9OEXD6DPWlllx9iOqqDn0Zu1OO64COO1mSmBT/Hbvs5rawu/nJaZC5/Gdjv8 TW5sUUIHJQt1mJJZJWU4T9wI+qlIVaMBhB4HjwEKKOeL01Rr5ycFlXtZjx+uK+McE0bd OjwaHBCY81+ekB6zDuWkOavEPoYHR0imT9fH1TkPLtELtrlQ2wZS57BIDdj+1d5z424U KX8KkCy2YOEHHIs80lL+i0vIgMq9SUHmO414yVVwn0LMux5wdxkFpYIP5AHgGHfCnr5T gHnw== X-Gm-Message-State: AOJu0Yzp32SvC73jsmAW69cluOua8aSaAzfWEx8AieAb3VFtX8TwWtaC r4QEtulquJgPQziTj9dQ/6jxtpbGui+pqQXWtEmWH4Tg1IKF7gLOoW+X8aMI/ZSmJvA8lpqEITA Ut5KqBGejl62v04I22Bd8bx7XtM9ow01PnsXN X-Google-Smtp-Source: AGHT+IE75kQVrwgc51l2ACtFtkCBuNLy75/HyB25qiD/ofoZ6SC/UA2cv3jYlByekjDpM1Q7+AMHb/s0XjpsjwW56Ko= X-Received: by 2002:a05:6512:3128:b0:515:a5b1:1dd0 with SMTP id p8-20020a056512312800b00515a5b11dd0mr1688504lfd.55.1711543695832; Wed, 27 Mar 2024 05:48:15 -0700 (PDT) In-Reply-To: <86le63j2ho.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=vekazanov@gmail.com; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:317337 Archived-At: Hi Eli, > > 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? I record the position of the :help-echo message in the buffer in the iterator (struct it). This is ptrdiff_t left_user_fringe_help_echo_pos. Then I copy this buffer position into (struct glyph_row), next to where left_user_fringe_bitmap sits. > > 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? Once I have the position of the help-echo string (saved in the glyph_row), I still have to retrieve the :help-echo string. That's what the code calling (get_char_property_and_overlay) does in the (note_fringe_highlight). This gives me a list/vector/etc of display specs. Somewhere within the specs there should be a fringe spec as this is what was recorded by the iterator (struct it). And the fringe spec contains the help-echo message I need to show in the tooltip. > > 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? I am not sure I understand everything about overlays but for some reason I can't get Qafter_string/Qbefore_string overlay properties from the position saved in the glyph_row when the overlay is not represented by any visual element in the row. > > 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. Hope it all makes sense now. I'll try to get things working for all variants of fringe definition. -- Regards, Vladimir Kazanov