diff options
| author | Juri Linkov | 2007-08-19 14:43:35 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-08-19 14:43:35 +0000 |
| commit | aeb6faecc732ff700502e049710a992065c2fb46 (patch) | |
| tree | a07698e985fc32f7baf6d77a8ca84cafbfee3aca | |
| parent | 69441214fa14492b0e3f65ae0c85fb5315f39411 (diff) | |
| download | emacs-aeb6faecc732ff700502e049710a992065c2fb46.tar.gz emacs-aeb6faecc732ff700502e049710a992065c2fb46.zip | |
(splash-screen-keymap): Rename from `fancy-splash-keymap'
because it's common to both types of splash screen: fancy and normal.
Bind SPC to scroll-up, DEL to scroll-down and `q' to exit-splash-screen.
(exit-splash-screen): Rename from `fancy-splash-quit'.
Use `quit-window' instead of `kill-buffer'.
(fancy-splash-head): Use make-button to insert GNU image link.
(fancy-splash-screens, normal-splash-screen): Rename " About GNU
Emacs" to "*About GNU Emacs*", and " GNU Emacs" to "*GNU Emacs*".
(normal-splash-screen): Put "Browse manuals" on the same line with
"Emacs manual". Remove descriptions from "Useful tasks" and put
all links in two columns on two lines.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/startup.el | 78 |
2 files changed, 50 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d68bfb8584b..a4f9022bf3f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2007-08-19 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * startup.el (splash-screen-keymap): Rename from `fancy-splash-keymap' | ||
| 4 | because it's common to both types of splash screen: fancy and normal. | ||
| 5 | Bind SPC to scroll-up, DEL to scroll-down and `q' to exit-splash-screen. | ||
| 6 | (exit-splash-screen): Rename from `fancy-splash-quit'. | ||
| 7 | Use `quit-window' instead of `kill-buffer'. | ||
| 8 | (fancy-splash-head): Use make-button to insert GNU image link. | ||
| 9 | (fancy-splash-screens, normal-splash-screen): Rename " About GNU | ||
| 10 | Emacs" to "*About GNU Emacs*", and " GNU Emacs" to "*GNU Emacs*". | ||
| 11 | (normal-splash-screen): Put "Browse manuals" on the same line with | ||
| 12 | "Emacs manual". Remove descriptions from "Useful tasks" and put | ||
| 13 | all links in two columns on two lines. | ||
| 14 | |||
| 1 | 2007-08-19 Michael Kifer <kifer@cs.stonybrook.edu> | 15 | 2007-08-19 Michael Kifer <kifer@cs.stonybrook.edu> |
| 2 | 16 | ||
| 3 | * viper.el (viper-remove-hooks): remove some additional viper hooks | 17 | * viper.el (viper-remove-hooks): remove some additional viper hooks |
diff --git a/lisp/startup.el b/lisp/startup.el index a2a181d4dcb..464666b4254 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1244,13 +1244,13 @@ Values less than twice `fancy-splash-delay' are ignored." | |||
| 1244 | (file :tag "File"))) | 1244 | (file :tag "File"))) |
| 1245 | 1245 | ||
| 1246 | 1246 | ||
| 1247 | (defvar fancy-splash-keymap | 1247 | (defvar splash-screen-keymap |
| 1248 | (let ((map (make-sparse-keymap))) | 1248 | (let ((map (make-sparse-keymap))) |
| 1249 | (suppress-keymap map) | 1249 | (suppress-keymap map) |
| 1250 | (set-keymap-parent map button-buffer-map) | 1250 | (set-keymap-parent map button-buffer-map) |
| 1251 | 1251 | (define-key map "\C-?" 'scroll-down) | |
| 1252 | (define-key map " " 'fancy-splash-quit) | 1252 | (define-key map " " 'scroll-up) |
| 1253 | (define-key map "q" 'fancy-splash-quit) | 1253 | (define-key map "q" 'exit-splash-screen) |
| 1254 | map) | 1254 | map) |
| 1255 | "Keymap for splash screen buffer.") | 1255 | "Keymap for splash screen buffer.") |
| 1256 | 1256 | ||
| @@ -1313,18 +1313,12 @@ where FACE is a valid face specification, as it can be used with | |||
| 1313 | (eq (frame-parameter nil 'background-mode) 'dark)) | 1313 | (eq (frame-parameter nil 'background-mode) 'dark)) |
| 1314 | (setq img (append img '(:color-symbols (("#000000" . "gray30")))))) | 1314 | (setq img (append img '(:color-symbols (("#000000" . "gray30")))))) |
| 1315 | 1315 | ||
| 1316 | ;; Insert the image with a help-echo and a keymap. | 1316 | ;; Insert the image with a help-echo and a link. |
| 1317 | (let ((map (make-sparse-keymap)) | 1317 | (make-button (prog1 (point) (insert-image img)) (point) |
| 1318 | (help-echo "mouse-2: browse http://www.gnu.org/")) | 1318 | 'face 'default |
| 1319 | (define-key map [mouse-2] | 1319 | 'help-echo "mouse-2: browse http://www.gnu.org/" |
| 1320 | (lambda () | 1320 | 'action (lambda (button) (browse-url "http://www.gnu.org/")) |
| 1321 | (interactive) | 1321 | 'follow-link t) |
| 1322 | (browse-url "http://www.gnu.org/") | ||
| 1323 | (throw 'exit nil))) | ||
| 1324 | (define-key map [down-mouse-2] 'ignore) | ||
| 1325 | (define-key map [up-mouse-2] 'ignore) | ||
| 1326 | (insert-image img (propertize "[image]" 'help-echo help-echo | ||
| 1327 | 'keymap map))) | ||
| 1328 | (insert "\n")))) | 1322 | (insert "\n")))) |
| 1329 | (fancy-splash-insert | 1323 | (fancy-splash-insert |
| 1330 | :face '(variable-pitch :foreground "red") | 1324 | :face '(variable-pitch :foreground "red") |
| @@ -1408,12 +1402,12 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1408 | (force-mode-line-update) | 1402 | (force-mode-line-update) |
| 1409 | (setq fancy-current-text (cdr fancy-current-text)))) | 1403 | (setq fancy-current-text (cdr fancy-current-text)))) |
| 1410 | 1404 | ||
| 1411 | (defun fancy-splash-quit () | 1405 | (defun exit-splash-screen () |
| 1412 | "Stop displaying the splash screen buffer." | 1406 | "Stop displaying the splash screen buffer." |
| 1413 | (interactive) | 1407 | (interactive) |
| 1414 | (if fancy-splash-outer-buffer | 1408 | (if fancy-splash-outer-buffer |
| 1415 | (throw 'exit nil) | 1409 | (throw 'exit nil) |
| 1416 | (kill-buffer (current-buffer)))) | 1410 | (quit-window t))) |
| 1417 | 1411 | ||
| 1418 | (defun fancy-splash-screens (&optional static) | 1412 | (defun fancy-splash-screens (&optional static) |
| 1419 | "Display fancy splash screens when Emacs starts." | 1413 | "Display fancy splash screens when Emacs starts." |
| @@ -1425,7 +1419,7 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1425 | timer) | 1419 | timer) |
| 1426 | (save-selected-window | 1420 | (save-selected-window |
| 1427 | (select-frame frame) | 1421 | (select-frame frame) |
| 1428 | (switch-to-buffer " About GNU Emacs") | 1422 | (switch-to-buffer "*About GNU Emacs*") |
| 1429 | (make-local-variable 'cursor-type) | 1423 | (make-local-variable 'cursor-type) |
| 1430 | (setq splash-buffer (current-buffer)) | 1424 | (setq splash-buffer (current-buffer)) |
| 1431 | (catch 'stop-splashing | 1425 | (catch 'stop-splashing |
| @@ -1440,7 +1434,7 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1440 | timer (run-with-timer 0 fancy-splash-delay | 1434 | timer (run-with-timer 0 fancy-splash-delay |
| 1441 | #'fancy-splash-screens-1 | 1435 | #'fancy-splash-screens-1 |
| 1442 | splash-buffer)) | 1436 | splash-buffer)) |
| 1443 | (use-local-map fancy-splash-keymap) | 1437 | (use-local-map splash-screen-keymap) |
| 1444 | (message "%s" (startup-echo-area-message)) | 1438 | (message "%s" (startup-echo-area-message)) |
| 1445 | (setq buffer-read-only t) | 1439 | (setq buffer-read-only t) |
| 1446 | (recursive-edit)) | 1440 | (recursive-edit)) |
| @@ -1451,7 +1445,7 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1451 | (if (or (window-minibuffer-p) | 1445 | (if (or (window-minibuffer-p) |
| 1452 | (window-dedicated-p (selected-window))) | 1446 | (window-dedicated-p (selected-window))) |
| 1453 | (pop-to-buffer (current-buffer)) | 1447 | (pop-to-buffer (current-buffer)) |
| 1454 | (switch-to-buffer " GNU Emacs")) | 1448 | (switch-to-buffer "*GNU Emacs*")) |
| 1455 | (setq buffer-read-only nil) | 1449 | (setq buffer-read-only nil) |
| 1456 | (erase-buffer) | 1450 | (erase-buffer) |
| 1457 | (if pure-space-overflow | 1451 | (if pure-space-overflow |
| @@ -1467,7 +1461,7 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1467 | (delete-region (point) (point-max)) | 1461 | (delete-region (point) (point-max)) |
| 1468 | (insert "\n") | 1462 | (insert "\n") |
| 1469 | (fancy-splash-tail) | 1463 | (fancy-splash-tail) |
| 1470 | (use-local-map fancy-splash-keymap) | 1464 | (use-local-map splash-screen-keymap) |
| 1471 | (set-buffer-modified-p nil) | 1465 | (set-buffer-modified-p nil) |
| 1472 | (setq buffer-read-only t) | 1466 | (setq buffer-read-only t) |
| 1473 | (if (and view-read-only (not view-mode)) | 1467 | (if (and view-read-only (not view-mode)) |
| @@ -1510,7 +1504,7 @@ we put it on this frame." | |||
| 1510 | "Display splash screen when Emacs starts." | 1504 | "Display splash screen when Emacs starts." |
| 1511 | (let ((prev-buffer (current-buffer))) | 1505 | (let ((prev-buffer (current-buffer))) |
| 1512 | (unwind-protect | 1506 | (unwind-protect |
| 1513 | (with-current-buffer (get-buffer-create " About GNU Emacs") | 1507 | (with-current-buffer (get-buffer-create "*About GNU Emacs*") |
| 1514 | (setq buffer-read-only nil) | 1508 | (setq buffer-read-only nil) |
| 1515 | (erase-buffer) | 1509 | (erase-buffer) |
| 1516 | (set (make-local-variable 'tab-width) 8) | 1510 | (set (make-local-variable 'tab-width) 8) |
| @@ -1620,18 +1614,16 @@ To quit a partially entered command, type Control-g.\n") | |||
| 1620 | (eq (key-binding "\C-h\C-n") 'view-emacs-news)) | 1614 | (eq (key-binding "\C-h\C-n") 'view-emacs-news)) |
| 1621 | (insert " | 1615 | (insert " |
| 1622 | Get help C-h (Hold down CTRL and press h) | 1616 | Get help C-h (Hold down CTRL and press h) |
| 1623 | Emacs manual C-h r | 1617 | Emacs manual C-h r Browse manuals C-h i |
| 1624 | Emacs tutorial C-h t Undo changes C-x u | 1618 | Emacs tutorial C-h t Undo changes C-x u |
| 1625 | Buy manuals C-h C-m Exit Emacs C-x C-c | 1619 | Buy manuals C-h C-m Exit Emacs C-x C-c") |
| 1626 | Browse manuals C-h i") | ||
| 1627 | 1620 | ||
| 1628 | (insert (substitute-command-keys | 1621 | (insert (substitute-command-keys |
| 1629 | (format "\n | 1622 | (format " |
| 1630 | Get help %s | 1623 | Get help %s |
| 1631 | Emacs manual \\[info-emacs-manual] | 1624 | Emacs manual \\[info-emacs-manual]\tBrowse manuals\t\\[info] |
| 1632 | Emacs tutorial \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo] | 1625 | Emacs tutorial \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo] |
| 1633 | Buy manuals \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-emacs] | 1626 | Buy manuals \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-emacs]" |
| 1634 | Browse manuals \\[info]" | ||
| 1635 | (let ((where (where-is-internal | 1627 | (let ((where (where-is-internal |
| 1636 | 'help-command nil t))) | 1628 | 'help-command nil t))) |
| 1637 | (if where | 1629 | (if where |
| @@ -1652,24 +1644,26 @@ Activate menubar \\[tmm-menubar]"))) | |||
| 1652 | If you have no Meta key, you may instead type ESC followed by the character.)") | 1644 | If you have no Meta key, you may instead type ESC followed by the character.)") |
| 1653 | 1645 | ||
| 1654 | ;; Insert links to useful tasks | 1646 | ;; Insert links to useful tasks |
| 1655 | (insert "\n\nUseful tasks (move point to the link and press RET):\n") | 1647 | (insert "\nUseful tasks:\n") |
| 1648 | |||
| 1656 | (insert-button "Visit New File" | 1649 | (insert-button "Visit New File" |
| 1657 | 'action (lambda (button) (call-interactively 'find-file)) | 1650 | 'action (lambda (button) (call-interactively 'find-file)) |
| 1658 | 'follow-link t) | 1651 | 'follow-link t) |
| 1659 | (insert " Specify a new file's name, to edit the file\n") | 1652 | (insert "\t\t\t") |
| 1660 | (insert-button "Open Home Directory" | 1653 | (insert-button "Open Home Directory" |
| 1661 | 'action (lambda (button) (dired "~")) | 1654 | 'action (lambda (button) (dired "~")) |
| 1662 | 'follow-link t) | 1655 | 'follow-link t) |
| 1663 | (insert " Open your home directory, to operate on its files\n") | 1656 | (insert "\n") |
| 1657 | |||
| 1658 | (insert-button "Customize Startup" | ||
| 1659 | 'action (lambda (button) (customize-group 'initialization)) | ||
| 1660 | 'follow-link t) | ||
| 1661 | (insert "\t\t") | ||
| 1664 | (insert-button "Open *scratch* buffer" | 1662 | (insert-button "Open *scratch* buffer" |
| 1665 | 'action (lambda (button) (switch-to-buffer | 1663 | 'action (lambda (button) (switch-to-buffer |
| 1666 | (get-buffer-create "*scratch*"))) | 1664 | (get-buffer-create "*scratch*"))) |
| 1667 | 'follow-link t) | 1665 | 'follow-link t) |
| 1668 | (insert " Open buffer for notes you don't want to save\n") | 1666 | (insert "\n") |
| 1669 | (insert-button "Customize Startup" | ||
| 1670 | 'action (lambda (button) (customize-group 'initialization)) | ||
| 1671 | 'follow-link t) | ||
| 1672 | (insert " Change initialization settings including this screen\n") | ||
| 1673 | 1667 | ||
| 1674 | (insert "\n" (emacs-version) | 1668 | (insert "\n" (emacs-version) |
| 1675 | "\n" emacs-copyright) | 1669 | "\n" emacs-copyright) |
| @@ -1711,7 +1705,7 @@ Type \\[describe-distribution] for information on getting the latest version.")) | |||
| 1711 | "type Meta-x recover-session RET\nto recover" | 1705 | "type Meta-x recover-session RET\nto recover" |
| 1712 | " the files you were editing.\n")) | 1706 | " the files you were editing.\n")) |
| 1713 | 1707 | ||
| 1714 | (use-local-map button-buffer-map) | 1708 | (use-local-map splash-screen-keymap) |
| 1715 | 1709 | ||
| 1716 | ;; Display the input that we set up in the buffer. | 1710 | ;; Display the input that we set up in the buffer. |
| 1717 | (set-buffer-modified-p nil) | 1711 | (set-buffer-modified-p nil) |
| @@ -1735,9 +1729,9 @@ Type \\[describe-distribution] for information on getting the latest version.")) | |||
| 1735 | (error (pop-to-buffer (current-buffer)))))) | 1729 | (error (pop-to-buffer (current-buffer)))))) |
| 1736 | ;; Unwind ... ensure splash buffer is killed | 1730 | ;; Unwind ... ensure splash buffer is killed |
| 1737 | (if (not static) | 1731 | (if (not static) |
| 1738 | (kill-buffer " About GNU Emacs") | 1732 | (kill-buffer "*About GNU Emacs*") |
| 1739 | (switch-to-buffer " About GNU Emacs") | 1733 | (switch-to-buffer "*About GNU Emacs*") |
| 1740 | (rename-buffer " GNU Emacs" t))))) | 1734 | (rename-buffer "*GNU Emacs*" t))))) |
| 1741 | 1735 | ||
| 1742 | 1736 | ||
| 1743 | (defun startup-echo-area-message () | 1737 | (defun startup-echo-area-message () |