From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Show show-paren context in a child frame Date: Sat, 05 Feb 2022 20:03:36 +0100 Message-ID: <878rup2kg2.fsf@gnu.org> References: <87fsoxlc2p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23281"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.7; emacs 29.0.50 Cc: emacs-devel@gnu.org To: Daniel =?utf-8?Q?Mart=C3=ADn?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 05 20:17:31 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 1nGQYs-0005ox-PQ for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Feb 2022 20:17:30 +0100 Original-Received: from localhost ([::1]:43794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGQYr-0003b9-78 for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Feb 2022 14:17:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGQXj-0002ti-JN for emacs-devel@gnu.org; Sat, 05 Feb 2022 14:16:19 -0500 Original-Received: from [2001:470:142:3::e] (port=40550 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 1nGQXj-0002iT-9G; Sat, 05 Feb 2022 14:16:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=7DeZ542mHrnT8BbCm9xGuyP4aPpUD2snycCplFlBApE=; b=j2oUKE1z4mfEHd gJEA+4bjOCddAV7m3vlizpLZ1v9fZohUGNigxBK4F2gTTv9Rxxp4f1PpbAnxhjFpKeHaZpfHrnN+D LWGGYqQ0AnJ+UHAd4NSlPer/MlhbDBb3Bre1xGyDGUoiNWxY9aVy/CXELHk3VvLhHAWCBkgrCYYLE xqJ5tdjjcdiyu5HxiU/XiAJeRwxUlt9RTWIExHaxEqYTKqZ8Ce45G9GOuRkf8sFcyfSNXMwt50tmd pa5UrLKGszgxWnmMIzLPQsq/gYoYb69nYxPmg+3yzfM/PZsoMqVUGbjnhL8l8QBIaC902Xap7b9u5 lQk9tbh32RnP5vMNQepw==; Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:48981) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGQXj-0004s0-3a; Sat, 05 Feb 2022 14:16:19 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id A0DB927C0054; Sat, 5 Feb 2022 14:16:17 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 05 Feb 2022 14:16:17 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrhedugdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtgfesthhqredttderjeenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe eiudfghffhjeevvedvhfffgeetleeljefffeeggfeugeegleehfeeiueejhfehgeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Feb 2022 14:16:16 -0500 (EST) In-reply-to: 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:285911 Archived-At: Daniel Mart=C3=ADn writes: Hi Daniel, >> today I've discovered `show-paren-context-when-offscreen' which >> displays the context around the opening paren in the echo area. >> That's a very nice feature, however it competes with eldoc, i.e., >> it'll show the context in the echo area and a fraction of a second >> later, that's repressed by eldoc's text (or the other way round >> depending on the delays one uses). > > I'm glad you like the feature! Yes, unfortunately there are some cases > where this feature competes with Eldoc. I taught > `eldoc-display-message-no-interference-p' about this new option, but > perhaphs the mechanism needs some more refinement. Ah, I see. Shouldn't in the code (and (boundp 'show-paren-context-when-offscreen) show-paren-context-when-offscreen (not (pos-visible-in-window-p (overlay-end show-paren--overlay)))) the `overlay-end' be `overlay-start'? I mean the show-paren context message is shown when the `show-paren--overlay's start is further up than the window is showing, no? >> Therefore, I've experimented with adding a special `child-frame' >> value for `show-paren-context-when-offscreen' which displays the >> context in a child frame. This works pretty well although setting up >> a child frame with corresponding buffer for a kind of tooltip pane >> requires quite some gymnastics in frame parameters and buffer-local >> variables which I've copied from vertico. Comments welcome! > > Thank you! I've given your code a try and I think it can be a useful > option. Some comments: > > - Is there a way to make the header more prominent? I feel it can be > easily confused with the rest of the buffer. Perhaps putting a thin > border around the child frame might be enough. Yeah, just give the `child-frame-border' some :background. > - I've found an error when I clicked on the child frame by mistake and > scrolled (I wanted to scroll the parent frame instead): > > mouse-scroll-subr: Wrong type argument: window-live-p, # [30 > times] > > Not sure if it's a bug in the child frame API or in the way you use > it; I'm not familiar enough with the child frame API. Neither am I. I stole most of the child-frame code from vertico which adds some more hacks to redirect accidental focus from the child frame back to the parent. Seems like those are needed. > - The way the child frame is positioned makes me think that using the > header line would be more reliable and imply much less code than using > a child frame. Indeed, but the header-line has the drawback that it can only display one line. The context shown here can be two lines if the opening paren is on its own line (like in c-ish languages). > I'd like to give a header line-based approach a try to see how it > compares against using a child frame. Sure, give it a go! :-) Bye, Tassilo