diff options
| author | Juri Linkov | 2007-08-22 23:45:47 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-08-22 23:45:47 +0000 |
| commit | 875ad194619941fc110d1f6b5e724dc9315a10bd (patch) | |
| tree | ac56502a094f7a3b4281084ab912108d9bbbca78 | |
| parent | aa251046dda67e80ae2d08b04cfeff7c993d89cd (diff) | |
| download | emacs-875ad194619941fc110d1f6b5e724dc9315a10bd.tar.gz emacs-875ad194619941fc110d1f6b5e724dc9315a10bd.zip | |
Fix 2007-08-21 merge conflicts.
| -rw-r--r-- | lisp/startup.el | 90 |
1 files changed, 13 insertions, 77 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index b5a5a225739..85c6af601dc 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1370,34 +1370,12 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1370 | (force-mode-line-update) | 1370 | (force-mode-line-update) |
| 1371 | (setq fancy-current-text (cdr fancy-current-text)))) | 1371 | (setq fancy-current-text (cdr fancy-current-text)))) |
| 1372 | 1372 | ||
| 1373 | (defun fancy-splash-default-action () | ||
| 1374 | "Stop displaying the splash screen buffer. | ||
| 1375 | This is an internal function used to turn off the splash screen after | ||
| 1376 | the user caused an input event by hitting a key or clicking with the | ||
| 1377 | mouse." | ||
| 1378 | (interactive) | ||
| 1379 | (if (and (memq 'down (event-modifiers last-command-event)) | ||
| 1380 | (eq (posn-window (event-start last-command-event)) | ||
| 1381 | (selected-window))) | ||
| 1382 | ;; This is a mouse-down event in the splash screen window. | ||
| 1383 | ;; Ignore it and consume the corresponding mouse-up event. | ||
| 1384 | (read-event) | ||
| 1385 | (push last-command-event unread-command-events)) | ||
| 1386 | (throw 'exit nil)) | ||
| 1387 | |||
| 1388 | (defun exit-splash-screen () | 1373 | (defun exit-splash-screen () |
| 1389 | "Exit the splash screen." | 1374 | "Stop displaying the splash screen buffer." |
| 1390 | (if (get-buffer "*About GNU Emacs*") | 1375 | (if (get-buffer "*About GNU Emacs*") |
| 1391 | (throw 'stop-splashing nil) | 1376 | (throw 'stop-splashing nil) |
| 1392 | (quit-window t))) | 1377 | (quit-window t))) |
| 1393 | 1378 | ||
| 1394 | (defun fancy-splash-delete-frame (frame) | ||
| 1395 | "Exit the splash screen after the frame is deleted." | ||
| 1396 | ;; We can not throw from `delete-frame-events', so we set up a timer | ||
| 1397 | ;; to exit the recursive edit as soon as Emacs is idle again. | ||
| 1398 | (if (frame-live-p frame) | ||
| 1399 | (run-at-time 0 nil 'exit-splash-screen))) | ||
| 1400 | |||
| 1401 | (defun fancy-splash-screens (&optional static) | 1379 | (defun fancy-splash-screens (&optional static) |
| 1402 | "Display fancy splash screens when Emacs starts." | 1380 | "Display fancy splash screens when Emacs starts." |
| 1403 | (if (not static) | 1381 | (if (not static) |
| @@ -1413,32 +1391,7 @@ mouse." | |||
| 1413 | (setq splash-buffer (current-buffer)) | 1391 | (setq splash-buffer (current-buffer)) |
| 1414 | (catch 'stop-splashing | 1392 | (catch 'stop-splashing |
| 1415 | (unwind-protect | 1393 | (unwind-protect |
| 1416 | (let* ((map (make-sparse-keymap)) | 1394 | (let ((cursor-type nil)) |
| 1417 | (cursor-type nil) | ||
| 1418 | (overriding-local-map map) | ||
| 1419 | ;; Catch if our frame is deleted; the delete-frame | ||
| 1420 | ;; event is unreliable and is handled by | ||
| 1421 | ;; `special-event-map' anyway. | ||
| 1422 | (delete-frame-functions (cons 'fancy-splash-delete-frame | ||
| 1423 | delete-frame-functions))) | ||
| 1424 | (define-key map [t] 'fancy-splash-default-action) | ||
| 1425 | (define-key map [mouse-movement] 'ignore) | ||
| 1426 | (define-key map [mode-line t] 'ignore) | ||
| 1427 | (define-key map [select-window] 'ignore) | ||
| 1428 | ;; Temporarily bind special events to | ||
| 1429 | ;; fancy-splash-special-event-action so as to stop | ||
| 1430 | ;; displaying splash screens with such events. | ||
| 1431 | ;; Otherwise, drag-n-drop into splash screens may | ||
| 1432 | ;; leave us in recursive editing with invisible | ||
| 1433 | ;; cursors for a while. | ||
| 1434 | (setq special-event-map (make-sparse-keymap)) | ||
| 1435 | (map-keymap | ||
| 1436 | (lambda (key def) | ||
| 1437 | (define-key special-event-map (vector key) | ||
| 1438 | (if (eq def 'ignore) | ||
| 1439 | 'ignore | ||
| 1440 | 'fancy-splash-special-event-action))) | ||
| 1441 | old-special-event-map) | ||
| 1442 | (setq display-hourglass nil | 1395 | (setq display-hourglass nil |
| 1443 | buffer-undo-list t | 1396 | buffer-undo-list t |
| 1444 | mode-line-format (propertize "---- %b %-" | 1397 | mode-line-format (propertize "---- %b %-" |
| @@ -1454,21 +1407,12 @@ mouse." | |||
| 1454 | (setq buffer-read-only t) | 1407 | (setq buffer-read-only t) |
| 1455 | (recursive-edit)) | 1408 | (recursive-edit)) |
| 1456 | (cancel-timer timer) | 1409 | (cancel-timer timer) |
| 1457 | (setq display-hourglass old-hourglass | 1410 | (setq display-hourglass old-hourglass) |
| 1458 | minor-mode-map-alist old-minor-mode-map-alist | ||
| 1459 | emulation-mode-map-alists old-emulation-mode-map-alists | ||
| 1460 | special-event-map old-special-event-map) | ||
| 1461 | (kill-buffer splash-buffer) | 1411 | (kill-buffer splash-buffer) |
| 1462 | (when (frame-live-p frame) | 1412 | (when (frame-live-p frame) |
| 1463 | (select-frame frame) | 1413 | (select-frame frame) |
| 1464 | (switch-to-buffer fancy-splash-outer-buffer)) | 1414 | (switch-to-buffer fancy-splash-outer-buffer)))))) |
| 1465 | (when fancy-splash-last-input-event | 1415 | ;; If static is non-nil, don't show fancy splash screen. |
| 1466 | (setq last-input-event fancy-splash-last-input-event | ||
| 1467 | fancy-splash-last-input-event nil) | ||
| 1468 | (command-execute (lookup-key special-event-map | ||
| 1469 | (vector last-input-event)) | ||
| 1470 | nil (vector last-input-event) t)))))) | ||
| 1471 | ;; If hide-on-input is nil, don't hide the buffer on input. | ||
| 1472 | (if (or (window-minibuffer-p) | 1416 | (if (or (window-minibuffer-p) |
| 1473 | (window-dedicated-p (selected-window))) | 1417 | (window-dedicated-p (selected-window))) |
| 1474 | (pop-to-buffer (current-buffer)) | 1418 | (pop-to-buffer (current-buffer)) |
| @@ -1496,15 +1440,6 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1496 | (view-mode-enter nil 'kill-buffer)) | 1440 | (view-mode-enter nil 'kill-buffer)) |
| 1497 | (goto-char (point-min))))) | 1441 | (goto-char (point-min))))) |
| 1498 | 1442 | ||
| 1499 | (defun fancy-splash-special-event-action () | ||
| 1500 | "Save the last event and stop displaying the splash screen buffer. | ||
| 1501 | This is an internal function used to turn off the splash screen after | ||
| 1502 | the user caused an input event that is bound in `special-event-map'" | ||
| 1503 | (interactive) | ||
| 1504 | (setq fancy-splash-last-input-event last-input-event) | ||
| 1505 | (throw 'exit nil)) | ||
| 1506 | |||
| 1507 | |||
| 1508 | (defun fancy-splash-frame () | 1443 | (defun fancy-splash-frame () |
| 1509 | "Return the frame to use for the fancy splash screen. | 1444 | "Return the frame to use for the fancy splash screen. |
| 1510 | Returning non-nil does not mean we should necessarily | 1445 | Returning non-nil does not mean we should necessarily |
| @@ -1662,8 +1597,7 @@ Get help C-h (Hold down CTRL and press h) | |||
| 1662 | 'follow-link t) | 1597 | 'follow-link t) |
| 1663 | (insert "\t C-h C-m\tExit Emacs\t C-x C-c")) | 1598 | (insert "\t C-h C-m\tExit Emacs\t C-x C-c")) |
| 1664 | 1599 | ||
| 1665 | (insert (substitute-command-keys | 1600 | (insert (format " |
| 1666 | (format "\n | ||
| 1667 | Get help %s | 1601 | Get help %s |
| 1668 | " | 1602 | " |
| 1669 | (let ((where (where-is-internal | 1603 | (let ((where (where-is-internal |
| @@ -1690,7 +1624,7 @@ Get help %s | |||
| 1690 | 'action (lambda (button) (view-order-manuals)) | 1624 | 'action (lambda (button) (view-order-manuals)) |
| 1691 | 'follow-link t) | 1625 | 'follow-link t) |
| 1692 | (insert (substitute-command-keys | 1626 | (insert (substitute-command-keys |
| 1693 | "\t \\[view-order-manuals]\tExit Emacs\t \\[save-buffers-kill-emacs]"))) | 1627 | "\t \\[view-order-manuals]\tExit Emacs\t \\[save-buffers-kill-terminal]"))) |
| 1694 | 1628 | ||
| 1695 | ;; Say how to use the menu bar with the keyboard. | 1629 | ;; Say how to use the menu bar with the keyboard. |
| 1696 | (insert "\n") | 1630 | (insert "\n") |
| @@ -1802,10 +1736,10 @@ Type \\[describe-distribution] for information on ")) | |||
| 1802 | (if (and view-read-only (not view-mode)) | 1736 | (if (and view-read-only (not view-mode)) |
| 1803 | (view-mode-enter nil 'kill-buffer)) | 1737 | (view-mode-enter nil 'kill-buffer)) |
| 1804 | (goto-char (point-min)) | 1738 | (goto-char (point-min)) |
| 1805 | (if hide-on-input | 1739 | (if (not static) |
| 1806 | (if (or (window-minibuffer-p) | 1740 | (if (or (window-minibuffer-p) |
| 1807 | (window-dedicated-p (selected-window))) | 1741 | (window-dedicated-p (selected-window))) |
| 1808 | ;; If hide-on-input is nil, creating a new frame will | 1742 | ;; If static is nil, creating a new frame will |
| 1809 | ;; generate enough events that the subsequent `sit-for' | 1743 | ;; generate enough events that the subsequent `sit-for' |
| 1810 | ;; will immediately return anyway. | 1744 | ;; will immediately return anyway. |
| 1811 | nil ;; (pop-to-buffer (current-buffer)) | 1745 | nil ;; (pop-to-buffer (current-buffer)) |
| @@ -1881,8 +1815,10 @@ With a prefix argument, any user input hides the splash screen." | |||
| 1881 | ;; Prevent recursive calls from server-process-filter. | 1815 | ;; Prevent recursive calls from server-process-filter. |
| 1882 | (if (not (get-buffer "*About GNU Emacs*")) | 1816 | (if (not (get-buffer "*About GNU Emacs*")) |
| 1883 | (if (use-fancy-splash-screens-p) | 1817 | (if (use-fancy-splash-screens-p) |
| 1884 | (fancy-splash-screens hide-on-input) | 1818 | (fancy-splash-screens static) |
| 1885 | (normal-splash-screen hide-on-input)))) | 1819 | (normal-splash-screen static)))) |
| 1820 | |||
| 1821 | (defalias 'about-emacs 'display-splash-screen) | ||
| 1886 | 1822 | ||
| 1887 | (defun command-line-1 (command-line-args-left) | 1823 | (defun command-line-1 (command-line-args-left) |
| 1888 | (display-startup-echo-area-message) | 1824 | (display-startup-echo-area-message) |