]> code.delx.au - gnu-emacs/blobdiff - lisp/startup.el
(tar-data-swapped): New var.
[gnu-emacs] / lisp / startup.el
index 6185cd5975a68e4ae0f398a611e34236f50d9c54..6dc958cae3d6473112219817960d4ad097378979 100644 (file)
@@ -47,7 +47,7 @@ directory using `find-file'.  If t, open the `*scratch*' buffer."
   :type '(choice
          (const     :tag "Startup screen" nil)
          (directory :tag "Directory" :value "~/")
-         (file      :tag "File" :value "~/file.txt")
+         (file      :tag "File" :value "~/.emacs")
          (const     :tag "Lisp scratch buffer" t))
   :version "23.1"
   :group 'initialization)
@@ -55,8 +55,8 @@ directory using `find-file'.  If t, open the `*scratch*' buffer."
 (defcustom inhibit-startup-screen nil
   "Non-nil inhibits the startup screen.
 
-This is for use in your personal init file (but NOT site-start.el), once
-you are familiar with the contents of the startup screen."
+This is for use in your personal init file (but NOT site-start.el),
+once you are familiar with the contents of the startup screen."
   :type 'boolean
   :group 'initialization)
 
@@ -66,7 +66,7 @@ you are familiar with the contents of the startup screen."
 (defvar startup-screen-inhibit-startup-screen nil)
 
 (defcustom inhibit-startup-echo-area-message nil
-  "*Non-nil inhibits the initial startup echo area message.
+  "Non-nil inhibits the initial startup echo area message.
 Setting this variable takes effect
 only if you do it with the customization buffer
 or if your `.emacs' file contains a line of this form:
@@ -80,12 +80,12 @@ the startup message unless he personally acts to inhibit it."
   :group 'initialization)
 
 (defcustom inhibit-default-init nil
-  "*Non-nil inhibits loading the `default' library."
+  "Non-nil inhibits loading the `default' library."
   :type 'boolean
   :group 'initialization)
 
 (defcustom inhibit-startup-buffer-menu nil
-  "*Non-nil inhibits display of buffer list when more than 2 files are loaded."
+  "Non-nil inhibits display of buffer list when more than 2 files are loaded."
   :type 'boolean
   :group 'initialization)
 
@@ -220,8 +220,8 @@ and VALUE is the value which is given to that frame parameter
     ("-cr" 1 ns-handle-switch cursor-color)
     ("-vb" 0 ns-handle-switch vertical-scroll-bars t)
     ("-hb" 0 ns-handle-switch horizontal-scroll-bars t)
-    ("-bd" 1 ns-handle-switch) 
-    ;; ("--border-width" 1 ns-handle-numeric-switch border-width) 
+    ("-bd" 1 ns-handle-switch)
+    ;; ("--border-width" 1 ns-handle-numeric-switch border-width)
     ;; ("--display" 1 ns-handle-display)
     ("--name" 1 ns-handle-name-switch)
     ("--title" 1 ns-handle-switch title)
@@ -329,7 +329,7 @@ this variable usefully is to set it while building and dumping Emacs."
          (error "Customizing `site-run-file' does not work")))
 
 (defcustom mail-host-address nil
-  "*Name of this machine, for purposes of naming users."
+  "Name of this machine, for purposes of naming users."
   :type '(choice (const nil) string)
   :group 'mail)
 
@@ -340,9 +340,9 @@ this variable usefully is to set it while building and dumping Emacs."
                                                 (system-name))))
                               ;; Empty string means "not set yet".
                               "")
-  "*Full mailing address of this user.
+  "Full mailing address of this user.
 This is initialized with environment variable `EMAIL' or, as a
-fallback, using `mail-host-address'. This is done after your
+fallback, using `mail-host-address'.  This is done after your
 init file is read, in case it sets `mail-host-address'."
   :type 'string
   :group 'mail)
@@ -603,7 +603,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     ("--color"           . "-color")))
 
 (defconst tool-bar-images-pixel-height 24
-  "Height in pixels of images in the tool bar.")
+  "Height in pixels of images in the tool-bar.")
 
 (defvar tool-bar-originally-present nil
   "Non-nil if tool-bars are present before user and site init files are read.")
@@ -693,6 +693,9 @@ opening the first frame (e.g. open a connection to an X server).")
 (declare-function tool-bar-mode "tool-bar" (&optional arg))
 (declare-function tool-bar-setup "tool-bar")
 
+(defvar server-name)
+(defvar server-process)
+
 (defun command-line ()
   (setq before-init-time (current-time)
        after-init-time nil
@@ -975,13 +978,15 @@ opening the first frame (e.g. open a connection to an X server).")
                                   init-file-user)
                           :error)
        (if (file-directory-p (expand-file-name
-                              ;; We don't support ~USER on MS-Windows except
-                              ;; for the current user, and always load .emacs
-                              ;; from the current user's home directory (see
-                              ;; below).  So always check "~", even if invoked
-                              ;; with "-u USER", or if $USER or $LOGNAME are
-                              ;; set to something different.
-                              (if (eq system-type 'windows-nt)
+                              ;; We don't support ~USER on MS-Windows
+                              ;; and MS-DOS except for the current
+                              ;; user, and always load .emacs from
+                              ;; the current user's home directory
+                              ;; (see below).  So always check "~",
+                              ;; even if invoked with "-u USER", or
+                              ;; if $USER or $LOGNAME are set to
+                              ;; something different.
+                              (if (memq system-type '(windows-nt ms-dos))
                                   "~"
                                 (concat "~" init-file-user))))
            nil
@@ -1212,8 +1217,18 @@ the `--debug-init' option to view a complete error backtrace."
   ;; This is done after loading the user's init file and after
   ;; processing all command line arguments to allow e.g. `server-name'
   ;; to be changed before the server starts.
-  (when (daemonp)
-    (server-start))
+  (let ((dn (daemonp)))
+    (when dn
+      (when (stringp dn) (setq server-name dn))
+      (server-start)
+      (if server-process
+         (daemon-initialized)
+       (if (stringp dn)
+           (message
+            "Unable to start daemon: Emacs server named %S already running"
+            server-name)
+         (message "Unable to start the daemon.\nAnother instance of Emacs is running the server, either as daemon or interactively.\nYou can use emacsclient to connect to that Emacs process."))
+       (kill-emacs 1))))
 
   ;; Run emacs-session-restore (session management) if started by
   ;; the session manager and we have a session manager connection.
@@ -1255,6 +1270,7 @@ If this is nil, no message will be displayed."
         '("GNU" (lambda (button) (describe-gnu-project))
           "Display info on the GNU project")))
      " operating system.\n\n"
+     :face variable-pitch
      :link ("Emacs Tutorial" (lambda (button) (help-with-tutorial)))
      "\tLearn basic keystroke commands"
      (lambda ()
@@ -1274,7 +1290,6 @@ If this is nil, no message will be displayed."
             ""
           (concat " (" title ")"))))
      "\n"
-     :face variable-pitch
      :link ("Emacs Guided Tour"
            (lambda (button) (browse-url "http://www.gnu.org/software/emacs/tour/"))
            "Browse http://www.gnu.org/software/emacs/tour/")
@@ -1383,7 +1398,7 @@ Each element in the list should be a list of strings or pairs
   :group 'initialization)
 
 (defcustom fancy-splash-image nil
-  "*The image to show in the splash screens, or nil for defaults."
+  "The image to show in the splash screens, or nil for defaults."
   :group 'fancy-splash-screen
   :type '(choice (const :tag "Default" nil)
                 (file :tag "File")))
@@ -1980,12 +1995,14 @@ Type \\[describe-distribution] for information on "))
   (insert "\tBuying printed manuals from the FSF\n"))
 
 (defun startup-echo-area-message ()
-  (if (eq (key-binding "\C-h\C-a") 'about-emacs)
-      "For information about GNU Emacs and the GNU system, type C-h C-a."
-    (substitute-command-keys
-     "For information about GNU Emacs and the GNU system, type \
-\\[about-emacs].")))
-
+  (cond ((daemonp)
+        "Starting Emacs daemon.")
+       ((eq (key-binding "\C-h\C-a") 'about-emacs)
+        "For information about GNU Emacs and the GNU system, type C-h C-a.")
+       (t
+        (substitute-command-keys
+         "For information about GNU Emacs and the GNU system, type \
+\\[about-emacs]."))))
 
 (defun display-startup-echo-area-message ()
   (let ((resize-mini-windows t))