1287 |
(> window-height (+ image-height 15))))) |
(> window-height (+ image-height 15))))) |
1288 |
|
|
1289 |
|
|
1290 |
|
(defun normal-splash-screen () |
1291 |
|
"Display splash screen when Emacs starts." |
1292 |
|
(with-current-buffer (get-buffer-create "GNU Emacs") |
1293 |
|
(let ((tab-width 8) |
1294 |
|
(mode-line-format (propertize "---- %b %-" |
1295 |
|
'face '(:weight bold)))) |
1296 |
|
|
1297 |
|
;; The convention for this piece of code is that |
1298 |
|
;; each piece of output starts with one or two newlines |
1299 |
|
;; and does not end with any newlines. |
1300 |
|
(insert "Welcome to GNU Emacs") |
1301 |
|
(if (eq system-type 'gnu/linux) |
1302 |
|
(insert ", one component of a Linux-based GNU system.")) |
1303 |
|
(insert "\n") |
1304 |
|
|
1305 |
|
(unless (equal (buffer-name (current-buffer)) "*scratch*") |
1306 |
|
(insert (substitute-command-keys |
1307 |
|
"\nType \\[recenter] to begin editing your file.\n"))) |
1308 |
|
|
1309 |
|
(if (display-mouse-p) |
1310 |
|
;; The user can use the mouse to activate menus |
1311 |
|
;; so give help in terms of menu items. |
1312 |
|
(progn |
1313 |
|
(insert "\ |
1314 |
|
You can do basic editing with the menu bar and scroll bar using the mouse. |
1315 |
|
|
1316 |
|
Useful File menu items: |
1317 |
|
Exit Emacs (or type Control-x followed by Control-c) |
1318 |
|
Recover Session recover files you were editing before a crash |
1319 |
|
|
1320 |
|
Important Help menu items: |
1321 |
|
Emacs Tutorial Learn-by-doing tutorial for using Emacs efficiently. |
1322 |
|
Emacs FAQ Frequently asked questions and answers |
1323 |
|
\(Non)Warranty GNU Emacs comes with ABSOLUTELY NO WARRANTY |
1324 |
|
Copying Conditions Conditions for redistributing and changing Emacs. |
1325 |
|
Getting New Versions How to obtain the latest version of Emacs. |
1326 |
|
Ordering Manuals How to order manuals from the FSF. |
1327 |
|
") |
1328 |
|
(insert "\n\n" (emacs-version) |
1329 |
|
" |
1330 |
|
Copyright (C) 2001 Free Software Foundation, Inc.")) |
1331 |
|
|
1332 |
|
;; No mouse menus, so give help using kbd commands. |
1333 |
|
|
1334 |
|
;; If keys have their default meanings, |
1335 |
|
;; use precomputed string to save lots of time. |
1336 |
|
(if (and (eq (key-binding "\C-h") 'help-command) |
1337 |
|
(eq (key-binding "\C-xu") 'advertised-undo) |
1338 |
|
(eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs) |
1339 |
|
(eq (key-binding "\C-ht") 'help-with-tutorial) |
1340 |
|
(eq (key-binding "\C-hi") 'info) |
1341 |
|
(eq (key-binding "\C-h\C-n") 'view-emacs-news)) |
1342 |
|
(insert " |
1343 |
|
Get help C-h (Hold down CTRL and press h) |
1344 |
|
Undo changes C-x u Exit Emacs C-x C-c |
1345 |
|
Get a tutorial C-h t Use Info to read docs C-h i |
1346 |
|
Ordering manuals C-h RET") |
1347 |
|
(insert (substitute-command-keys |
1348 |
|
(format "\n |
1349 |
|
Get help %s |
1350 |
|
Undo changes \\[advertised-undo] |
1351 |
|
Exit Emacs \\[save-buffers-kill-emacs] |
1352 |
|
Get a tutorial \\[help-with-tutorial] |
1353 |
|
Use Info to read docs \\[info] |
1354 |
|
Ordering manuals \\[view-order-manuals]" |
1355 |
|
(let ((where (where-is-internal |
1356 |
|
'help-command nil t))) |
1357 |
|
(if where |
1358 |
|
(key-description where) |
1359 |
|
"M-x help")))))) |
1360 |
|
|
1361 |
|
;; Say how to use the menu bar with the keyboard. |
1362 |
|
(if (and (eq (key-binding "\M-`") 'tmm-menubar) |
1363 |
|
(eq (key-binding [f10]) 'tmm-menubar)) |
1364 |
|
(insert " |
1365 |
|
Activate menubar F10 or ESC ` or M-`") |
1366 |
|
(insert (substitute-command-keys " |
1367 |
|
Activate menubar \\[tmm-menubar]"))) |
1368 |
|
|
1369 |
|
;; Many users seem to have problems with these. |
1370 |
|
(insert " |
1371 |
|
\(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key. |
1372 |
|
If you have no Meta key, you may instead type ESC followed by the character.)") |
1373 |
|
|
1374 |
|
(insert "\n\n" (emacs-version) |
1375 |
|
" |
1376 |
|
Copyright (C) 2001 Free Software Foundation, Inc.") |
1377 |
|
|
1378 |
|
(if (and (eq (key-binding "\C-h\C-c") 'describe-copying) |
1379 |
|
(eq (key-binding "\C-h\C-d") 'describe-distribution) |
1380 |
|
(eq (key-binding "\C-h\C-w") 'describe-no-warranty)) |
1381 |
|
(insert |
1382 |
|
"\n |
1383 |
|
GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details. |
1384 |
|
Emacs is Free Software--Free as in Freedom--so you can redistribute copies |
1385 |
|
of Emacs and modify it; type C-h C-c to see the conditions. |
1386 |
|
Type C-h C-d for information on getting the latest version.") |
1387 |
|
(insert (substitute-command-keys |
1388 |
|
"\n |
1389 |
|
GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details. |
1390 |
|
Emacs is Free Software--Free as in Freedom--so you can redistribute copies |
1391 |
|
of Emacs and modify it; type \\[describe-copying] to see the conditions. |
1392 |
|
Type \\[describe-distribution] for information on getting the latest version.")))) |
1393 |
|
|
1394 |
|
;; The rest of the startup screen is the same on all |
1395 |
|
;; kinds of terminals. |
1396 |
|
|
1397 |
|
;; Give information on recovering, if there was a crash. |
1398 |
|
(and auto-save-list-file-prefix |
1399 |
|
;; Don't signal an error if the |
1400 |
|
;; directory for auto-save-list files |
1401 |
|
;; does not yet exist. |
1402 |
|
(file-directory-p (file-name-directory |
1403 |
|
auto-save-list-file-prefix)) |
1404 |
|
(directory-files |
1405 |
|
(file-name-directory auto-save-list-file-prefix) |
1406 |
|
nil |
1407 |
|
(concat "\\`" |
1408 |
|
(regexp-quote (file-name-nondirectory |
1409 |
|
auto-save-list-file-prefix))) |
1410 |
|
t) |
1411 |
|
(insert "\n\nIf an Emacs session crashed recently, " |
1412 |
|
"type M-x recover-session RET\nto recover" |
1413 |
|
" the files you were editing.")) |
1414 |
|
|
1415 |
|
;; Display the input that we set up in the buffer. |
1416 |
|
(set-buffer-modified-p nil) |
1417 |
|
(goto-char (point-min)) |
1418 |
|
(save-window-excursion |
1419 |
|
(switch-to-buffer (current-buffer)) |
1420 |
|
(sit-for 120)))) |
1421 |
|
(kill-buffer "GNU Emacs")) |
1422 |
|
|
1423 |
(defun startup-echo-area-message () |
(defun startup-echo-area-message () |
1424 |
(if (eq (key-binding "\C-h\C-p") 'describe-project) |
(if (eq (key-binding "\C-h\C-p") 'describe-project) |
1425 |
"For information about the GNU Project and its goals, type C-h C-p." |
"For information about the GNU Project and its goals, type C-h C-p." |
1433 |
(message (startup-echo-area-message)))) |
(message (startup-echo-area-message)))) |
1434 |
|
|
1435 |
|
|
1436 |
|
(defun display-splash-screen () |
1437 |
|
"Display splash screen according to display. |
1438 |
|
Fancy splash screens are used on graphic displays, |
1439 |
|
normal otherwise." |
1440 |
|
(interactive) |
1441 |
|
(if (and (display-graphic-p) |
1442 |
|
(use-fancy-splash-screens-p)) |
1443 |
|
(fancy-splash-screens) |
1444 |
|
(normal-splash-screen))) |
1445 |
|
|
1446 |
|
|
1447 |
(defun command-line-1 (command-line-args-left) |
(defun command-line-1 (command-line-args-left) |
1448 |
(or noninteractive (input-pending-p) init-file-had-error |
(or noninteractive (input-pending-p) init-file-had-error |
1449 |
;; t if the init file says to inhibit the echo area startup message. |
;; t if the init file says to inhibit the echo area startup message. |
1716 |
|
|
1717 |
;; If user typed input during all that work, |
;; If user typed input during all that work, |
1718 |
;; abort the startup screen. Otherwise, display it now. |
;; abort the startup screen. Otherwise, display it now. |
1719 |
(let ((buffer (current-buffer))) |
(unless (input-pending-p) |
1720 |
(when (not (input-pending-p)) |
(display-splash-screen)))) |
|
(if (and (display-graphic-p) |
|
|
(use-fancy-splash-screens-p)) |
|
|
(fancy-splash-screens) |
|
|
(with-current-buffer (get-buffer-create "GNU Emacs") |
|
|
(let ((tab-width 8) |
|
|
(mode-line-format (propertize "---- %b %-" |
|
|
'face '(:weight bold)))) |
|
|
|
|
|
;; The convention for this piece of code is that |
|
|
;; each piece of output starts with one or two newlines |
|
|
;; and does not end with any newlines. |
|
|
(insert "Welcome to GNU Emacs") |
|
|
(if (eq system-type 'gnu/linux) |
|
|
(insert ", one component of a Linux-based GNU system.")) |
|
|
(insert "\n") |
|
|
|
|
|
(unless (equal (buffer-name buffer) "*scratch*") |
|
|
(insert (substitute-command-keys |
|
|
"\nType \\[recenter] to begin editing your file.\n"))) |
|
|
|
|
|
(if (display-mouse-p) |
|
|
;; The user can use the mouse to activate menus |
|
|
;; so give help in terms of menu items. |
|
|
(progn |
|
|
(insert "\ |
|
|
You can do basic editing with the menu bar and scroll bar using the mouse. |
|
|
|
|
|
Useful File menu items: |
|
|
Exit Emacs (or type Control-x followed by Control-c) |
|
|
Recover Session recover files you were editing before a crash |
|
|
|
|
|
Important Help menu items: |
|
|
Emacs Tutorial Learn-by-doing tutorial for using Emacs efficiently. |
|
|
Emacs FAQ Frequently asked questions and answers |
|
|
\(Non)Warranty GNU Emacs comes with ABSOLUTELY NO WARRANTY |
|
|
Copying Conditions Conditions for redistributing and changing Emacs. |
|
|
Getting New Versions How to obtain the latest version of Emacs. |
|
|
Ordering Manuals How to order manuals from the FSF. |
|
|
") |
|
|
(insert "\n\n" (emacs-version) |
|
|
" |
|
|
Copyright (C) 2001 Free Software Foundation, Inc.")) |
|
|
|
|
|
;; No mouse menus, so give help using kbd commands. |
|
|
|
|
|
;; If keys have their default meanings, |
|
|
;; use precomputed string to save lots of time. |
|
|
(if (and (eq (key-binding "\C-h") 'help-command) |
|
|
(eq (key-binding "\C-xu") 'advertised-undo) |
|
|
(eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs) |
|
|
(eq (key-binding "\C-ht") 'help-with-tutorial) |
|
|
(eq (key-binding "\C-hi") 'info) |
|
|
(eq (key-binding "\C-h\C-n") 'view-emacs-news)) |
|
|
(insert " |
|
|
Get help C-h (Hold down CTRL and press h) |
|
|
Undo changes C-x u Exit Emacs C-x C-c |
|
|
Get a tutorial C-h t Use Info to read docs C-h i |
|
|
Ordering manuals C-h RET") |
|
|
(insert (substitute-command-keys |
|
|
(format "\n |
|
|
Get help %s |
|
|
Undo changes \\[advertised-undo] |
|
|
Exit Emacs \\[save-buffers-kill-emacs] |
|
|
Get a tutorial \\[help-with-tutorial] |
|
|
Use Info to read docs \\[info] |
|
|
Ordering manuals \\[view-order-manuals]" |
|
|
(let ((where (where-is-internal |
|
|
'help-command nil t))) |
|
|
(if where |
|
|
(key-description where) |
|
|
"M-x help")))))) |
|
|
|
|
|
;; Say how to use the menu bar with the keyboard. |
|
|
(if (and (eq (key-binding "\M-`") 'tmm-menubar) |
|
|
(eq (key-binding [f10]) 'tmm-menubar)) |
|
|
(insert " |
|
|
Activate menubar F10 or ESC ` or M-`") |
|
|
(insert (substitute-command-keys " |
|
|
Activate menubar \\[tmm-menubar]"))) |
|
|
|
|
|
;; Many users seem to have problems with these. |
|
|
(insert " |
|
|
\(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key. |
|
|
If you have no Meta key, you may instead type ESC followed by the character.)") |
|
|
|
|
|
(insert "\n\n" (emacs-version) |
|
|
" |
|
|
Copyright (C) 2001 Free Software Foundation, Inc.") |
|
|
|
|
|
(if (and (eq (key-binding "\C-h\C-c") 'describe-copying) |
|
|
(eq (key-binding "\C-h\C-d") 'describe-distribution) |
|
|
(eq (key-binding "\C-h\C-w") 'describe-no-warranty)) |
|
|
(insert |
|
|
"\n |
|
|
GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details. |
|
|
Emacs is Free Software--Free as in Freedom--so you can redistribute copies |
|
|
of Emacs and modify it; type C-h C-c to see the conditions. |
|
|
Type C-h C-d for information on getting the latest version.") |
|
|
(insert (substitute-command-keys |
|
|
"\n |
|
|
GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details. |
|
|
Emacs is Free Software--Free as in Freedom--so you can redistribute copies |
|
|
of Emacs and modify it; type \\[describe-copying] to see the conditions. |
|
|
Type \\[describe-distribution] for information on getting the latest version.")))) |
|
|
|
|
|
;; The rest of the startup screen is the same on all |
|
|
;; kinds of terminals. |
|
|
|
|
|
;; Give information on recovering, if there was a crash. |
|
|
(and auto-save-list-file-prefix |
|
|
;; Don't signal an error if the |
|
|
;; directory for auto-save-list files |
|
|
;; does not yet exist. |
|
|
(file-directory-p (file-name-directory |
|
|
auto-save-list-file-prefix)) |
|
|
(directory-files |
|
|
(file-name-directory auto-save-list-file-prefix) |
|
|
nil |
|
|
(concat "\\`" |
|
|
(regexp-quote (file-name-nondirectory |
|
|
auto-save-list-file-prefix))) |
|
|
t) |
|
|
(insert "\n\nIf an Emacs session crashed recently, " |
|
|
"type M-x recover-session RET\nto recover" |
|
|
" the files you were editing.")) |
|
|
|
|
|
;; Display the input that we set up in the buffer. |
|
|
(set-buffer-modified-p nil) |
|
|
(goto-char (point-min)) |
|
|
(save-window-excursion |
|
|
(switch-to-buffer (current-buffer)) |
|
|
(sit-for 120)))) |
|
|
(kill-buffer "GNU Emacs")))))) |
|
1721 |
|
|
1722 |
|
|
1723 |
(defun command-line-normalize-file-name (file) |
(defun command-line-normalize-file-name (file) |