From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: start emacs without creating frames and connect with emacsclient later Date: Wed, 13 Aug 2008 09:10:46 -0700 Message-ID: <200808131610.m7DGAkvk020047@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218644240 6101 80.91.229.12 (13 Aug 2008 16:17:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 16:17:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 13 18:18:12 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KTJ2n-00077e-8q for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2008 18:17:54 +0200 Original-Received: from localhost ([127.0.0.1]:51478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTJ1q-0004gk-7L for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2008 12:16:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTIyE-0002oA-BQ for emacs-devel@gnu.org; Wed, 13 Aug 2008 12:13:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTIyD-0002nY-D4 for emacs-devel@gnu.org; Wed, 13 Aug 2008 12:13:09 -0400 Original-Received: from [199.232.76.173] (port=39850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTIyD-0002nT-8S for emacs-devel@gnu.org; Wed, 13 Aug 2008 12:13:09 -0400 Original-Received: from sallyv1.ics.uci.edu ([128.195.1.109]:40708) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1KTIyC-0003AP-Lw for emacs-devel@gnu.org; Wed, 13 Aug 2008 12:13:09 -0400 X-ICS-MailScanner-Watermark: 1219248648.46873@1gvdRxtkKvhAVR7rFJM0VQ Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m7DGAkvk020047 for ; Wed, 13 Aug 2008 09:10:46 -0700 (PDT) Original-Lines: 72 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-0.34, required 5, autolearn=disabled, ALL_TRUSTED -1.44, FM_MULTI_ODD2 1.10) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102409 Archived-At: It seemed that this TODO item shouldn't be that hard to do given that we have all the infrastructure: ** Make "emacs --daemon" start emacs without showing any frame. Use emacsclient later to open frames. 10 minutes later it turned out to be true. The patch below implements it. emacs -daemon & will start emacs without creating any frames, and it starts the server. Later you can do: emacsclient -t FILENAME will create a tty frame. and emacsclient -c FILENAME will create an X11 frame. Not sure what to do about: emacsclient FILENAME it won't do anything visibe if no other frame is available. Should it create one? Should something like this go in? We do have a feature freeze, but this is quite simple, and it completes the multi-tty functionality, which is one of the major features of 23.1. --- startup.el.~1.502.~ 2008-08-06 21:53:07.000000000 -0700 +++ startup.el 2008-08-13 08:54:06.000000000 -0700 @@ -698,6 +698,8 @@ opening the first frame (e.g. open a con (attribute class &optional component subclass)) (declare-function tool-bar-mode "tool-bar" (&optional arg)) +(defvar startup-unmapped nil) + (defun command-line () (setq before-init-time (current-time) command-line-default-directory default-directory) @@ -863,6 +865,8 @@ opening the first frame (e.g. open a con (push '(icon-type . t) default-frame-alist)) ((member argi '("-nbc" "-no-blinking-cursor")) (setq no-blinking-cursor t)) + ((equal argi "-unmapped") + (setq startup-unmapped t)) ;; Push the popped arg back on the list of arguments. (t (push argi args) @@ -877,9 +881,11 @@ opening the first frame (e.g. open a con (run-hooks 'before-init-hook) - ;; Under X Window, this creates the X frame and deletes the terminal frame. - (when (fboundp 'frame-initialize) - (frame-initialize)) + (if startup-unmapped + (server-start) + ;; Under X Window, this creates the X frame and deletes the terminal frame. + (when (and (fboundp 'frame-initialize)) + (frame-initialize))) ;; Turn off blinking cursor if so specified in X resources. This is here ;; only because all other settings of no-blinking-cursor are here.