From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Should this package be included into the NS port? Date: Sat, 02 Jun 2018 13:22:13 -0400 Message-ID: References: <20180529214223.GA20731@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1527960077 784 195.159.176.226 (2 Jun 2018 17:21:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Jun 2018 17:21:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 02 19:21:13 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 1fPADI-0008Va-BE for ged-emacs-devel@m.gmane.org; Sat, 02 Jun 2018 19:21:12 +0200 Original-Received: from localhost ([::1]:60499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPAFN-0004OW-Hi for ged-emacs-devel@m.gmane.org; Sat, 02 Jun 2018 13:23:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPAEV-0004I3-7o for emacs-devel@gnu.org; Sat, 02 Jun 2018 13:22:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPAER-00079o-8a for emacs-devel@gnu.org; Sat, 02 Jun 2018 13:22:27 -0400 Original-Received: from [195.159.176.226] (port=48160 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPAER-00078r-0d for emacs-devel@gnu.org; Sat, 02 Jun 2018 13:22:23 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fPACH-0007Gl-Fx for emacs-devel@gnu.org; Sat, 02 Jun 2018 19:20:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:+M/iu7lIEsC8qmZJX4+kFSawNXY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:225927 Archived-At: > that a glitch has occurred. If anyone knows how to create a hidden frame > without ever making it visible, I'd be happy to fix that. server.el supposedly manages to do that. At least, it woprked for me when I wrote the code, but I don't know if the NS port handles it correctly: (defun server-select-display (display) ;; If the current frame is on `display' we're all set. ;; Similarly if we are unable to open frames on other displays, there's ;; nothing more we can do. (unless (or (not (fboundp 'make-frame-on-display)) (server--on-display-p (selected-frame) display)) ;; Otherwise, look for an existing frame there and select it. (dolist (frame (frame-list)) (when (server--on-display-p frame display) (select-frame frame))) ;; If there's no frame on that display yet, create and select one. (unless (server--on-display-p (selected-frame) display) (let* ((buffer (generate-new-buffer " *server-dummy*")) (frame (make-frame-on-display display ;; Make it display (and remember) some dummy buffer, so ;; we can detect later if the frame is in use or not. `((server-dummy-buffer . ,buffer) ;; This frame may be deleted later (see ;; server-unselect-display) so we want it to be as ;; unobtrusive as possible. (visibility . nil))))) (select-frame frame) (set-window-buffer (selected-window) buffer) frame)))) -- Stefan