From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nick Helm Newsgroups: gmane.emacs.devel Subject: Re: Should this package be included into the NS port? Date: Wed, 23 May 2018 16:55:50 +1200 Message-ID: References: <20180515183631.GB27909@breton.holly.idiocy.org> <20180518193632.GA31241@breton.holly.idiocy.org> <20180519103329.GB31853@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527051276 31400 195.159.176.226 (23 May 2018 04:54:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 May 2018 04:54:36 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cc: George Plymale II , monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 23 06:54:32 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLLnD-00083u-WC for ged-emacs-devel@m.gmane.org; Wed, 23 May 2018 06:54:32 +0200 Original-Received: from localhost ([::1]:59196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLLpL-0000oJ-2f for ged-emacs-devel@m.gmane.org; Wed, 23 May 2018 00:56:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLLok-0000o3-Hp for emacs-devel@gnu.org; Wed, 23 May 2018 00:56:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLLog-0008SL-Gm for emacs-devel@gnu.org; Wed, 23 May 2018 00:56:06 -0400 Original-Received: from mail-sy3aus01on0119.outbound.protection.outlook.com ([104.47.117.119]:54701 helo=AUS01-SY3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLLof-0008Qp-Rv for emacs-devel@gnu.org; Wed, 23 May 2018 00:56:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenpointcomms.onmicrosoft.com; s=selector1-tenpoint-co-nz; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AhPDxizIoHt3QKXvnBTabnbPvH9X0nV64/EnRhaJwwE=; b=M64gy5B9Yk+aX/yJwOOzC90faHX4dMcTbtqRQXeoUxonFQeq/TNiHkPZroph2c5f9h2jJnlVQfXFD4GAtFtcwkwW/Ea78EyUqV+Sluh0S7G4gW1zB/vd49no+6pxfkbLN5q5L9suDEcY/QY9XoFB5fM/yZR4772Y+5yswUTFSYI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nick@tenpoint.co.nz; Original-Received: from oberon.local (125.239.171.29) by ME2PR01MB2897.ausprd01.prod.outlook.com (2603:10c6:201:22::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.11; Wed, 23 May 2018 04:55:54 +0000 X-Originating-IP: [125.239.171.29] X-ClientProxiedBy: SY2PR01CA0029.ausprd01.prod.outlook.com (2603:10c6:1:15::17) To ME2PR01MB2897.ausprd01.prod.outlook.com (2603:10c6:201:22::14) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:ME2PR01MB2897; X-Microsoft-Exchange-Diagnostics: 1; ME2PR01MB2897; 3:aXcjFpy2UCshrVWhVP/AKAanzCBBJWmLN1dk/FMh9vVu616w175gFUZSwa7nI3HzK8LLvPOhxyYk/BwPH8euTwBwdFu3WSim8V2Ub+0974jXcy1aGvYi3DUW8hHtSaAH7F4NjBhLteCGx0ggamTO6DB0YXF4iwyNOxIyydIAbRqNvzoCykuiArR0ehH9zwn8njyI9TOfeuQSWArhYIV6T3V4tJ3nCVDjiD4YBEofywI07sSeNxgB+nHCuyQEkfc/; 25:My5UbZ1dYb+H/JnwaeC+1G2IihrWovB8UHmlfb0mpJ9DuenOz9n0G9mBRuv97B9Fx+hrO7jiVPD7MyprAfebqyL3Zwf7zuVoinlGP3Y1Ak7ms4e/510rzo6/2DFFKbEOXzYVG+B/mHIoE6X19pLxgZ3xq9BZqLYQF1c/oSCMo78ODWdqFnZcoqDsJmuFUvyFGn6hXLZprLwr5EO02iqD2winzD0YmkGs0K4uCrYwUgayfpyr+ml6LRM/lh6hO9o1Uz6/tuEoiPxqSU3DBOAWL9XEfQBNPGN43uQaBlHl1yUvaZwKeiPuJbv7MDgsrMuNwpcLEH14I6tsVGOtr2FIzA==; 31:irAJAgnFVWrZhrcQ/KvUc5bpjv56Rb0HieJafZ0BbC7LhRcshNYne7dItcCs7O+f++bEiAnjeUVQJ4P7hljEHOPdSkrSl4PLgt3b66F4tUUC5yu3x0tzo4SAb39b8LGlxYON9dMD+zhwzCCokhKS5UzOqyT0jbOCl5B7cwTcPnkJBM3Hw6V858QAC/grZ9NG2riEIWd/6RZ49tQgtGN0yvpsN4M1wbQhmxgm1XWcE X-MS-TrafficTypeDiagnostic: ME2PR01MB2897: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(2016111802025)(20161123562045)(6043046)(6072148)(201708071742011)(7699016); SRVR:ME2PR01MB2897; BCL:0; PCL:0; RULEID:; SRVR:ME2PR01MB2897; X-Microsoft-Exchange-Diagnostics: 1; ME2PR01MB2897; 4:L9wQxy8WgKjiG1GTerBmJZNsx34d+XESTP5ZUa34AxmJcTif/xrZnUqQ00tVUCDsEOXx+h0+CbcDvWtutcVdY+2XudfV1NTPiFiyUGn1oHpdOzOh/vE/iqIuho86eoFfwTRRJc0NRL1JdEVbJ1QzAh+32PoSX21Pmb+gDCqASZvwb1ogTPQFv6YU0+/8XdYVDrIn03GlHzn8NfCyCqaX1wIysKmvpbimoo3+kWPKgcayJlCQN8V9XK2pLA77jlnrtYjJyip0+pUZFcWg+87tBw== X-Forefront-PRVS: 06818431B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(376002)(396003)(39380400002)(39830400003)(366004)(54094003)(199004)(189003)(6512007)(478600001)(446003)(956004)(2616005)(6506007)(386003)(486006)(59450400001)(50466002)(53936002)(6116002)(3846002)(47776003)(6246003)(5660300001)(76176011)(2906002)(23676004)(52146003)(2486003)(4326008)(52116002)(36756003)(186003)(16526019)(86362001)(476003)(26005)(93886005)(6916009)(106356001)(97736004)(8936002)(7736002)(305945005)(25786009)(6486002)(229853002)(58126008)(6666003)(105586002)(316002)(66066001)(74482002)(68736007)(8676002)(81166006)(81156014)(8746002); DIR:OUT; SFP:1102; SCL:1; SRVR:ME2PR01MB2897; H:oberon.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: tenpoint.co.nz does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNRTJQUjAxTUIyODk3OzIzOmdFTldUdzYwZ3k5QThRMlY4NTV0WUpUQTdv?= =?utf-8?B?WHNUOTMySTBDbHh0V1Jwb1JveGQrd2ZMclQwbGVVek9HUzF3YTM4dXhjZk5p?= =?utf-8?B?R3p2cnhCU1pwR0tjbDBuVXc1Q1UrN1ViUUhKcG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EFreQoQoAuj6B6WsyDx1WOijr9xQztxnhxQEDt/NBOGGxBdV9PZ9By8GkF2wDbrx/iiSC/QDg7ZLqMkbSgd77MFEKce0pJE4a42D36nXu6WZWVyRpIILBog/IBGT54oME/9layxO8Z/EuMURK3M1sZxHH+JhSgNGJd7fLxGqvdCNpkuDz/IqMIwQ1q4RKbz3MgNj4uVcwayZTDBFv7J5LFUc1pesOSvMo2x36z8WpEurHiRb8wC8INazqbOKl+HyPONSX3XR9KU37Ca33elHoXvne1DrLYbmU+ZE7iAIg==; 5:tjfD6yEmAftMnx3w84K+sX5SG9TVqqPN9LjHbmHqCinRESccS9W0g7nTu4iUZMufWsVhx4L08V7ISQBpqVnvGSpDZ46XzgjU6TLGsdYHdpz3nA1IPtUlxBiV1s+HIR7I3bVvhEKxabTBcgEYYgvgu2FLo7fYKSP1oMML9GpnI+Q=; 24:uwHa7HwJCfJgYYMZF77HjT0FHmHN2NpX2IjFjwEDzWC/Gp6Q4Xazn4o2TA6DV8FRe/D8FhzSvgGYl8PVQBcB6NiVSpQkYan/THlbhjRGye4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; ME2PR01MB2897; 7:IDIssoSwpKNkJq8zvO9qFbYQ4hMPcl/YUAYW8bXZT8gN/eXUPpG2eIAPastu9AcsGTUGkNIvdPpp9U3szv5OLcrVxOeYMQM4f0r5pYtZOosRt/Wxo2THPoalDqIpCd1e+n1CrB7NNlpRiXL4hfH/Ve6KZDV0VRcpbBMvfs+QSRu21vaq43QfMvuUrhOdSKysdPgmx00y8p+pfCy0xbEAnJcNvxiXd/ydM2ABWumvNqxzMjeNmyTZc4bUScgkeBeJ X-MS-Office365-Filtering-Correlation-Id: 5ae8fd62-216c-4d67-f16a-08d5c0697743 X-OriginatorOrg: tenpoint.co.nz X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2018 04:55:54.4031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ae8fd62-216c-4d67-f16a-08d5c0697743 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: ed686f26-19e8-407b-91d0-7364c1c6f5cf X-MS-Exchange-Transport-CrossTenantHeadersStamped: ME2PR01MB2897 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.117.119 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225590 Archived-At: On Sat, 19 May 2018 at 22:33:29 +1200, Alan Third wrote: > On Sat, May 19, 2018 at 04:42:54PM +1200, Nick Helm wrote: >>=20 >> This is interesting. I think we could tweak the EmacsMenu side of things >> to do this, even with the current code. We'd want to make sure to >> include some kind of new frame command somewhere. >>=20 >> These menus are derived dynamically from Lisp though, and it might be >> difficult to convince it to provide valid entries when no frame is >> selected.=20 > > I=E2=80=99m not sure if the =E2=80=98Emacs=E2=80=99 menu is derived from = lisp. If you turn off > menus completely it still exists. Sorry, I meant to say the mainMenu, which holds all the Lisp menu stuff. Yes, the menu named 'Emacs' (the appMenu) is defined in nsterm.m and doesn't change as far as I know. >> One way around that might be to create a new menu containing >> static NSMenu versions of File and Help, much like we do for the appMenu >> now. When no frame is selected and there are no Lisp menu entries, we >> switch mainMenu to this new menu. When a frame is created, we switch >> back.=20 > > Perhaps we could modify ns_update_menubar to handle the case where > there=E2=80=99s no frame? Maybe, I'm not sure. At the moment, as soon as ns_update_menubar sees that it's not acting on the selected frame it gives up. I tried a quick hack that sets f (the frame) to nil, bypasses the Lisp menu update code and switches in a different static menu, but I couldn't get it to work at all. BTW, if you toggle the menu display off with (menu-bar-mode -1), you can switch between frames/windows without the Lisp menus updating. This prevents set_frame_menubar (and ns_update_menubar) from being called at all. As soon as you click in the menu-bar though, x_activate_menubar is called, which does an ns_update_menubar, which inserts the menus for the selected frame/window. Not sure why this happens, maybe Lisp assumes the menu-bar is un-clickable if it's not supposed to be displayed? (mac always shows a menu-bar, however) I only mention this because I wonder if there might be a way to handle the no-frame case with set_frame_menubar and x_activate_menubar, and avoid messing with ns_update_menubar at all?