Mercurial > emacs
comparison lisp/startup.el @ 54852:dd005a791c40
(emacs-quick-startup): New defvar (set by -Q).
(command-line): New option -Q. Like -q --no-site-file, but
in addition it also disables menu-bar, tool-bar, scroll-bars,
tool-tips, and the blinking cursor.
(command-line-1): Skip startup screen if -Q.
(fancy-splash-head): Use :align-to center prop to center splash image.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Tue, 13 Apr 2004 22:20:04 +0000 |
parents | d115cf4b7731 |
children | 6fe3d9ff80b9 0643dc72a250 |
comparison
equal
deleted
inserted
replaced
54851:99eea8becc4f | 54852:dd005a791c40 |
---|---|
264 Set this to nil if you want to prevent `auto-save-list-file-name' | 264 Set this to nil if you want to prevent `auto-save-list-file-name' |
265 from being initialized." | 265 from being initialized." |
266 :type '(choice (const :tag "Don't record a session's auto save list" nil) | 266 :type '(choice (const :tag "Don't record a session's auto save list" nil) |
267 string) | 267 string) |
268 :group 'auto-save) | 268 :group 'auto-save) |
269 | |
270 (defvar emacs-quick-startup nil) | |
269 | 271 |
270 (defvar init-file-debug nil) | 272 (defvar init-file-debug nil) |
271 | 273 |
272 (defvar init-file-had-error nil) | 274 (defvar init-file-had-error nil) |
273 | 275 |
683 (error "Option `%s' is ambiguous" argi)) | 685 (error "Option `%s' is ambiguous" argi)) |
684 (setq argi (substring (car elt) 1))) | 686 (setq argi (substring (car elt) 1))) |
685 (setq argval nil | 687 (setq argval nil |
686 argi orig-argi))))) | 688 argi orig-argi))))) |
687 (cond | 689 (cond |
690 ((equal argi "-Q") | |
691 (setq init-file-user nil | |
692 site-run-file nil | |
693 emacs-quick-startup t) | |
694 (push '(vertical-scroll-bars . nil) initial-frame-alist)) | |
688 ((member argi '("-q" "-no-init-file")) | 695 ((member argi '("-q" "-no-init-file")) |
689 (setq init-file-user nil)) | 696 (setq init-file-user nil)) |
690 ((member argi '("-u" "-user")) | 697 ((member argi '("-u" "-user")) |
691 (setq init-file-user (or argval (pop args)) | 698 (setq init-file-user (or argval (pop args)) |
692 argval nil)) | 699 argval nil)) |
714 (when (fboundp 'frame-initialize) | 721 (when (fboundp 'frame-initialize) |
715 (frame-initialize)) | 722 (frame-initialize)) |
716 | 723 |
717 ;; If frame was created with a menu bar, set menu-bar-mode on. | 724 ;; If frame was created with a menu bar, set menu-bar-mode on. |
718 (unless (or noninteractive | 725 (unless (or noninteractive |
726 emacs-quick-startup | |
719 (and (memq window-system '(x w32)) | 727 (and (memq window-system '(x w32)) |
720 (<= (frame-parameter nil 'menu-bar-lines) 0))) | 728 (<= (frame-parameter nil 'menu-bar-lines) 0))) |
721 (menu-bar-mode 1)) | 729 (menu-bar-mode 1)) |
722 | 730 |
723 ;; If frame was created with a tool bar, switch tool-bar-mode on. | 731 ;; If frame was created with a tool bar, switch tool-bar-mode on. |
724 (unless (or noninteractive | 732 (unless (or noninteractive |
733 emacs-quick-startup | |
725 (not (display-graphic-p)) | 734 (not (display-graphic-p)) |
726 (<= (frame-parameter nil 'tool-bar-lines) 0)) | 735 (<= (frame-parameter nil 'tool-bar-lines) 0)) |
727 (tool-bar-mode 1)) | 736 (tool-bar-mode 1)) |
728 | 737 |
729 ;; Can't do this init in defcustom because window-system isn't set. | 738 ;; Can't do this init in defcustom because window-system isn't set. |
730 (unless (or noninteractive | 739 (unless (or noninteractive |
740 emacs-quick-startup | |
731 (eq system-type 'ms-dos) | 741 (eq system-type 'ms-dos) |
732 (not (memq window-system '(x w32)))) | 742 (not (memq window-system '(x w32)))) |
733 (setq-default blink-cursor t) | 743 (setq-default blink-cursor t) |
734 (blink-cursor-mode 1)) | 744 (blink-cursor-mode 1)) |
735 | 745 |
747 (eq tty-erase-char 8))) | 757 (eq tty-erase-char 8))) |
748 (setq-default normal-erase-is-backspace t) | 758 (setq-default normal-erase-is-backspace t) |
749 (normal-erase-is-backspace-mode 1))) | 759 (normal-erase-is-backspace-mode 1))) |
750 | 760 |
751 (unless (or noninteractive | 761 (unless (or noninteractive |
762 emacs-quick-startup | |
752 (not (display-graphic-p)) | 763 (not (display-graphic-p)) |
753 (not (fboundp 'x-show-tip))) | 764 (not (fboundp 'x-show-tip))) |
754 (setq-default tooltip-mode t) | 765 (setq-default tooltip-mode t) |
755 (tooltip-mode 1)) | 766 (tooltip-mode 1)) |
756 | 767 |
1100 (image-width (and img (car (image-size img)))) | 1111 (image-width (and img (car (image-size img)))) |
1101 (window-width (window-width (selected-window)))) | 1112 (window-width (window-width (selected-window)))) |
1102 (when img | 1113 (when img |
1103 (when (> window-width image-width) | 1114 (when (> window-width image-width) |
1104 ;; Center the image in the window. | 1115 ;; Center the image in the window. |
1105 (let ((pos (/ (- window-width image-width) 2))) | 1116 (insert (propertize " " 'display |
1106 (insert (propertize " " 'display `(space :align-to ,pos)))) | 1117 `(space :align-to (+ center (-0.5 . ,img))))) |
1107 | 1118 |
1108 ;; Change the color of the XPM version of the splash image | 1119 ;; Change the color of the XPM version of the splash image |
1109 ;; so that it is visible with a dark frame background. | 1120 ;; so that it is visible with a dark frame background. |
1110 (when (and (memq 'xpm img) | 1121 (when (and (memq 'xpm img) |
1111 (eq (frame-parameter nil 'background-mode) 'dark)) | 1122 (eq (frame-parameter nil 'background-mode) 'dark)) |
1650 (not inhibit-startup-buffer-menu) | 1661 (not inhibit-startup-buffer-menu) |
1651 (or (get-buffer-window first-file-buffer) | 1662 (or (get-buffer-window first-file-buffer) |
1652 (list-buffers))))) | 1663 (list-buffers))))) |
1653 | 1664 |
1654 ;; Maybe display a startup screen. | 1665 ;; Maybe display a startup screen. |
1655 (when (and (not inhibit-startup-message) (not noninteractive) | 1666 (unless (or inhibit-startup-message |
1667 noninteractive | |
1668 emacs-quick-startup | |
1656 ;; Don't display startup screen if init file | 1669 ;; Don't display startup screen if init file |
1657 ;; has started some sort of server. | 1670 ;; has started some sort of server. |
1658 (not (and (fboundp 'process-list) | 1671 (and (fboundp 'process-list) |
1659 (process-list)))) | 1672 (process-list))) |
1660 ;; Display a startup screen, after some preparations. | 1673 ;; Display a startup screen, after some preparations. |
1661 | 1674 |
1662 ;; If there are no switches to process, we might as well | 1675 ;; If there are no switches to process, we might as well |
1663 ;; run this hook now, and there may be some need to do it | 1676 ;; run this hook now, and there may be some need to do it |
1664 ;; before doing any output. | 1677 ;; before doing any output. |