From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Sticky tooltips Date: Wed, 30 Sep 2020 17:17:33 +0200 Message-ID: References: <83blhpl2xl.fsf@gnu.org> <834kngllb1.fsf@gnu.org> <83pn63iajn.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="32806"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 30 17:27:56 2020 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 1kNe1L-0008RY-TL for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Sep 2020 17:27:56 +0200 Original-Received: from localhost ([::1]:45398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNe1K-0000kW-LA for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Sep 2020 11:27:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNdrX-0008Ja-AJ for emacs-devel@gnu.org; Wed, 30 Sep 2020 11:17:47 -0400 Original-Received: from mail-am7eur06olkn2034.outbound.protection.outlook.com ([40.92.16.34]:26721 helo=EUR06-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNdrN-0006Mw-Ny; Wed, 30 Sep 2020 11:17:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UeMoup1j9WT6iWyow7BTIJKdokD+G8PadQ3vTUVZunY2eXgzDEN6DVe5CBF0EuNAm49GxA3aSHIlciQqPn2kCVMXRHgmBgtJbzw7NcUSY7XqvzC10DQRpVzblmi94fdt77dwV0Lc+q9tj3pwJBabzdgLIoxxs1vN83azJnnQ3sBiBTSH3noRlLfgwWfI1xSX0PpmSus08M59dRROxk76DlK91CxsIS8YGeSeTjSLpyj84l6U3ecyZXeK1fALYgsZvncEmeKJLwIJG1jb7dYDxCGYciUgyLAiUo+91dsxTIZsQYjOwxUt9kQ4dq+XEt5VWqqTaYfijL1/gWnBomUtUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5uLpPmSmNWWFCiLwTkbvmCmvkDs27/gceC/MoMz1fXs=; b=R9ZEIn5+me51u6F5Xd8Y8s87872g9zJvd8xsp2qixcHJ5/893mzxOErbN8x20SKbsOuTgtFVM326jTPuCT9YkV3SmE+2Co64nxrTRpE3BhYAe0Dikfs/E4LQzPEhjheBbC1AVusbAeIDND/8VctO5UAujZWo3JH0Kg1WZGJxPO8lDT/gWjsfd/GfGAqZ0BQJrpJ5E3tOFZd9Km4+QLxeX7DCc0LT8qiPJTVzt85abk7N4YwcItw6mDS2DzPFGTpkwyXi+dZn1lq9Rlj1bX6YHJFJ83wxG8z58stUvDc1wN85P/x/kBrBXnFhg+JmpWoGv3w62skFSFVFDX13yKSrpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5uLpPmSmNWWFCiLwTkbvmCmvkDs27/gceC/MoMz1fXs=; b=Ur98Z0EmiUMoMlCvD5jrTiMvJsUGvoFh/70EXIDvrCrp88xS5RWyMSVObsraPzLaWOfvs3+iFLSscnC8zD9gZZ1WnCbjFgynbYp0DkfDwMSJAq23cWc07HWaYW5XXn2W6XSkStkH72E5P96UAv3H87myzlFAv/pNbx/HGWBEIo8tRukirw6VO3/c/LdKCsH10QKl3t1JHw7zGKdWsAEW+iyPkt0isE063aNCFadWKi3qAWZTHo2GEh6vfK/dWR7b8pzR7PteF3sVUoOg/+dag9VTviZyePRig9SFQG1uh9G83aAr1BYnuAMhHllRZlGry70/DmFuEnX1FCf1f1IeSA== Original-Received: from AM7EUR06FT063.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::40) by AM7EUR06HT065.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34; Wed, 30 Sep 2020 15:17:34 +0000 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com (2a01:111:e400:fc36::41) by AM7EUR06FT063.mail.protection.outlook.com (2a01:111:e400:fc36::403) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Wed, 30 Sep 2020 15:17:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:3F7D2D09ECA87A078ECF6A2BB316613A5880051F831C247DBD9D3285B71A97E8; UpperCasedChecksum:029C0A0A473F7D5AC1AF1B9B0D51DDCCA622FC84434A750698ACA07787557014; SizeAsReceived:7642; Count:46 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::b547:51cd:16c5:4487]) by VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::b547:51cd:16c5:4487%7]) with mapi id 15.20.3433.035; Wed, 30 Sep 2020 15:17:34 +0000 In-Reply-To: <83pn63iajn.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 30 Sep 2020 17:50:04 +0300") X-TMN: [wXmQ73dhoqqopTM2L5PJHdhWx2/qJqhE] X-ClientProxiedBy: AM6P191CA0091.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::32) To VI1PR06MB4526.eurprd06.prod.outlook.com (2603:10a6:803:ac::17) X-Microsoft-Original-Message-ID: <87wo0bmgz6.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6P191CA0091.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Wed, 30 Sep 2020 15:17:34 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: ed488a6d-c1d3-4c83-57b2-08d86553f53b X-MS-TrafficTypeDiagnostic: AM7EUR06HT065: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +YXX9f5wjvXI01flFr4PqiUXut3RwUtL8ueuO1/3TapJlfiXye+Yi6Qzvqf3QDVQtMdHSGRuzatKlF/2mpa0AuL2371j10zFmRrxd6ACF1odqAzFlhrgGD9VSCwguM39stDky0/GbBGeteN71QZWrOK3vFZl8MRMTnvqP0ZyNXt4Se/tHLmdO/hdbBRCrk/aD8g//qfgAGi2nF45ybtzKQ== X-MS-Exchange-AntiSpam-MessageData: /H+f/WNwGwkmoTtUDaqrIolCXkkH8HXE/2BYwWrkZpfjr1tgBuaQ+A297jeKq6pINgv+rr6AIagPIlrY6a6lM+iT1QRkxuWg3nxNoFagoelIrgOpXtuSYNTI3Gtw11HDCF5qp2Yqd+AZ8imzQNOlGw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed488a6d-c1d3-4c83-57b2-08d86553f53b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2020 15:17:34.7251 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT063.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT065 Received-SPF: pass client-ip=40.92.16.34; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/30 11:17:35 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.373, SPF_HELO_PASS=-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.23 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:256763 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: emacs-devel@gnu.org >> Date: Tue, 29 Sep 2020 23:30:14 +0200 >> >> Yeah, you are correct, what tooltip already does, as you say is >> logically what I described, but the implementation is different: >> tooltip.el seems to outsource all it's work to xfns.c, and the code for >> tooltip frame creation; I used just "a naked frame" and some Lisp to >> create an effect of a tooltip. > > The C-level implementation notwithstanding, we still insert the > tooltip text into a buffer, so we could snatch it from there, right? > We could have a command that took that text and displayed it in *Help* > buffer, for example. > >> By the way; "tooltip-show" (in tooltip.el) seems to take a string >> argument; rather than a buffer, and that widget library "widget.el", >> needs a buffer (for the minor mode, etc). > > See above. Yes boss; I am sure you are correct :-). I am not sure if I can do much there since I am not sure I understand the underlaying C implementation really that well; but I'll look try to look at it and play with it for the weekend. Otherwise it would be easy to just wrap the function and in tooltip.el. >> Just as a side curious question: did tooltips really needed own c >> implementation? Isn't code in x-create-tip-frame and x-show-tip seems >> redundant to other frame creation routines/display? Couldn't tooltips be >> implemented using normal frames, with "tooltip-special" code written in >> lisp? > > If you compare x-create-frame and x-create-tip-frame, you will see > that the tip frame is special, and some of the differences are in > fields of the frame object that are not exposed to Lisp. To move this > to Lisp would mean we'd have to expose them to Lisp first, and I'm not > sure we want to do that. I haven't compared, but I suppose it is not same; tooltip frame is undecorated and different window class then ordinary frame. I understand if those low level details are not interesting to expos to lisp, since they are platfrom specific. I think that is what might be spooking in that other example with I posted about focus not being set correctly in a child frame. >> I dont' mean to ditch it away, just a reflection on complexity. Maybe I >> don't see all the complexity with tooltips; but it is still ~900+ lines >> of c code that need to be maintained for X11, and there are well w32 and >> ns implementations, so around 3k locs? > > The code replication is a separate issue: we did make an effort lately > to extract some common code and have it only once. Patches are > welcome to do that in x-create-frame and x-create-tip-frame as well. > It isn't entirely trivial, because the common code is interspersed > with window-system specific API calls. Indeed, I noticed when I was looking the tooltip code; the code seems much better and more readable without all platfrom if-defs; when I looked at some code like a year or half-year ago, it was more difficult to read it; I am not sure I looked at tooltip code back then though. But I think this X/Win32/Mac file separation makes it much nicer. Big +1 for that one.