;;; startup.el --- process Emacs shell arguments -*- lexical-binding: t -*-
-;; Copyright (C) 1985-1986, 1992, 1994-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992, 1994-2012 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
(defcustom initial-buffer-choice nil
"Buffer to show after starting Emacs.
If the value is nil and `inhibit-startup-screen' is nil, show the
-startup screen. If the value is string, visit the specified file or
-directory using `find-file'. If t, open the `*scratch*' buffer."
+startup screen. If the value is string, visit the specified file
+or directory using `find-file'. If t, open the `*scratch*'
+buffer."
:type '(choice
(const :tag "Startup screen" nil)
(directory :tag "Directory" :value "~/")
inside of --eval command line arguments in order to access
following arguments.")
+(with-no-warnings
+ ;; FIXME: Bad name for a dynamically bound variable
+ (defvar argi nil
+ "Current command-line argument."))
+
(defvar command-line-functions nil ;; lrs 7/31/89
"List of functions to process unrecognized command-line arguments.
Each function should access the dynamically bound variables
\"\\'\"; those are added automatically by callers.")
(defun normal-top-level-add-subdirs-to-load-path ()
- "Add all subdirectories of current directory to `load-path'.
+ "Add all subdirectories of `default-directory' to `load-path'.
More precisely, this uses only the subdirectories whose names
start with letters or digits; it excludes any subdirectory named `RCS'
or `CVS', and any subdirectory that contains a file named `.nosearch'."
(setq no-blinking-cursor t)))
;; If the cursorColor X resource exists, alter the `cursor' face
;; spec, but mark it as changed outside of Customize.
- (let ((color (x-get-resource "cursorColor" "CursorColor")))
+ (let ((color (x-get-resource "cursorColor" "Foreground")))
(when color
(put 'cursor 'theme-face
`((changed ((t :background ,color)))))
emacs-basic-display
(and (memq window-system '(x w32 ns))
(not (member (x-get-resource "cursorBlink" "CursorBlink")
- '("off" "false")))))
+ '("no" "off" "false" "0")))))
(setq no-blinking-cursor t))
;; Re-evaluate predefined variables whose initial value depends on
(normal-erase-is-backspace-setup-frame)
;; Register default TTY colors for the case the terminal hasn't a
- ;; terminal init file. We do this regardles of whether the terminal
+ ;; terminal init file. We do this regardless 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
(eq orig-enable-multibyte (default-value
'enable-multibyte-characters)))
;; Init file changed to unibyte. Reset existing multibyte
- ;; buffers (probably *scratch*, *Messages*, *Minibuff-0*).
+ ;; buffers (probably *scratch*, *Messages*, *Minibuf-0*).
;; Arguably this should only be done if they're free of
;; multibyte characters.
(mapc (lambda (buffer)
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
(set-keymap-parent map button-buffer-map)
- (define-key map "\C-?" 'scroll-down)
- (define-key map " " 'scroll-up)
+ (define-key map "\C-?" 'scroll-down-command)
+ (define-key map " " 'scroll-up-command)
(define-key map "q" 'exit-splash-screen)
map)
"Keymap for splash screen buffer.")
;; abort later.
(unless (frame-live-p (selected-frame)) (kill-emacs nil))))))
- (when initial-buffer-choice
- (cond ((eq initial-buffer-choice t)
- (switch-to-buffer (get-buffer-create "*scratch*")))
- ((stringp initial-buffer-choice)
- (find-file initial-buffer-choice))))
+ (when (eq initial-buffer-choice t)
+ ;; When initial-buffer-choice equals t make sure that *scratch*
+ ;; exists.
+ (get-buffer-create "*scratch*"))
;; If *scratch* exists and is empty, insert initial-scratch-message.
+ ;; Do this before switching to *scratch* below to handle bug#9605.
(and initial-scratch-message
(get-buffer "*scratch*")
(with-current-buffer "*scratch*"
(insert initial-scratch-message)
(set-buffer-modified-p nil))))
+ (when initial-buffer-choice
+ (cond ((eq initial-buffer-choice t)
+ (switch-to-buffer (get-buffer-create "*scratch*")))
+ ((stringp initial-buffer-choice)
+ (find-file initial-buffer-choice))))
+
(if (or inhibit-startup-screen
initial-buffer-choice
noninteractive