From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Should this package be included into the NS port? Date: Fri, 18 May 2018 20:36:32 +0100 Message-ID: <20180518193632.GA31241@breton.holly.idiocy.org> References: <20180515183631.GB27909@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1526672083 24220 195.159.176.226 (18 May 2018 19:34:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 May 2018 19:34:43 +0000 (UTC) User-Agent: Mutt/1.9.3 (2018-01-21) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: George Plymale II Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 18 21:34:39 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 1fJl97-000688-MQ for ged-emacs-devel@m.gmane.org; Fri, 18 May 2018 21:34:33 +0200 Original-Received: from localhost ([::1]:40664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJlBE-000451-BV for ged-emacs-devel@m.gmane.org; Fri, 18 May 2018 15:36:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJlB7-00044l-UJ for emacs-devel@gnu.org; Fri, 18 May 2018 15:36:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJlB6-0002Fd-RF for emacs-devel@gnu.org; Fri, 18 May 2018 15:36:37 -0400 Original-Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]:44947) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJlB6-0002F8-JT for emacs-devel@gnu.org; Fri, 18 May 2018 15:36:36 -0400 Original-Received: by mail-wr0-x234.google.com with SMTP id y15-v6so10260713wrg.11 for ; Fri, 18 May 2018 12:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=CERFfjl0TiMKu8Fdz5FR6+LgtUP1Nf+7FItYEDK/gD4=; b=XxQdjL9blX7kG7gfyxG4fakAWb5OrC9IeXhx8iO9fw3vxh2tbBwFxgA8eBRJTLgOZo F2cSP4vbQlEN9NLvmXfTK1r8hzvNggxAOkHZr+lePCc9ihWBVC6FcH0hF858bZKRjNMy zyTJI/XVdbTpxVAqBtA1mgiYdUOxSQPf9v8Xx2kpSNZZX3WV8ATpYumSg2VLAhdkFLUx p7b8QVA/Qrn+a6WwlNCTC8XzUi5L2ifuWymdHF0SYybmd9qrXTMmWSVfT9e6gTKBoLfN Pn8h/ouOXnLlG6JdaE2eD5VPjtiRGfXuKM60rjjljtmbg4vcg3mWRbk+i8wfyxVtYGZ1 PisA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=CERFfjl0TiMKu8Fdz5FR6+LgtUP1Nf+7FItYEDK/gD4=; b=Di8O+tVNprFTzjLMFYuT7T22BWVLYMOs+GMCjwtCJUTKFjIrZl3o0dhQLS7Ie7tWGx wCZ5mJCi50D/8uuQ7Gh0Mn3XURGoDpi1h1Z19xYYOJl8hC9l9OZlyeEfItpgydD+Oqxg LLe0BPjQ8CR+BT1AJxkMJp9BITBRNEqsJaYeDFd/q6kK/yerOQy6FK8JmMoENJlWXdBp gBUbctM/E/RzoWASFZ/sbEwav7CapJpsHJ3QVAgSN2JC3y8x1ZdQ//y/8W9zs3cksDnz 5exJWhXi0rfDp4BloA5NT2Bwr+NMa8nuw+OQoWzaxgu047fIrKCYsbZJI1rHGbnkED6d e8/w== X-Gm-Message-State: ALKqPwfzl9pA3RohAaaCKOpuj+FinBywpMMnYo0+8rq7qH5GR8+ZpkyL FgnCjqtf8COKxI1KcgG9NwJc5oji X-Google-Smtp-Source: AB8JxZodYVRW+hAl7iOzGUgf2PpEVcmaqil6Z5lmPDMhOiNc1P3oTmdKBLCAC6PE6HV0g1gXWlSQxg== X-Received: by 2002:adf:ce03:: with SMTP id p3-v6mr8465502wrn.110.1526672195183; Fri, 18 May 2018 12:36:35 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-3195-ed66-b02d-6c9f.holly.idiocy.org. [2001:8b0:3f8:8129:3195:ed66:b02d:6c9f]) by smtp.gmail.com with ESMTPSA id 187-v6sm10990453wmu.41.2018.05.18.12.36.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 12:36:34 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::234 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:225410 Archived-At: On Tue, May 15, 2018 at 10:48:20PM -0400, George Plymale II wrote: > Alan Third writes: > > > It might be worth investigating exactly why the NS port can’t open a > > new frame in this situation, but I’ve not got round to it yet. It > > seems rather strange to me. > > Yes, I agree. I would also very much like to know the cause of this bug, > but alas I'm a bit strapped for time as well. I've done some casual, > fruitless experimentation with it in the past yet I've gotten no closer > to the cause. If anyone would be willing to take up the torch for this > and do some detective work, that would be awesome. I’ve had a dig around and it looks as though emacsclient is able to open a new GUI frame, so it’s not quite as dire as I’d previously thought. There are two problems, though. * Application Menu When the last NS frame is deleted the menus aren’t updated, so I think they’ll be the menus as defined for the last frame. They should probably be cut right back to just the ‘Emacs’ menu, and perhaps ‘help’. (NOTE: The menus are a bit of a mess, Nick Helm and I have been discussing them in bug#31371.) * Dock Menu This has a ‘new frame’ option but just plain doesn’t work. I think the problem is the way it’s trying to create a new frame: - (void)newFrame: (id)sender { NSTRACE ("[EmacsApp newFrame:]"); struct frame *emacsframe = SELECTED_FRAME (); NSEvent *theEvent = [NSApp currentEvent]; if (!emacs_event) return; emacs_event->kind = NS_NONKEY_EVENT; emacs_event->code = KEY_NS_NEW_FRAME; emacs_event->modifiers = 0; EV_TRAILER (theEvent); } This seems to rely on there being an existing NS frame, but we’ve deleted the last one. I assume if we were clever we’d be able to use the, still open, terminal frame. Is there some other way of creating a new GUI frame? I assume there must be since emacsclient can do it. * ALSO! Closing the terminal frame when there are no GUI frames left results in a crash. I guess Emacs doesn’t think it needs to clean up the NS stuff or something? I don’t really know what’s going on there. -- Alan Third