comparison lisp/startup.el @ 91053:a0e466c4d599

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 887-889) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 116-121) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-268
author Miles Bader <miles@gnu.org>
date Mon, 15 Oct 2007 05:03:21 +0000
parents d38543a1c0f9 50e4a0be4dcb
children 4bc33ffdda1a
comparison
equal deleted inserted replaced
91052:72adb6e72b67 91053:a0e466c4d599
1450 " the files you were editing.")) 1450 " the files you were editing."))
1451 1451
1452 (when concise 1452 (when concise
1453 (fancy-splash-insert 1453 (fancy-splash-insert
1454 :face 'variable-pitch "\n" 1454 :face 'variable-pitch "\n"
1455 :link '("Dismiss" (lambda (button) 1455 :link '("Dismiss this startup screen"
1456 (when startup-screen-inhibit-startup-screen 1456 (lambda (button)
1457 (customize-set-variable 'inhibit-startup-screen t) 1457 (when startup-screen-inhibit-startup-screen
1458 (customize-mark-to-save 'inhibit-startup-screen) 1458 (customize-set-variable 'inhibit-startup-screen t)
1459 (custom-save-all)) 1459 (customize-mark-to-save 'inhibit-startup-screen)
1460 (let ((w (get-buffer-window "*GNU Emacs*"))) 1460 (custom-save-all))
1461 (and w (not (one-window-p)) (delete-window w))) 1461 (let ((w (get-buffer-window "*GNU Emacs*")))
1462 (kill-buffer "*GNU Emacs*"))) 1462 (and w (not (one-window-p)) (delete-window w)))
1463 (kill-buffer "*GNU Emacs*")))
1463 " ") 1464 " ")
1464 (when (or user-init-file custom-file) 1465 (when (or user-init-file custom-file)
1465 (let ((checked (create-image "\300\300\141\143\067\076\034\030" 1466 (let ((checked (create-image "\300\300\141\143\067\076\034\030"
1466 'xbm t :width 8 :height 8 :background "grey75" 1467 'xbm t :width 8 :height 8 :background "grey75"
1467 :foreground "black" :relief -2 :ascent 'center)) 1468 :foreground "black" :relief -2 :ascent 'center))
1478 (setq startup-screen-inhibit-startup-screen nil)) 1479 (setq startup-screen-inhibit-startup-screen nil))
1479 (overlay-put button 'checked t) 1480 (overlay-put button 'checked t)
1480 (overlay-put button 'display (overlay-get button :on-glyph)) 1481 (overlay-put button 'display (overlay-get button :on-glyph))
1481 (setq startup-screen-inhibit-startup-screen t))))) 1482 (setq startup-screen-inhibit-startup-screen t)))))
1482 (fancy-splash-insert :face '(variable-pitch :height 0.9) 1483 (fancy-splash-insert :face '(variable-pitch :height 0.9)
1483 " Don't show this message again."))))) 1484 " Never show it again.")))))
1484 1485
1485 (defun exit-splash-screen () 1486 (defun exit-splash-screen ()
1486 "Stop displaying the splash screen buffer." 1487 "Stop displaying the splash screen buffer."
1487 (interactive) 1488 (interactive)
1488 (quit-window t)) 1489 (quit-window t))
1490 (defun fancy-startup-screen (&optional concise) 1491 (defun fancy-startup-screen (&optional concise)
1491 "Display fancy startup screen. 1492 "Display fancy startup screen.
1492 If CONCISE is non-nil, display a concise version of the 1493 If CONCISE is non-nil, display a concise version of the
1493 splash screen in another window." 1494 splash screen in another window."
1494 (let ((splash-buffer (get-buffer-create "*GNU Emacs*"))) 1495 (let ((splash-buffer (get-buffer-create "*GNU Emacs*")))
1495 (with-current-buffer splash-buffer 1496 (with-current-buffer splash-buffer
1496 (let ((inhibit-read-only t)) 1497 (let ((inhibit-read-only t))
1497 (erase-buffer) 1498 (erase-buffer)
1498 (make-local-variable 'startup-screen-inhibit-startup-screen) 1499 (make-local-variable 'startup-screen-inhibit-startup-screen)
1499 (if pure-space-overflow 1500 (if pure-space-overflow
1500 (insert pure-space-overflow-message)) 1501 (insert pure-space-overflow-message))
1511 (setq tab-width 22 1512 (setq tab-width 22
1512 buffer-read-only t) 1513 buffer-read-only t)
1513 (set-buffer-modified-p nil) 1514 (set-buffer-modified-p nil)
1514 (if (and view-read-only (not view-mode)) 1515 (if (and view-read-only (not view-mode))
1515 (view-mode-enter nil 'kill-buffer)) 1516 (view-mode-enter nil 'kill-buffer))
1516 (goto-char (point-max))) 1517 (goto-char (point-min))
1518 (forward-line (if concise 2 4)))
1517 (if concise 1519 (if concise
1518 (progn 1520 (progn
1519 (display-buffer splash-buffer) 1521 (display-buffer splash-buffer)
1520 ;; If the splash screen is in a split window, fit it. 1522 ;; If the splash screen is in a split window, fit it.
1521 (let ((window (get-buffer-window splash-buffer t))) 1523 (let ((window (get-buffer-window splash-buffer t)))
1549 (force-mode-line-update)) 1551 (force-mode-line-update))
1550 (use-local-map splash-screen-keymap) 1552 (use-local-map splash-screen-keymap)
1551 (setq tab-width 22) 1553 (setq tab-width 22)
1552 (message "%s" (startup-echo-area-message)) 1554 (message "%s" (startup-echo-area-message))
1553 (setq buffer-read-only t) 1555 (setq buffer-read-only t)
1554 (goto-char (point-min))))) 1556 (goto-char (point-min))
1557 (forward-line 3))))
1555 1558
1556 (defun fancy-splash-frame () 1559 (defun fancy-splash-frame ()
1557 "Return the frame to use for the fancy splash screen. 1560 "Return the frame to use for the fancy splash screen.
1558 Returning non-nil does not mean we should necessarily 1561 Returning non-nil does not mean we should necessarily
1559 use the fancy splash screen, but if we do use it, 1562 use the fancy splash screen, but if we do use it,
1656 1659
1657 (defun normal-mouse-startup-screen () 1660 (defun normal-mouse-startup-screen ()
1658 ;; The user can use the mouse to activate menus 1661 ;; The user can use the mouse to activate menus
1659 ;; so give help in terms of menu items. 1662 ;; so give help in terms of menu items.
1660 (insert "\ 1663 (insert "\
1661 You can do basic editing with the menu bar and scroll bar using the mouse. 1664 To follow a link, click Mouse-1 on it, or move to it and type RET.
1662 To quit a partially entered command, type Control-g.\n") 1665 To quit a partially entered command, type Control-g.\n")
1663 1666
1664 (insert "\nImportant Help menu items:\n") 1667 (insert "\nImportant Help menu items:\n")
1665 (insert-button "Emacs Tutorial" 1668 (insert-button "Emacs Tutorial"
1666 'action (lambda (button) (help-with-tutorial)) 1669 'action (lambda (button) (help-with-tutorial))