From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: Re: Show show-paren context in a child frame Date: Sat, 05 Feb 2022 19:00:49 +0100 Message-ID: References: <87fsoxlc2p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25745"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 05 19:04:05 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 1nGPPo-0006Qf-6s for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Feb 2022 19:04:04 +0100 Original-Received: from localhost ([::1]:36776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGPPm-0001Kw-7A for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Feb 2022 13:04:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGPMp-0007d1-Eo for emacs-devel@gnu.org; Sat, 05 Feb 2022 13:01:00 -0500 Original-Received: from sonic306-20.consmr.mail.ir2.yahoo.com ([77.238.176.206]:46573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGPMm-0001Mt-Tz for emacs-devel@gnu.org; Sat, 05 Feb 2022 13:00:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1644084053; bh=lQNe9WGm3FY4eRfOpya4hHUHpvBdNpLPJwfnZz6q3a0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=r+7iR7UcNGdw3jF7B8X/lJ0DL/I/dXzt2fzFXR7XIKRwMr8BGCHsU5wndZKoQVPAWIMXNf17HNwMGWb+cnSgxZY1HY+N3JnEXnSSlYjEfulsS7Ix4F4pVUsNMEl18v12O0WhX2Y2D/7wYtjl1m+2jiDeW3KgjTIHUMY0RPlY4DI5Aky0r994QHvVT6gfVpKbFSnsUfTbjIAGvjmMiczjHgo0zchn8lEvcJbamSRqaTZ6UM8hybo1dnFZhJFmUWp673+/8f40AFusxf0E/uzJMdK5BKNGSUJoP8Qvp/H7HpVy6y+2qu8fJYE8EWvpLMlKz+DMNc/907LVH2CoL7q9DA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1644084053; bh=n30qqh1a0lJXtydgArHsQ9x0Lfel5VXatcHCEMOMkab=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=bEW1efW4abQWQoF1y0L3t/CU+tB+ILkx/G9LfDrZr+orapxAzN+1bWWajPBMUVusvA+vBnJxifzvixNst+HbllRLjmy9bU2E+x7lI+r/cDOOt8ZzESKKhPvkS/djF/NS8TjYrpcBjZe7ZeWL77ym+MNS9oHXXCk8KTTt0FgPVafwM8brQekB4h2ABGahazmBZkl+o2oeE/6ia8k9dkzAjmW7WlG6heCfNGLqOgMotz9tiOoYPQ6E7ymLkCDVYi1skivtj1lJzotxVgL8BFfZuD6JSC1i51eqj5RXEqVyGeZ36DHACJXqlDh/PKpueuFR4psN+BAMupwBeHhBa+bH/w== X-YMail-OSG: 4SHW4L8VM1li.118DK9r8NgCCW8v1SvTTKUCNR_k7kQkKsuPdvFZQc.XbC4nv2c T4twucnx54SrE0bHma6fenOP.IGhjcbPrbyoUjiPvT8KeoDKMoqaxtTYgg6lAHYUpjkFX1bIEb.9 Ycgj4x8BSg4hjQqnwsgt3tANS4BSKFkqgaTI4CZ.GfYHjvT.WwiIODz5_fT6iOElJXZ5HdF8Zlkd WJy_s05UQ5RgIzeaGQ.nuKWIAMaSWmxtUmTUh7SsVZljJqrvtGJKG1WsoOpkp62Kr7La9rLBz53b 1HOvyJcqT1PXJv.u05GtKqbGRYsPqzH6JN_F2XvAVjnuC5a3kCIl5rP19QzMPeqieO5dwurUqhP8 eYMhRcvUKsgefAg.wTFNrCb9dMxsLP6zATmkxt7bYc4cNN4IijjnCtVyTrS.mKqYdnUVKpe8hIFx O5I5xy2O9qE0lixJRGrnC8fFYwtiArEcdTXXNQXfLwnuYvePg6rLcKRfQTbUsi.Z4AEfXF7SUkeF 4YY8oM.qVX4neZG03WeiAaiLjA59KJYVthhIgxGGFTNEt0l73YgLfqIx.lP944wqwwX8hhA4Bdpj n7GhMhYJnoqJa6WhOh6WHaBW5yzN4GYIFj3yXeIYOqOpN1useqcHuqDDnjhAA7BJ6OAKWgCheLl9 mn1mCVaDCiPlfI5KUSt0NbWS9tsbKiAspazfsVDKu8HnkCKG.KChxHaNCA6MssP7rgJhWnI80KZR 0PId0Iyd9kbJE56308b0g9HxUTckJz2fVR_md8RUmi2Y2OWECyW6EfnIUFGioA8LCF1zrGgtL3kC IZNIt3uOm_aUVRCERSkyaaS7lBMKz.XccL.3rEOWUv X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Sat, 5 Feb 2022 18:00:53 +0000 Original-Received: by kubenode509.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8e4b64471d13ded91de9737e8c92a323; Sat, 05 Feb 2022 18:00:50 +0000 (UTC) In-Reply-To: <87fsoxlc2p.fsf@gnu.org> (Tassilo Horn's message of "Sat, 05 Feb 2022 13:33:22 +0100") X-Mailer: WebService/1.1.19711 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.176.206; envelope-from=mardani29@yahoo.es; helo=sonic306-20.consmr.mail.ir2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:285907 Archived-At: Tassilo Horn writes: > Hi all, > > 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. > > 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. - 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. - 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. I'd like to give a header line-based approach a try to see how it compares against using a child frame. To make it a good citizen, we need to store the current contents of the header line and restore them when the point is not in a closing delimiter.