Rename `struct device' to `struct terminal'. Rename some terminal-related functions...
[bpt/emacs.git] / lisp / startup.el
index c9f8d5e..cef3841 100644 (file)
@@ -1,7 +1,7 @@
 ;;; startup.el --- process Emacs shell arguments
 
 ;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;;   2001, 2002, 2004, 2005  Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -20,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 (defvar command-line-processed nil
   "Non-nil once command line has been processed.")
 
+(defvar window-system initial-window-system
+  "Name of window system the selected frame is displaying through.
+The value is a symbol--for instance, `x' for X windows.
+The value is nil if the selected frame is on a text-only-terminal.")
+
+(make-variable-frame-local 'window-system)
+
 (defgroup initialization nil
-  "Emacs start-up procedure"
+  "Emacs start-up procedure."
   :group 'internal)
 
-(defcustom inhibit-startup-message nil
-  "*Non-nil inhibits the initial startup message.
+(defcustom inhibit-splash-screen nil
+  "*Non-nil inhibits the startup screen.
 This is for use in your personal init file, once you are familiar
-with the contents of the startup message."
+with the contents of the startup screen."
   :type 'boolean
   :group 'initialization)
 
-(defvaralias 'inhibit-splash-screen 'inhibit-startup-message)
+(defvaralias 'inhibit-startup-message 'inhibit-splash-screen)
 
 (defcustom inhibit-startup-echo-area-message nil
   "*Non-nil inhibits the initial startup echo area message.
@@ -121,8 +128,7 @@ This is normally copied from `default-directory' when Emacs starts.")
     ("-bg" 1 x-handle-switch background-color)
     ("-background" 1 x-handle-switch background-color)
     ("-ms" 1 x-handle-switch mouse-color)
-    ("-itype" 0 x-handle-switch icon-type t)
-    ("-i" 0 x-handle-switch icon-type t)
+    ("-nbi" 0 x-handle-switch icon-type nil)
     ("-iconic" 0 x-handle-iconic)
     ("-xrm" 1 x-handle-xrm-switch)
     ("-cr" 1 x-handle-switch cursor-color)
@@ -143,7 +149,7 @@ This is normally copied from `default-directory' when Emacs starts.")
     ("--foreground-color" 1 x-handle-switch foreground-color)
     ("--background-color" 1 x-handle-switch background-color)
     ("--mouse-color" 1 x-handle-switch mouse-color)
-    ("--icon-type" 0 x-handle-switch icon-type t)
+    ("--no-bitmap-icon" 0 x-handle-switch icon-type nil)
     ("--iconic" 0 x-handle-iconic)
     ("--xrm" 1 x-handle-xrm-switch)
     ("--cursor-color" 1 x-handle-switch cursor-color)
@@ -184,9 +190,9 @@ This is because we already did so.")
 
 (defvar keyboard-type nil
   "The brand of keyboard you are using.
-This variable is used to define
-the proper function and keypad keys for use under X.  It is used in a
-fashion analogous to the environment variable TERM.")
+This variable is used to define the proper function and keypad
+keys for use under X.  It is used in a fashion analogous to the
+environment variable TERM.")
 
 (defvar window-setup-hook nil
   "Normal hook run to initialize window system display.
@@ -234,7 +240,7 @@ is less convenient.
 This variable is defined for customization so as to make
 it visible in the relevant context.  However, actually customizing it
 is not allowed, since it would not work anyway.  The only way to set
-this variable usefully is to set it during while building and dumping Emacs."
+this variable usefully is to set it while building and dumping Emacs."
   :type '(choice (const :tag "none" nil) string)
   :group 'initialization
   :initialize 'custom-initialize-default
@@ -287,6 +293,8 @@ from being initialized."
 
 (defvar no-blinking-cursor nil)
 
+(defvar default-frame-background-mode)
+
 (defvar pure-space-overflow nil
   "Non-nil if building Emacs overflowed pure space.")
 
@@ -368,11 +376,17 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     ;; of that dir into load-path,
     ;; Look for a leim-list.el file too.  Loading it will register
     ;; available input methods.
-    (dolist (dir load-path)
-      (let ((default-directory dir))
-       (load (expand-file-name "subdirs.el") t t t))
-      (let ((default-directory dir))
-       (load (expand-file-name "leim-list.el") t t t)))
+    (let ((tail load-path) dir)
+      (while tail
+        (setq dir (car tail))
+        (let ((default-directory dir))
+          (load (expand-file-name "subdirs.el") t t t))
+        (let ((default-directory dir))
+          (load (expand-file-name "leim-list.el") t t t))
+        ;; We don't use a dolist loop and we put this "setq-cdr" command at
+        ;; the end, because the subdirs.el files may add elements to the end
+        ;; of load-path and we want to take it into account.
+        (setq tail (cdr tail))))
     (unless (eq system-type 'vax-vms)
       ;; If the PWD environment variable isn't accurate, delete it.
       (let ((pwd (getenv "PWD")))
@@ -426,37 +440,19 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
        ;; for instance due to a dense colormap.
        (when (or frame-initial-frame
                  ;; If frame-initial-frame has no meaning, do this anyway.
-                 (not (and window-system
+                 (not (and initial-window-system
                            (not noninteractive)
-                           (not (eq window-system 'pc)))))
+                           (not (eq initial-window-system 'pc)))))
          ;; Modify the initial frame based on what .emacs puts into
          ;; ...-frame-alist.
          (if (fboundp 'frame-notice-user-settings)
              (frame-notice-user-settings))
+         ;; Set the faces for the initial background mode even if
+         ;; frame-notice-user-settings didn't (such as on a tty).
+         ;; frame-set-background-mode is idempotent, so it won't
+         ;; cause any harm if it's already been done.
          (if (fboundp 'frame-set-background-mode)
-             ;; Set the faces for the initial background mode even if
-             ;; frame-notice-user-settings didn't (such as on a tty).
-             ;; frame-set-background-mode is idempotent, so it won't
-             ;; cause any harm if it's already been done.
-             (let ((frame-background-mode frame-background-mode)
-                   (frame (selected-frame))
-                   term)
-               (when (and (null window-system)
-                          ;; Don't override a possibly customized value.
-                          (null frame-background-mode)
-                          ;; Don't override user specifications.
-                          (null (frame-parameter frame 'reverse))
-                          (let ((bg (frame-parameter frame 'background-color)))
-                            (or (null bg)
-                                (member bg '(unspecified "unspecified-bg")))))
-                 (setq term (getenv "TERM"))
-                 ;; Some files in lisp/term do a better job with the
-                 ;; background mode, but we leave this here anyway, in
-                 ;; case they remove those files.
-                 (if (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
-                                   term)
-                     (setq frame-background-mode 'light)))
-               (frame-set-background-mode (selected-frame)))))
+             (frame-set-background-mode (selected-frame))))
 
        ;; Now we know the user's default font, so add it to the menu.
        (if (fboundp 'font-menu-add-default)
@@ -497,6 +493,20 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 (defvar tool-bar-originally-present nil
   "Non-nil if tool-bars are present before user and site init files are read.")
 
+(defvar handle-args-function-alist '((nil . tty-handle-args))
+  "Functions for processing window-system dependent command-line arguments.
+Window system startup files should add their own function to this
+alist, which should parse the command line arguments.  Those
+pertaining to the window system should be processed and removed
+from the returned command line.")
+
+(defvar window-system-initialization-alist '((nil . ignore))
+  "Alist of window-system initialization functions.
+Window-system startup files should add their own initialization
+function to this list.  The function should take no arguments,
+and initialize the window system environment to prepare for
+opening the first frame (e.g. open a connection to an X server).")
+
 ;; Handle the X-like command-line arguments "-fg", "-bg", "-name", etc.
 (defun tty-handle-args (args)
   (let (rest)
@@ -568,7 +578,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 
   ;; Choose a reasonable location for temporary files.
   (custom-reevaluate-setting 'temporary-file-directory)
-  (custom-reevaluate-setting 'small-emporary-file-directory)
+  (custom-reevaluate-setting 'small-temporary-file-directory)
   (custom-reevaluate-setting 'auto-save-file-name-transforms)
 
   ;; See if we should import version-control from the environment variable.
@@ -601,16 +611,22 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     (setq eol-mnemonic-dos  "(DOS)"
           eol-mnemonic-mac  "(Mac)")))
 
-  ;; Read window system's init file if using a window system.
+  ;; Make sure window system's init file was loaded in loadup.el if using a window system.
   (condition-case error
-      (if (and window-system (not noninteractive))
-         (load (concat term-file-prefix
-                       (symbol-name window-system)
-                       "-win")
-               ;; Every window system should have a startup file;
-               ;; barf if we can't find it.
-               nil t))
-    ;; If we can't read it, print the error message and exit.
+    (unless noninteractive
+      (if (and initial-window-system
+              (not (featurep
+                    (intern (concat (symbol-name initial-window-system) "-win")))))
+         (error "Unsupported window system `%s'" initial-window-system))
+      ;; Process window-system specific command line parameters.
+      (setq command-line-args
+           (funcall (or (cdr (assq initial-window-system handle-args-function-alist))
+                        (error "Unsupported window system `%s'" initial-window-system))
+                    command-line-args))
+      ;; Initialize the window system. (Open connection, etc.)
+      (funcall (or (cdr (assq initial-window-system window-system-initialization-alist))
+                  (error "Unsupported window system `%s'" initial-window-system))))
+    ;; If there was an error, print the error message and exit.
     (error
      (princ
       (if (eq (car error) 'error)
@@ -626,15 +642,29 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
                              (cdr error) ", "))))
       'external-debugging-output)
      (terpri 'external-debugging-output)
-     (setq window-system nil)
+     (setq initial-window-system nil)
      (kill-emacs)))
 
-  ;; Windowed displays do this inside their *-win.el.
-  (unless (or (display-graphic-p) noninteractive)
-    (setq command-line-args (tty-handle-args command-line-args)))
-
   (set-locale-environment nil)
 
+  ;; Convert preloaded file names to absolute.
+  (let ((lisp-dir
+        (file-name-directory
+         (locate-file "simple" load-path
+                      load-suffixes))))
+
+    (setq load-history
+         (mapcar (lambda (elt)
+                   (if (and (stringp (car elt))
+                            (not (file-name-absolute-p (car elt))))
+                       (cons (concat lisp-dir
+                                     (car elt)
+                                     (if (string-match "[.]el$" (car elt))
+                                         "" ".elc"))
+                             (cdr elt))
+                     elt))
+                 load-history)))
+
   ;; Convert the arguments to Emacs internal representation.
   (let ((args (cdr command-line-args)))
     (while args
@@ -657,9 +687,9 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     ;; processed.  This is consistent with the way main in emacs.c
     ;; does things.
     (while (and (not done) args)
-      (let* ((longopts '(("--no-init-file") ("--no-site-file") ("--user")
-                         ("--debug-init") ("--iconic") ("--icon-type")
-                        ("--no-blinking-cursor") ("--bare-bones")))
+      (let* ((longopts '(("--no-init-file") ("--no-site-file") ("--debug-init")
+                         ("--user") ("--iconic") ("--icon-type") ("--quick")
+                        ("--no-blinking-cursor") ("--basic-display")))
              (argi (pop args))
              (orig-argi argi)
              argval)
@@ -714,6 +744,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     (and command-line-args
          (setcdr command-line-args args)))
 
+  (run-hooks 'before-init-hook)
+
   ;; Under X Window, this creates the X frame and deletes the terminal frame.
   (when (fboundp 'frame-initialize)
     (frame-initialize))
@@ -730,7 +762,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   ;; If frame was created with a menu bar, set menu-bar-mode on.
   (unless (or noninteractive
              emacs-basic-display
-              (and (memq window-system '(x w32))
+              (and (memq initial-window-system '(x w32))
                    (<= (frame-parameter nil 'menu-bar-lines) 0)))
     (menu-bar-mode 1))
 
@@ -744,24 +776,22 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   ;; Can't do this init in defcustom because the relevant variables
   ;; are not set.
   (custom-reevaluate-setting 'blink-cursor-mode)
-  (custom-reevaluate-setting 'normal-erase-is-backspace)
+  (custom-reevaluate-setting 'tooltip-mode)
+  (custom-reevaluate-setting 'global-font-lock-mode)
+  (custom-reevaluate-setting 'mouse-wheel-down-event)
+  (custom-reevaluate-setting 'mouse-wheel-up-event)
+  (custom-reevaluate-setting 'file-name-shadow-mode)
+  (custom-reevaluate-setting 'send-mail-function)
 
-  ;; If you change the code below, you need to also change the
-  ;; corresponding code in the tooltip-mode defcustom.  The two need
-  ;; to be equivalent under all conditions, or Custom will get confused.
-  (unless (or noninteractive
-             emacs-basic-display
-              (not (display-graphic-p))
-              (not (fboundp 'x-show-tip)))
-    (tooltip-mode 1))
+  (normal-erase-is-backspace-setup-frame)
 
   ;; Register default TTY colors for the case the terminal hasn't a
-  ;; terminal init file.
-  (unless (memq window-system '(x w32))
-    ;; We do this regardles of whether the terminal supports colors
-    ;; or not, since they can switch that support on or off in
-    ;; mid-session by setting the tty-color-mode frame parameter.
-    (tty-register-default-colors))
+  ;; terminal init file.  We do this regardles of whether the terminal
+  ;; supports colors or not and regardless the current display type,
+  ;; since users can connect to color-capable terminals and also
+  ;; switch color support on or off in mid-session by setting the
+  ;; tty-color-mode frame parameter.
+  (tty-register-default-colors)
 
   ;; Record whether the tool-bar is present before the user and site
   ;; init files are processed.  frame-notice-user-settings uses this
@@ -779,8 +809,6 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
        (old-font-list-limit font-list-limit)
        (old-face-ignored-fonts face-ignored-fonts))
 
-    (run-hooks 'before-init-hook)
-
     ;; Run the site-start library if it exists.  The point of this file is
     ;; that it is run before .emacs.  There is no point in doing this after
     ;; .emacs; that is useless.
@@ -791,6 +819,20 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     ;; the startup message.
     (setq inhibit-startup-message nil)
 
+    ;; Warn for invalid user name.
+    (when init-file-user
+      (if (string-match "[~/:\n]" init-file-user)
+         (display-warning 'initialization
+                          (format "Invalid user name %s"
+                                  init-file-user)
+                          :error)
+       (if (file-directory-p (expand-file-name (concat "~" init-file-user)))
+           nil
+         (display-warning 'initialization
+                          (format "User %s has no home directory"
+                                  init-file-user)
+                          :error))))
+
     ;; Load that user's init file, or the default one, or none.
     (let (debug-on-error-from-init-file
          debug-on-error-should-be-set
@@ -827,14 +869,12 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 
                      (when (eq user-init-file t)
                        ;; If we did not find ~/.emacs, try
-                       ;; ~/.emacs.d/.emacs.
+                       ;; ~/.emacs.d/init.el.
                        (let ((otherfile
                               (expand-file-name
-                               (file-name-nondirectory user-init-file-1)
+                               "init"
                                (file-name-as-directory
-                                (expand-file-name
-                                 ".emacs.d"
-                                 (file-name-directory user-init-file-1))))))
+                                (concat "~" init-file-user "/.emacs.d")))))
                          (load otherfile t t)
 
                          ;; If we did not find the user's init file,
@@ -898,6 +938,10 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
                 (pop-to-buffer "*Messages*"))
               (setq init-file-had-error t)))))
 
+       (if (and deactivate-mark transient-mark-mode)
+           (with-current-buffer (window-buffer)
+             (deactivate-mark)))
+
        ;; If the user has a file of abbrevs, read it.
        (if (file-exists-p abbrev-file-name)
            (quietly-read-abbrev-file abbrev-file-name))
@@ -935,6 +979,38 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
                                        (or mail-host-address
                                            (system-name)))))
 
+    ;; Originally face attributes were specified via
+    ;; `font-lock-face-attributes'.  Users then changed the default
+    ;; face attributes by setting that variable.  However, we try and
+    ;; be back-compatible and respect its value if set except for
+    ;; faces where M-x customize has been used to save changes for the
+    ;; face.
+    (when (boundp 'font-lock-face-attributes)
+      (let ((face-attributes font-lock-face-attributes))
+       (while face-attributes
+         (let* ((face-attribute (pop face-attributes))
+                (face (car face-attribute)))
+           ;; Rustle up a `defface' SPEC from a
+           ;; `font-lock-face-attributes' entry.
+           (unless (get face 'saved-face)
+             (let ((foreground (nth 1 face-attribute))
+                   (background (nth 2 face-attribute))
+                   (bold-p (nth 3 face-attribute))
+                   (italic-p (nth 4 face-attribute))
+                   (underline-p (nth 5 face-attribute))
+                   face-spec)
+               (when foreground
+                 (setq face-spec (cons ':foreground (cons foreground face-spec))))
+               (when background
+                 (setq face-spec (cons ':background (cons background face-spec))))
+               (when bold-p
+                 (setq face-spec (append '(:weight bold) face-spec)))
+               (when italic-p
+                 (setq face-spec (append '(:slant italic) face-spec)))
+               (when underline-p
+                 (setq face-spec (append '(:underline t) face-spec)))
+               (face-spec-set face (list (list t face-spec)) nil)))))))
+
     ;; If parameter have been changed in the init file which influence
     ;; face realization, clear the face cache so that new faces will
     ;; be realized.
@@ -967,17 +1043,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   ;; Load library for our terminal type.
   ;; User init file can set term-file-prefix to nil to prevent this.
   (unless (or noninteractive
-              window-system
-              (null term-file-prefix))
-    (let ((term (getenv "TERM"))
-          hyphend)
-      (while (and term
-                  (not (load (concat term-file-prefix term) t t)))
-        ;; Strip off last hyphen and what follows, then try again
-        (setq term
-              (if (setq hyphend (string-match "[-_][^-_]+$" term))
-                  (substring term 0 hyphend)
-                nil)))))
+              initial-window-system)
+    (tty-run-terminal-initialization (selected-frame)))
 
   ;; Update the out-of-memory error message based on user's key bindings
   ;; for save-some-buffers.
@@ -1050,6 +1117,7 @@ Read the Emacs Manual\tView the Emacs manual using Info
           :face variable-pitch
           "\
 Copying Conditions\tConditions for redistributing and changing Emacs
+Getting New Versions\tHow to obtain the latest version of Emacs
 More Manuals / Ordering Manuals       Buying printed manuals from the FSF\n")
   (:face variable-pitch
           "You can do basic editing with the menu bar and scroll bar \
@@ -1229,7 +1297,13 @@ This is an internal function used to turn off the splash screen after
 the user caused an input event by hitting a key or clicking with the
 mouse."
   (interactive)
-  (push last-command-event unread-command-events)
+  (if (and (memq 'down (event-modifiers last-command-event))
+          (eq (posn-window (event-start last-command-event))
+              (selected-window)))
+      ;; This is a mouse-down event in the spash screen window.
+      ;; Ignore it and consume the corresponding mouse-up event.
+      (read-event)
+    (push last-command-event unread-command-events))
   (throw 'exit nil))
 
 
@@ -1335,20 +1409,20 @@ You can do basic editing with the menu bar and scroll bar using the mouse.
 
 Useful File menu items:
 Exit Emacs             (or type Control-x followed by Control-c)
-Recover Session                recover files you were editing before a crash
+Recover Crashed Session        Recover files you were editing before a crash
 
 Important Help menu items:
-Emacs Tutorial         Learn-by-doing tutorial for using Emacs efficiently.
+Emacs Tutorial         Learn how to use Emacs efficiently
 Emacs FAQ              Frequently asked questions and answers
 Read the Emacs Manual  View the Emacs manual using Info
 \(Non)Warranty         GNU Emacs comes with ABSOLUTELY NO WARRANTY
-Copying Conditions     Conditions for redistributing and changing Emacs.
-Getting New Versions   How to obtain the latest version of Emacs.
-More Manuals / Ordering Manuals    How to order printed manuals from the FSF.
+Copying Conditions     Conditions for redistributing and changing Emacs
+Getting New Versions   How to obtain the latest version of Emacs
+More Manuals / Ordering Manuals    How to order printed manuals from the FSF
 ")
                  (insert "\n\n" (emacs-version)
                          "
-Copyright (C) 2004 Free Software Foundation, Inc."))
+Copyright (C) 2005 Free Software Foundation, Inc."))
 
              ;; No mouse menus, so give help using kbd commands.
 
@@ -1356,7 +1430,7 @@ Copyright (C) 2004 Free Software Foundation, Inc."))
              ;; use precomputed string to save lots of time.
              (if (and (eq (key-binding "\C-h") 'help-command)
                       (eq (key-binding "\C-xu") 'advertised-undo)
-                      (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
+                      (eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal)
                       (eq (key-binding "\C-ht") 'help-with-tutorial)
                       (eq (key-binding "\C-hi") 'info)
                       (eq (key-binding "\C-hr") 'info-emacs-manual)
@@ -1373,7 +1447,7 @@ Browse manuals     C-h i")
 Get help          %s
 Emacs manual      \\[info-emacs-manual]
 Emacs tutorial    \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo]
-Buy manuals        \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-emacs]
+Buy manuals        \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-terminal]
 Browse manuals     \\[info]"
                                 (let ((where (where-is-internal
                                               'help-command nil t)))
@@ -1396,7 +1470,7 @@ If you have no Meta key, you may instead type ESC followed by the character.)")
 
              (insert "\n\n" (emacs-version)
                      "
-Copyright (C) 2004 Free Software Foundation, Inc.")
+Copyright (C) 2005 Free Software Foundation, Inc.")
 
              (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
                       (eq (key-binding "\C-h\C-d") 'describe-distribution)
@@ -1455,7 +1529,7 @@ Type \\[describe-distribution] for information on getting the latest version."))
 
 (defun display-startup-echo-area-message ()
   (let ((resize-mini-windows t))
-    (message (startup-echo-area-message))))
+    (message "%s" (startup-echo-area-message))))
 
 
 (defun display-splash-screen ()
@@ -1621,6 +1695,15 @@ normal otherwise."
                      (setq file file-ex))
                    (load file nil t)))
 
+               ;; This is used to handle -script.  It's not clear
+               ;; we need to document it.
+                ((member argi '("-scriptload"))
+                 (let* ((file (command-line-normalize-file-name
+                               (or argval (pop command-line-args-left))))
+                        ;; Take file from default dir.
+                        (file-ex (expand-file-name file)))
+                   (load file-ex nil t t)))
+
                 ((equal argi "-insert")
                  (setq tem (or argval (pop command-line-args-left)))
                  (or (stringp tem)
@@ -1631,11 +1714,11 @@ normal otherwise."
                  (kill-emacs t))
 
                 ((string-match "^\\+[0-9]+\\'" argi)
-                 (setq line (string-to-int argi)))
+                 (setq line (string-to-number argi)))
 
                 ((string-match "^\\+\\([0-9]+\\):\\([0-9]+\\)\\'" argi)
-                 (setq line (string-to-int (match-string 1 argi))
-                       column (string-to-int (match-string 2 argi))))
+                 (setq line (string-to-number (match-string 1 argi))
+                       column (string-to-number (match-string 2 argi))))
 
                 ((setq tem (assoc argi command-line-x-option-alist))
                  ;; Ignore X-windows options and their args if not using X.
@@ -1701,11 +1784,7 @@ normal otherwise."
   ;; Maybe display a startup screen.
   (unless (or inhibit-startup-message
              noninteractive
-             emacs-quick-startup
-            ;; Don't display startup screen if init file
-            ;; has started some sort of server.
-            (and (fboundp 'process-list)
-                 (process-list)))
+             emacs-quick-startup)
     ;; Display a startup screen, after some preparations.
 
     ;; If there are no switches to process, we might as well