emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

start emacs without creating frames and connect with emacsclient later


From: Dan Nicolaescu
Subject: start emacs without creating frames and connect with emacsclient later
Date: Wed, 13 Aug 2008 09:10:46 -0700

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]