home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-19.28-src.tgz / tar.out / fsf / emacs / lisp / startup.el < prev    next >
Lisp/Scheme  |  1996-09-28  |  21KB  |  547 lines

  1. ;;; startup.el --- process Emacs shell arguments
  2.  
  3. ;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
  4.  
  5. ;; Maintainer: FSF
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of GNU Emacs.
  9.  
  10. ;; GNU Emacs is free software; you can redistribute it and/or modify
  11. ;; it under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; GNU Emacs is distributed in the hope that it will be useful,
  16. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. ;; GNU General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  22. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24. ;;; Commentary:
  25.  
  26. ; These are processed only at the beginning of the argument list.
  27. ; -batch        execute noninteractively (messages go to stdout,
  28. ;             variable noninteractive set to t)
  29. ;             This option must be the first in the arglist.
  30. ;             Processed by `main' in emacs.c -- never seen by lisp
  31. ; -t file        Specify to use file rather than stdin/stdout
  32. ;             as the terminal.
  33. ;             This option must be the first in the arglist.
  34. ;             Processed by `main' in emacs.c -- never seen by lisp
  35. ; -nw            Inhibit the use of any window-system-specific display
  36. ;             code; use the current virtual terminal.
  37. ;             This option must be the first in the arglist.
  38. ;             Processed by `main' in emacs.c -- never seen by lisp
  39. ; -q            load no init file
  40. ; -no-init-file        same
  41. ; -u user        load user's init file
  42. ; -user user        same
  43. ; -debug-init        Don't catch errors in init file; let debugger run.
  44.  
  45. ; These are processed in the order encountered.
  46. ; -f function        execute function
  47. ; -funcall function    same
  48. ; -l file        load file
  49. ; -load file        same
  50. ; -insert file        same
  51. ; file            visit file
  52. ; -kill            kill (exit) emacs
  53.  
  54. ;;; Code:
  55.  
  56. (setq top-level '(normal-top-level))
  57.  
  58. (defvar command-line-processed nil "t once command line has been processed")
  59.  
  60. (defconst inhibit-startup-message nil
  61.   "*Non-nil inhibits the initial startup message.
  62. This is for use in your personal init file, once you are familiar
  63. with the contents of the startup message.")
  64.  
  65. (defconst inhibit-startup-echo-area-message nil
  66.   "*Non-nil inhibits the initial startup echo area message.
  67. Inhibition takes effect only if your `.emacs' file contains
  68. a line of this form:
  69.  (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")
  70. If your `.emacs' file is byte-compiled, use the following form instead:
  71.  (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\"))
  72. Thus, someone else using a copy of your `.emacs' file will see
  73. the startup message unless he personally acts to inhibit it.")
  74.  
  75. (defconst inhibit-default-init nil
  76.   "*Non-nil inhibits loading the `default' library.")
  77.  
  78. (defconst command-switch-alist nil
  79.   "Alist of command-line switches.
  80. Elements look like (SWITCH-STRING . HANDLER-FUNCTION).
  81. HANDLER-FUNCTION receives switch name as sole arg;
  82. remaining command-line args are in the variable `command-line-args-left'.")
  83.  
  84. (defvar command-line-args-left nil
  85.   "List of command-line args not yet processed.")
  86.  
  87. (defvar command-line-functions nil    ;; lrs 7/31/89
  88.   "List of functions to process unrecognized command-line arguments.
  89. Each function should access the dynamically bound variables
  90. `argi' (the current argument) and `command-line-args-left' (the remaining
  91. arguments).  The function should return non-nil only if it recognizes and
  92. processes `argi'.  If it does so, it may consume successive arguments by
  93. altering `command-line-args-left' to remove them.")
  94.  
  95. (defvar command-line-default-directory nil
  96.   "Default directory to use for command line arguments.
  97. This is normally copied from `default-directory' when Emacs starts.")
  98.  
  99. (defvar before-init-hook nil
  100.   "Functions to call after handling urgent options but before init files.
  101. The frame system uses this to open frames to display messages while
  102. Emacs loads the user's initialization file.")
  103.  
  104. (defvar after-init-hook nil
  105.   "Functions to call after loading the init file (`~/.emacs').
  106. The call is not protected by a condition-case, so you can set `debug-on-error'
  107. in `.emacs', and put all the actual code on `after-init-hook'.")
  108.  
  109. (defvar term-setup-hook nil
  110.   "Functions to be called after loading terminal-specific Lisp code.
  111. See `run-hooks'.  This variable exists for users to set,
  112. so as to override the definitions made by the terminal-specific file.
  113. Emacs never sets this variable itself.")
  114.  
  115. (defvar keyboard-type nil
  116.   "The brand of keyboard you are using.
  117. This variable is used to define
  118. the proper function and keypad keys for use under X.  It is used in a
  119. fashion analogous to the environment value TERM.")
  120.  
  121. (defvar window-setup-hook nil
  122.   "Normal hook run to initialize window system display.
  123. Emacs runs this hook after processing the command line arguments and loading
  124. the user's init file.")
  125.  
  126. (defconst initial-major-mode 'lisp-interaction-mode
  127.   "Major mode command symbol to use for the initial *scratch* buffer.")
  128.  
  129. (defvar init-file-user nil
  130.   "Identity of user whose `.emacs' file is or was read.
  131. The value is nil if no init file is being used; otherwise, it may be either
  132. the null string, meaning that the init file was taken from the user that
  133. originally logged in, or it may be a string containing a user's name.
  134.  
  135. In either of the latter cases, `(concat \"~\" init-file-user \"/\")'
  136. evaluates to the name of the directory where the `.emacs' file was
  137. looked for.")
  138.  
  139. (defvar site-run-file "site-start"
  140.   "File containing site-wide run-time initializations.
  141. This file is loaded at run-time before `~/.emacs'.  It contains inits
  142. that need to be in place for the entire site, but which, due to their
  143. higher incidence of change, don't make sense to load into emacs'
  144. dumped image.  Thus, the run-time load order is: 1. file described in
  145. this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.")
  146.  
  147. (defconst iso-8859-1-locale-regexp "8859[-_]?1"
  148.   "Regexp that specifies when to enable the ISO 8859-1 character set.
  149. We do that if this regexp matches the locale name
  150. specified by the LC_ALL, LC_CTYPE and LANG environment variables.")
  151.  
  152. (defvar user-mail-address nil
  153.   "Full mailing address of this user.")
  154.  
  155. (defvar init-file-debug nil)
  156.  
  157. (defvar init-file-had-error nil)
  158.  
  159. (defun normal-top-level ()
  160.   (if command-line-processed
  161.       (message "Back to top level.")
  162.     (setq command-line-processed t)
  163.     (if (not (eq system-type 'vax-vms))
  164.     (progn
  165.       ;; If the PWD environment variable isn't accurate, delete it.
  166.       (let ((pwd (getenv "PWD")))
  167.         (and (stringp pwd)
  168.          ;; Use FOO/., so that if FOO is a symlink, file-attributes
  169.          ;; describes the directory linked to, not FOO itself.
  170.          (or (equal (file-attributes
  171.                  (concat (file-name-as-directory pwd) "."))
  172.                 (file-attributes
  173.                  (concat (file-name-as-directory default-directory)
  174.                      ".")))
  175.              (setq process-environment
  176.                (delete (concat "PWD=" pwd)
  177.                    process-environment)))))))
  178.     (setq default-directory (abbreviate-file-name default-directory))
  179.     (setq user-mail-address (concat (user-login-name) "@" (system-name)))
  180.     (let ((menubar-bindings-done nil))
  181.       (unwind-protect
  182.       (command-line)
  183.     ;; Do this again, in case .emacs defined more abbreviations.
  184.     (setq default-directory (abbreviate-file-name default-directory))
  185.     (run-hooks 'emacs-startup-hook)
  186.     (and term-setup-hook
  187.          (run-hooks 'term-setup-hook))
  188.     ;; Modify the initial frame based on what .emacs puts into
  189.     ;; ...-frame-alist.
  190.     (if (fboundp 'frame-notice-user-settings)
  191.         (frame-notice-user-settings))
  192.     ;; Now we know the user's default font, so add it to the menu.
  193.     (if (fboundp 'font-menu-add-default)
  194.         (font-menu-add-default))
  195.     (and window-setup-hook
  196.          (run-hooks 'window-setup-hook))
  197.     (or menubar-bindings-done
  198.         (precompute-menubar-bindings))))))
  199.  
  200. ;; Precompute the keyboard equivalents in the menu bar items.
  201. (defun precompute-menubar-bindings ()
  202.   (if (eq window-system 'x)
  203.       (let ((submap (lookup-key global-map [menu-bar])))
  204.     (while submap
  205.       (and (consp (car submap))
  206.            (symbolp (car (car submap)))
  207.            (stringp (car-safe (cdr (car submap))))
  208.            (keymapp (cdr (cdr (car submap))))
  209.            (x-popup-menu nil (cdr (cdr (car submap)))))
  210.       (setq submap (cdr submap))))))
  211.  
  212. (defun command-line ()
  213.   (setq command-line-default-directory default-directory)
  214.  
  215.   ;; See if we should import version-control from the environment variable.
  216.   (let ((vc (getenv "VERSION_CONTROL")))
  217.     (cond ((eq vc nil))            ;don't do anything if not set
  218.       ((or (string= vc "t")
  219.            (string= vc "numbered"))
  220.        (setq version-control t))
  221.       ((or (string= vc "nil")
  222.            (string= vc "existing"))
  223.        (setq version-control nil))
  224.       ((or (string= vc "never")
  225.            (string= vc "simple"))
  226.        (setq version-control 'never))))
  227.  
  228.   (if (let ((ctype
  229.          ;; Use the first of these three envvars that has a nonempty value.
  230.          (or (let ((string (getenv "LC_ALL")))
  231.            (and (not (equal string "")) string))
  232.          (let ((string (getenv "LC_CTYPE")))
  233.            (and (not (equal string "")) string))
  234.          (let ((string (getenv "LANG")))
  235.            (and (not (equal string "")) string)))))
  236.     (and ctype
  237.          (string-match iso-8859-1-locale-regexp ctype)))
  238.       (progn 
  239.     (standard-display-european t)
  240.     (require 'iso-syntax)))
  241.  
  242.   ;;! This has been commented out; I currently find the behavior when
  243.   ;;! split-window-keep-point is nil disturbing, but if I can get used
  244.   ;;! to it, then it would be better to eliminate the option.
  245.   ;;! ;; Choose a good default value for split-window-keep-point.
  246.   ;;! (setq split-window-keep-point (> baud-rate 2400))
  247.  
  248.   ;; Read window system's init file if using a window system.
  249.   (if (and window-system (not noninteractive))
  250.       (load (concat term-file-prefix
  251.             (symbol-name window-system)
  252.             "-win")
  253.         ;; Every window system should have a startup file;
  254.         ;; barf if we can't find it.
  255.         nil t))
  256.  
  257.   (let ((done nil)
  258.     (args (cdr command-line-args)))
  259.  
  260.     ;; Figure out which user's init file to load,
  261.     ;; either from the environment or from the options.
  262.     (setq init-file-user (if noninteractive nil (user-login-name)))
  263.     ;; If user has not done su, use current $HOME to find .emacs.
  264.     (and init-file-user (string= init-file-user (user-real-login-name))
  265.      (setq init-file-user ""))
  266.  
  267.     ;; Process the command-line args, and delete the arguments
  268.     ;; processed.  This is consistent with the way main in emacs.c
  269.     ;; does things.
  270.     (while (and (not done) args)
  271.       (let ((argi (car args)))
  272.     (cond
  273.      ((or (string-equal argi "-q")
  274.           (string-equal argi "-no-init-file"))
  275.       (setq init-file-user nil
  276.         args (cdr args)))
  277.      ((or (string-equal argi "-u")
  278.           (string-equal argi "-user"))
  279.       (setq args (cdr args)
  280.         init-file-user (car args)
  281.         args (cdr args)))
  282.      ((string-equal argi "-no-site-file")
  283.       (setq site-run-file nil
  284.         args (cdr args)))
  285.      ((string-equal argi "-debug-init")
  286.       (setq init-file-debug t
  287.         args (cdr args)))
  288.      (t (setq done t)))))
  289.     
  290.     ;; Re-attach the program name to the front of the arg list.
  291.     (setcdr command-line-args args))
  292.  
  293.   ;; Under X Windows, this creates the X frame and deletes the terminal frame.
  294.   (if (fboundp 'face-initialize)
  295.       (face-initialize))
  296.   (if (fboundp 'frame-initialize)
  297.       (frame-initialize))
  298.  
  299.   (run-hooks 'before-init-hook)
  300.  
  301.   ;; Run the site-start library if it exists.  The point of this file is
  302.   ;; that it is run before .emacs.  There is no point in doing this after
  303.   ;; .emacs; that is useless.
  304.   (if site-run-file 
  305.       (load site-run-file t t))
  306.  
  307.   ;; Sites should not disable this.  Only individuals should disable
  308.   ;; the startup message.
  309.   (setq inhibit-startup-message nil)
  310.  
  311.   ;; Load that user's init file, or the default one, or none.
  312.   (let (debug-on-error-from-init-file
  313.     debug-on-error-should-be-set
  314.     (debug-on-error-initial
  315.      (if (eq init-file-debug t) 'startup init-file-debug)))
  316.     (let ((debug-on-error debug-on-error-initial)
  317.       ;; This function actually reads the init files.
  318.       (inner
  319.        (function
  320.         (lambda ()
  321.           (if init-file-user
  322.           (progn
  323.             (setq user-init-file 
  324.               (cond 
  325.                ((eq system-type 'ms-dos)
  326.                 (concat "~" init-file-user "/_emacs"))
  327.                ((eq system-type 'vax-vms) 
  328.                 "sys$login:.emacs")
  329.                ((eq system-type 'amigaos) 
  330.                 "s:.emacs")
  331.                (t 
  332.                 (concat "~" init-file-user "/.emacs"))))
  333.             (load user-init-file t t t)
  334.             (or inhibit-default-init
  335.             (let ((inhibit-startup-message nil))
  336.               ;; Users are supposed to be told their rights.
  337.               ;; (Plus how to get help and how to undo.)
  338.               ;; Don't you dare turn this off for anyone
  339.               ;; except yourself.
  340.               (load "default" t t)))))))))
  341.       (if init-file-debug
  342.       ;; Do this without a condition-case if the user wants to debug.
  343.       (funcall inner)
  344.     (condition-case error
  345.         (progn
  346.           (funcall inner)
  347.           (setq init-file-had-error nil))
  348.       (error (message "Error in init file: %s%s%s"
  349.               (get (car error) 'error-message)
  350.               (if (cdr error) ": " "")
  351.               (mapconcat 'prin1-to-string (cdr error) ", "))
  352.          (setq init-file-had-error t))))
  353.       ;; If we can tell that the init file altered debug-on-error,
  354.       ;; arrange to preserve the value that it set up.
  355.       (or (eq debug-on-error debug-on-error-initial)
  356.       (setq debug-on-error-should-be-set t
  357.         debug-on-error-from-init-file debug-on-error)))
  358.     (if debug-on-error-should-be-set
  359.     (setq debug-on-error debug-on-error-from-init-file)))
  360.  
  361.   (run-hooks 'after-init-hook)
  362.  
  363.   ;; If *scratch* exists and init file didn't change its mode, initialize it.
  364.   (if (get-buffer "*scratch*")
  365.       (save-excursion
  366.     (set-buffer "*scratch*")
  367.     (if (eq major-mode 'fundamental-mode)
  368.         (funcall initial-major-mode))))
  369.   ;; On Amiga, initialise clipboard CHFIXME
  370. ;  (if (eq system-type 'amigaos)
  371. ;      (let ((clip (safe-amiga-paste)))
  372. ;    (if clip (kill-add clip))))
  373.   ;; Load library for our terminal type.
  374.   ;; User init file can set term-file-prefix to nil to prevent this.
  375.   (and term-file-prefix (not noninteractive) (not window-system)
  376.        (let ((term (getenv "TERM"))
  377.          hyphend)
  378.      (while (and term
  379.              (not (load (concat term-file-prefix term) t t)))
  380.        ;; Strip off last hyphen and what follows, then try again
  381.        (if (setq hyphend (string-match "[-_][^-_]+$" term))
  382.            (setq term (substring term 0 hyphend))
  383.          (setq term nil)))))
  384.  
  385.   ;; Process the remaining args.
  386.   (command-line-1 (cdr command-line-args))
  387.  
  388.   ;; If -batch, terminate after processing the command options.
  389.   (if noninteractive (kill-emacs t)))
  390.  
  391. (defun command-line-1 (command-line-args-left)
  392.   (or noninteractive (input-pending-p) init-file-had-error
  393.       (and inhibit-startup-echo-area-message
  394.        (let ((buffer (get-buffer-create " *temp*")))
  395.          (prog1
  396.          (condition-case nil
  397.              (save-excursion
  398.                (set-buffer buffer)
  399.                (insert-file-contents user-init-file)
  400.                (re-search-forward
  401.             (concat
  402.              "([ \t\n]*setq[ \t\n]+"
  403.              "inhibit-startup-echo-area-message[ \t\n]+"
  404.              (regexp-quote
  405.               (prin1-to-string
  406.                (if (string= init-file-user "")
  407.                    (user-login-name)
  408.                  init-file-user)))
  409.              "[ \t\n]*)")
  410.             nil t))
  411.            (error nil))
  412.            (kill-buffer buffer))))
  413.       (message (if (eq (key-binding "\C-h\C-p") 'describe-project)
  414.            "For information about the GNU Project and its goals, type C-h C-p."
  415.          (substitute-command-keys
  416.           "For information about the GNU Project and its goals, type \\[describe-project]."))))
  417.   (if (null command-line-args-left)
  418.       (cond ((and (not inhibit-startup-message) (not noninteractive)
  419.           ;; Don't clobber a non-scratch buffer if init file
  420.           ;; has selected it.
  421.           (string= (buffer-name) "*scratch*")
  422.           (not (input-pending-p)))
  423.          ;; If there are no switches to process, we might as well
  424.          ;; run this hook now, and there may be some need to do it
  425.          ;; before doing any output.
  426.          (and term-setup-hook
  427.           (run-hooks 'term-setup-hook))
  428.          ;; Don't let the hook be run twice.
  429.          (setq term-setup-hook nil)
  430.  
  431.          ;; It's important to notice the user settings before we
  432.          ;; display the startup message; otherwise, the settings
  433.          ;; won't take effect until the user gives the first
  434.          ;; keystroke, and that's distracting.
  435.          (if (fboundp 'frame-notice-user-settings)
  436.          (frame-notice-user-settings))
  437.  
  438.          (and window-setup-hook
  439.           (run-hooks 'window-setup-hook))
  440.          (setq window-setup-hook nil)
  441.          ;; Do this now to avoid an annoying delay if the user
  442.          ;; clicks the menu bar during the sit-for.
  443.          (precompute-menubar-bindings)
  444.          (setq menubar-bindings-done t)
  445.          (unwind-protect
  446.          (progn
  447.            (insert (emacs-version)
  448.                "
  449. Copyright (C) 1994 Free Software Foundation, Inc.\n\n")
  450.            ;; If keys have their default meanings,
  451.            ;; use precomputed string to save lots of time.
  452.            (if (and (eq (key-binding "\C-h") 'help-command)
  453.                 (eq (key-binding "\C-xu") 'advertised-undo)
  454.                 (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
  455.                 (eq (key-binding "\C-h\C-c") 'describe-copying)
  456.                 (eq (key-binding "\C-h\C-d") 'describe-distribution)
  457.                 (eq (key-binding "\C-h\C-w") 'describe-no-warranty)
  458.                 (eq (key-binding "\C-ht") 'help-with-tutorial))
  459.                (insert 
  460.        "Type C-h for help; C-x u to undo changes.  (`C-' means use CTRL key.)
  461. To kill the Emacs job, type C-x C-c.
  462. Type C-h t for a tutorial on using Emacs.
  463. Type C-h i to enter Info, which you can use to read GNU documentation.
  464.  
  465. GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
  466. You may give out copies of Emacs; type C-h C-c to see the conditions.
  467. Type C-h C-d for information on getting the latest version.")
  468.              (insert (substitute-command-keys
  469.        "Type \\[help-command] for help; \\[advertised-undo] to undo changes.  (`C-' means use CTRL key.)
  470. To kill the Emacs job, type \\[save-buffers-kill-emacs].
  471. Type \\[help-with-tutorial] for a tutorial on using Emacs.
  472. Type \\[info] to enter Info, which you can use to read GNU documentation.
  473.  
  474. GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
  475. You may give out copies of Emacs; type \\[describe-copying] to see the conditions.
  476. Type \\[describe-distribution] for information on getting the latest version.")))
  477.            (set-buffer-modified-p nil)
  478.            (sit-for 120))
  479.            (save-excursion
  480.          ;; In case the Emacs server has already selected
  481.          ;; another buffer, erase the one our message is in.
  482.          (set-buffer (get-buffer "*scratch*"))
  483.          (erase-buffer)
  484.          (set-buffer-modified-p nil)))))
  485.     (let ((dir command-line-default-directory)
  486.       (file-count 0)
  487.       first-file-buffer
  488.       (line 0))
  489.       (while command-line-args-left
  490.     (let ((argi (car command-line-args-left))
  491.           tem)
  492.       (setq command-line-args-left (cdr command-line-args-left))
  493.       (cond ((setq tem (assoc argi command-switch-alist))
  494.          (funcall (cdr tem) argi))
  495.         ((or (string-equal argi "-f")  ;what the manual claims
  496.              (string-equal argi "-funcall")
  497.              (string-equal argi "-e")) ; what the source used to say
  498.          (setq tem (intern (car command-line-args-left)))
  499.          (setq command-line-args-left (cdr command-line-args-left))
  500.          (funcall tem))
  501.         ((or (string-equal argi "-l")
  502.              (string-equal argi "-load"))
  503.          (let ((file (car command-line-args-left)))
  504.            ;; Take file from default dir if it exists there;
  505.            ;; otherwise let `load' search for it.
  506.            (if (file-exists-p (expand-file-name file))
  507.                (setq file (expand-file-name file)))
  508.            (load file nil t))
  509.          (setq command-line-args-left (cdr command-line-args-left)))
  510.         ((string-equal argi "-insert")
  511.          (or (stringp (car command-line-args-left))
  512.              (error "filename omitted from `-insert' option"))
  513.          (insert-file-contents (car command-line-args-left))
  514.          (setq command-line-args-left (cdr command-line-args-left)))
  515.         ((string-equal argi "-kill")
  516.          (kill-emacs t))
  517.         ((string-match "^\\+[0-9]+\\'" argi)
  518.          (setq line (string-to-int argi)))
  519.         (t
  520.          ;; We have almost exhausted our options. See if the
  521.          ;; user has made any other command-line options available
  522.          (let ((hooks command-line-functions);; lrs 7/31/89
  523.                (did-hook nil))
  524.            (while (and hooks
  525.                    (not (setq did-hook (funcall (car hooks)))))
  526.              (setq hooks (cdr hooks)))
  527.            (if (not did-hook)
  528.                ;; Ok, presume that the argument is a file name
  529.                (progn
  530.              (setq file-count (1+ file-count))
  531.              (cond ((= file-count 1)
  532.                 (setq first-file-buffer
  533.                       (find-file (expand-file-name argi dir))))
  534.                    (t
  535.                 (find-file-other-window (expand-file-name argi dir))))
  536.              (or (zerop line)
  537.                  (goto-line line))
  538.              (setq line 0))))))))
  539.       ;; If 3 or more files visited, and not all visible,
  540.       ;; show user what they all are.
  541.       (if (> file-count 2)
  542.       (or (get-buffer-window first-file-buffer)
  543.           (progn (other-window 1)
  544.              (buffer-menu)))))))
  545.  
  546. ;;; startup.el ends here
  547.