diff options
| author | Glenn Morris | 2012-03-25 17:37:04 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-03-25 17:37:04 -0700 |
| commit | 33da7b164bf352bdef4a8b0cf91a353f99a1c9ff (patch) | |
| tree | c09b4ad679685dc1567034479e61026dd00461a1 | |
| parent | f514f6f0e3f8bbeb5212d0337e5bda5a9a4eaeb5 (diff) | |
| download | emacs-33da7b164bf352bdef4a8b0cf91a353f99a1c9ff.tar.gz emacs-33da7b164bf352bdef4a8b0cf91a353f99a1c9ff.zip | |
Small edits for lispref/os.texi
* doc/lispref/os.texi (Startup Summary): Copyedits. Fix startup screen logic.
(Init File): Copyedits.
(Command-Line Arguments): Copyedits. Do not mention argv alias.
* lisp/startup.el (normal-top-level, command-line, command-line-1):
Give them doc strings.
| -rw-r--r-- | doc/lispref/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 103 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/startup.el | 9 |
4 files changed, 71 insertions, 52 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 5477da38abe..ce532c27f4d 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-03-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * os.texi (Startup Summary): Copyedits. Fix startup screen logic. | ||
| 4 | (Init File): Copyedits. | ||
| 5 | (Command-Line Arguments): Copyedits. Do not mention argv alias. | ||
| 6 | |||
| 1 | 2012-03-25 Chong Yidong <cyd@gnu.org> | 7 | 2012-03-25 Chong Yidong <cyd@gnu.org> |
| 2 | 8 | ||
| 3 | * display.texi (Fringes): Note that fringes are shown on graphical | 9 | * display.texi (Fringes): Note that fringes are shown on graphical |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 2563bc57aef..2571c7b2539 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -110,8 +110,8 @@ compiled into the Emacs executable when it was built. | |||
| 110 | It runs the normal hook @code{before-init-hook}. | 110 | It runs the normal hook @code{before-init-hook}. |
| 111 | 111 | ||
| 112 | @item | 112 | @item |
| 113 | If appropriate (e.g., not in batch mode or started as a daemon), it | 113 | If appropriate, it creates a graphical frame. This is not done if the |
| 114 | creates a graphical frame. | 114 | options @samp{--batch} or @samp{--daemon} were specified. |
| 115 | 115 | ||
| 116 | @item | 116 | @item |
| 117 | It initializes the initial frame's faces, and sets up the menu bar | 117 | It initializes the initial frame's faces, and sets up the menu bar |
| @@ -195,7 +195,7 @@ It now exits if the option @code{--batch} was specified. | |||
| 195 | 195 | ||
| 196 | @item | 196 | @item |
| 197 | If @code{initial-buffer-choice} is a string, it visits the file with | 197 | If @code{initial-buffer-choice} is a string, it visits the file with |
| 198 | that name. Furthermore, if the @samp{*scratch*} buffer exists and is | 198 | that name. If the @samp{*scratch*} buffer exists and is |
| 199 | empty, it inserts @code{initial-scratch-message} into that buffer. | 199 | empty, it inserts @code{initial-scratch-message} into that buffer. |
| 200 | 200 | ||
| 201 | @c To make things nice and confusing, the next three items can be | 201 | @c To make things nice and confusing, the next three items can be |
| @@ -221,9 +221,9 @@ It runs @code{window-setup-hook}. @xref{Window Systems}. | |||
| 221 | @item | 221 | @item |
| 222 | It displays the @dfn{startup screen}, which is a special buffer that | 222 | It displays the @dfn{startup screen}, which is a special buffer that |
| 223 | contains information about copyleft and basic Emacs usage. This is | 223 | contains information about copyleft and basic Emacs usage. This is |
| 224 | not done if @code{initial-buffer-choice} or | 224 | not done if @code{inhibit-startup-screen} or @code{initial-buffer-choice} |
| 225 | @code{inhibit-startup-screen} are @code{nil}, nor if the | 225 | are non-@code{nil}, or if the @samp{--no-splash} or @samp{-Q} command-line |
| 226 | @samp{--no-splash} or @samp{-Q} command-line options were specified. | 226 | options were specified. |
| 227 | 227 | ||
| 228 | @c End of command-line-1. | 228 | @c End of command-line-1. |
| 229 | 229 | ||
| @@ -267,15 +267,14 @@ aliases for this variable. | |||
| 267 | @end defopt | 267 | @end defopt |
| 268 | 268 | ||
| 269 | @defopt initial-buffer-choice | 269 | @defopt initial-buffer-choice |
| 270 | This variable, if non-@code{nil}, determines a file or buffer for | 270 | If non-@code{nil}, this variable is a string that specifies a file or |
| 271 | Emacs to display after starting up, instead of the startup screen. | 271 | directory for Emacs to display after starting up, instead of the |
| 272 | startup screen. | ||
| 272 | @ignore | 273 | @ignore |
| 273 | @c I do not think this should be mentioned. AFAICS it is just a dodge | 274 | @c I do not think this should be mentioned. AFAICS it is just a dodge |
| 274 | @c around inhibit-startup-screen not being settable on a site-wide basis. | 275 | @c around inhibit-startup-screen not being settable on a site-wide basis. |
| 275 | If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer. | 276 | If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer. |
| 276 | @end ignore | 277 | @end ignore |
| 277 | If its value is a string, that specifies the name of a file for Emacs to | ||
| 278 | visit. | ||
| 279 | @end defopt | 278 | @end defopt |
| 280 | 279 | ||
| 281 | @defopt inhibit-startup-echo-area-message | 280 | @defopt inhibit-startup-echo-area-message |
| @@ -365,11 +364,12 @@ Lisp library named @file{default.el}. Emacs finds this file through | |||
| 365 | the standard search path for libraries (@pxref{How Programs Do | 364 | the standard search path for libraries (@pxref{How Programs Do |
| 366 | Loading}). The Emacs distribution does not come with this file; it is | 365 | Loading}). The Emacs distribution does not come with this file; it is |
| 367 | intended for local customizations. If the default init file exists, | 366 | intended for local customizations. If the default init file exists, |
| 368 | it is loaded whenever you start Emacs, except in batch mode or if | 367 | it is loaded whenever you start Emacs. But your own personal init |
| 369 | @samp{-q} (or @samp{-Q}) is specified. But your own personal init | ||
| 370 | file, if any, is loaded first; if it sets @code{inhibit-default-init} | 368 | file, if any, is loaded first; if it sets @code{inhibit-default-init} |
| 371 | to a non-@code{nil} value, then Emacs does not subsequently load the | 369 | to a non-@code{nil} value, then Emacs does not subsequently load the |
| 372 | @file{default.el} file. | 370 | @file{default.el} file. In batch mode, or if you specify @samp{-q} |
| 371 | (or @samp{-Q}), Emacs loads neither your personal init file nor | ||
| 372 | the default init file. | ||
| 373 | 373 | ||
| 374 | Another file for site-customization is @file{site-start.el}. Emacs | 374 | Another file for site-customization is @file{site-start.el}. Emacs |
| 375 | loads this @emph{before} the user's init file. You can inhibit the | 375 | loads this @emph{before} the user's init file. You can inhibit the |
| @@ -380,6 +380,7 @@ This variable specifies the site-customization file to load before the | |||
| 380 | user's init file. Its normal value is @code{"site-start"}. The only | 380 | user's init file. Its normal value is @code{"site-start"}. The only |
| 381 | way you can change it with real effect is to do so before dumping | 381 | way you can change it with real effect is to do so before dumping |
| 382 | Emacs. | 382 | Emacs. |
| 383 | @c So why even mention it here. I imagine it is almost never changed. | ||
| 383 | @end defopt | 384 | @end defopt |
| 384 | 385 | ||
| 385 | @xref{Init Examples,, Init File Examples, emacs, The GNU Emacs Manual}, for | 386 | @xref{Init Examples,, Init File Examples, emacs, The GNU Emacs Manual}, for |
| @@ -387,28 +388,27 @@ examples of how to make various commonly desired customizations in your | |||
| 387 | @file{.emacs} file. | 388 | @file{.emacs} file. |
| 388 | 389 | ||
| 389 | @defopt inhibit-default-init | 390 | @defopt inhibit-default-init |
| 390 | This variable prevents Emacs from loading the default initialization | 391 | If this variable is non-@code{nil}, it prevents Emacs from loading the |
| 391 | library file for your session of Emacs. If its value is non-@code{nil}, | 392 | default initialization library file. The default value is @code{nil}. |
| 392 | then the default library is not loaded. The default value is | ||
| 393 | @code{nil}. | ||
| 394 | @end defopt | 393 | @end defopt |
| 395 | 394 | ||
| 396 | @defvar before-init-hook | 395 | @defvar before-init-hook |
| 397 | This normal hook is run, once, just before loading all the init files | 396 | This normal hook is run, once, just before loading all the init files |
| 398 | (the user's init file, @file{default.el}, and/or @file{site-start.el}). | 397 | (@file{site-start.el}, your init file, and @file{default.el}). |
| 399 | (The only way to change it with real effect is before dumping Emacs.) | 398 | (The only way to change it with real effect is before dumping Emacs.) |
| 400 | @end defvar | 399 | @end defvar |
| 401 | 400 | ||
| 402 | @defvar after-init-hook | 401 | @defvar after-init-hook |
| 403 | This normal hook is run, once, just after loading all the init files | 402 | This normal hook is run, once, just after loading all the init files |
| 404 | (the user's init file, @file{default.el}, and/or @file{site-start.el}), | 403 | (@file{site-start.el}, your init file, and @file{default.el}), |
| 405 | before loading the terminal-specific library and processing the | 404 | before loading the terminal-specific library (if started on a text |
| 406 | command-line action arguments. | 405 | terminal) and processing the command-line action arguments. |
| 407 | @end defvar | 406 | @end defvar |
| 408 | 407 | ||
| 409 | @defvar emacs-startup-hook | 408 | @defvar emacs-startup-hook |
| 410 | This normal hook is run, once, just after handling the command line | 409 | This normal hook is run, once, just after handling the command line |
| 411 | arguments, just before @code{term-setup-hook}. | 410 | arguments, just before @code{term-setup-hook}. In batch mode, Emacs |
| 411 | does not run either of these hooks. | ||
| 412 | @end defvar | 412 | @end defvar |
| 413 | 413 | ||
| 414 | @defvar user-init-file | 414 | @defvar user-init-file |
| @@ -419,7 +419,7 @@ the value refers to the corresponding source file. | |||
| 419 | 419 | ||
| 420 | @defvar user-emacs-directory | 420 | @defvar user-emacs-directory |
| 421 | This variable holds the name of the @file{.emacs.d} directory. It is | 421 | This variable holds the name of the @file{.emacs.d} directory. It is |
| 422 | ordinarily @file{~/.emacs.d}, but differs on some platforms. | 422 | @file{~/.emacs.d} on all platforms but MS-DOS. |
| 423 | @end defvar | 423 | @end defvar |
| 424 | 424 | ||
| 425 | @node Terminal-Specific | 425 | @node Terminal-Specific |
| @@ -442,12 +442,12 @@ set or add to @code{input-decode-map} if the Termcap or Terminfo entry | |||
| 442 | does not specify all the terminal's function keys. @xref{Terminal | 442 | does not specify all the terminal's function keys. @xref{Terminal |
| 443 | Input}. | 443 | Input}. |
| 444 | 444 | ||
| 445 | When the name of the terminal type contains a hyphen, and no library | 445 | When the name of the terminal type contains a hyphen or underscore, and no library |
| 446 | is found whose name is identical to the terminal's name, Emacs strips | 446 | is found whose name is identical to the terminal's name, Emacs strips |
| 447 | from the terminal's name the last hyphen and everything that follows | 447 | from the terminal's name the last hyphen or underscore and everything that follows |
| 448 | it, and tries again. This process is repeated until Emacs finds a | 448 | it, and tries again. This process is repeated until Emacs finds a |
| 449 | matching library, or until there are no more hyphens in the name | 449 | matching library, or until there are no more hyphens or underscores in the name |
| 450 | (i.g.@: there is no terminal-specific library). For example, if the | 450 | (i.e.@: there is no terminal-specific library). For example, if the |
| 451 | terminal name is @samp{xterm-256color} and there is no | 451 | terminal name is @samp{xterm-256color} and there is no |
| 452 | @file{term/xterm-256color.el} library, Emacs tries to load | 452 | @file{term/xterm-256color.el} library, Emacs tries to load |
| 453 | @file{term/xterm.el}. If necessary, the terminal library can evaluate | 453 | @file{term/xterm.el}. If necessary, the terminal library can evaluate |
| @@ -460,10 +460,10 @@ experimenting with your own peculiar customizations. | |||
| 460 | 460 | ||
| 461 | You can also arrange to override some of the actions of the | 461 | You can also arrange to override some of the actions of the |
| 462 | terminal-specific library by setting the variable | 462 | terminal-specific library by setting the variable |
| 463 | @code{term-setup-hook}. This is a normal hook which Emacs runs using | 463 | @code{term-setup-hook}. This is a normal hook that Emacs runs |
| 464 | @code{run-hooks} at the end of Emacs initialization, after loading both | 464 | at the end its initialization, after loading both |
| 465 | your init file and any terminal-specific libraries. You can | 465 | your init file and any terminal-specific libraries. You could |
| 466 | use this variable to define initializations for terminals that do not | 466 | use this hook to define initializations for terminals that do not |
| 467 | have their own libraries. @xref{Hooks}. | 467 | have their own libraries. @xref{Hooks}. |
| 468 | 468 | ||
| 469 | @defvar term-file-prefix | 469 | @defvar term-file-prefix |
| @@ -478,11 +478,9 @@ terminal-specific initialization file as follows: | |||
| 478 | @noindent | 478 | @noindent |
| 479 | You may set the @code{term-file-prefix} variable to @code{nil} in your | 479 | You may set the @code{term-file-prefix} variable to @code{nil} in your |
| 480 | init file if you do not wish to load the | 480 | init file if you do not wish to load the |
| 481 | terminal-initialization file. To do this, put the following in | 481 | terminal-initialization file. |
| 482 | your init file: @code{(setq term-file-prefix nil)}. | ||
| 483 | 482 | ||
| 484 | On MS-DOS, if the environment variable @code{TERM} is not set, Emacs | 483 | On MS-DOS, Emacs sets the @code{TERM} environment variable to @samp{internal}. |
| 485 | uses @samp{internal} as the terminal type. | ||
| 486 | @end defvar | 484 | @end defvar |
| 487 | 485 | ||
| 488 | @defvar term-setup-hook | 486 | @defvar term-setup-hook |
| @@ -492,28 +490,27 @@ terminal-specific Lisp file. | |||
| 492 | 490 | ||
| 493 | You can use @code{term-setup-hook} to override the definitions made by a | 491 | You can use @code{term-setup-hook} to override the definitions made by a |
| 494 | terminal-specific file. | 492 | terminal-specific file. |
| 495 | @end defvar | ||
| 496 | 493 | ||
| 497 | See @code{window-setup-hook} in @ref{Window Systems}, for a related | 494 | For a related feature, @pxref{Window Systems, window-setup-hook}. |
| 498 | feature. | 495 | @end defvar |
| 499 | 496 | ||
| 500 | @node Command-Line Arguments | 497 | @node Command-Line Arguments |
| 501 | @subsection Command-Line Arguments | 498 | @subsection Command-Line Arguments |
| 502 | @cindex command-line arguments | 499 | @cindex command-line arguments |
| 503 | 500 | ||
| 504 | You can use command-line arguments to request various actions when | 501 | You can use command-line arguments to request various actions when |
| 505 | you start Emacs. Command-line arguments should not be commonly used, | 502 | you start Emacs. Note that the recommended way of using Emacs is to |
| 506 | since the recommended way of using Emacs is to start it just once, | 503 | start it just once, after logging in, and then do all editing in the same |
| 507 | after logging in, and do all editing in the same Emacs session | 504 | Emacs session (@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}). |
| 508 | (@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}); nonetheless, | 505 | For this reason, you might not use command-line arguments very often; |
| 509 | they can be useful when invoking Emacs from session scripts or | 506 | nonetheless, they can be useful when invoking Emacs from session |
| 510 | debugging Emacs itself. This section describes how Emacs processes | 507 | scripts or debugging Emacs. This section describes how Emacs |
| 511 | command-line arguments. | 508 | processes command-line arguments. |
| 512 | 509 | ||
| 513 | @defun command-line | 510 | @defun command-line |
| 514 | This function parses the command line that Emacs was called with, | 511 | This function parses the command line that Emacs was called with, |
| 515 | processes it, loads the user's init file and displays the | 512 | processes it, and (amongst other things) loads the user's init file and |
| 516 | startup messages. | 513 | displays the startup messages. |
| 517 | @end defun | 514 | @end defun |
| 518 | 515 | ||
| 519 | @defvar command-line-processed | 516 | @defvar command-line-processed |
| @@ -529,9 +526,9 @@ to process its new command-line arguments. | |||
| 529 | @cindex switches on command line | 526 | @cindex switches on command line |
| 530 | @cindex options on command line | 527 | @cindex options on command line |
| 531 | @cindex command-line options | 528 | @cindex command-line options |
| 532 | The value of this variable is an alist of user-defined command-line | 529 | This variable is an alist of user-defined command-line options and |
| 533 | options and associated handler functions. This variable exists so you | 530 | associated handler functions. By default it is empty, but you can |
| 534 | can add elements to it. | 531 | add elements if you wish. |
| 535 | 532 | ||
| 536 | A @dfn{command-line option} is an argument on the command line, which | 533 | A @dfn{command-line option} is an argument on the command line, which |
| 537 | has the form: | 534 | has the form: |
| @@ -571,7 +568,9 @@ to Emacs. | |||
| 571 | @defvar command-line-args-left | 568 | @defvar command-line-args-left |
| 572 | @vindex argv | 569 | @vindex argv |
| 573 | The value of this variable is the list of command-line arguments that | 570 | The value of this variable is the list of command-line arguments that |
| 574 | have not yet been processed. @code{argv} is an alias for this. | 571 | have not yet been processed. |
| 572 | @c Don't mention this, since it is a "bad name for a dynamically bound variable" | ||
| 573 | @c @code{argv} is an alias for this. | ||
| 575 | @end defvar | 574 | @end defvar |
| 576 | 575 | ||
| 577 | @defvar command-line-functions | 576 | @defvar command-line-functions |
| @@ -592,7 +591,7 @@ should return a non-@code{nil} value to say it has dealt with that | |||
| 592 | argument. If it has also dealt with some of the following arguments, it | 591 | argument. If it has also dealt with some of the following arguments, it |
| 593 | can indicate that by deleting them from @code{command-line-args-left}. | 592 | can indicate that by deleting them from @code{command-line-args-left}. |
| 594 | 593 | ||
| 595 | If all of these functions return @code{nil}, then the argument is used | 594 | If all of these functions return @code{nil}, then the argument is treated |
| 596 | as a file name to visit. | 595 | as a file name to visit. |
| 597 | @end defvar | 596 | @end defvar |
| 598 | 597 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a0c33da3c8..0903c2c2fd5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-03-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * startup.el (normal-top-level, command-line, command-line-1): | ||
| 4 | Give them doc strings. | ||
| 5 | |||
| 1 | 2012-03-25 Eli Zaretskii <eliz@gnu.org> | 6 | 2012-03-25 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * makefile.w32-in (install): Use $(DIRNAME)_same-dir.tst instead | 8 | * makefile.w32-in (install): Use $(DIRNAME)_same-dir.tst instead |
diff --git a/lisp/startup.el b/lisp/startup.el index 41056f3907e..57d7a74e5ec 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -65,6 +65,8 @@ once you are familiar with the contents of the startup screen." | |||
| 65 | 65 | ||
| 66 | (defvar startup-screen-inhibit-startup-screen nil) | 66 | (defvar startup-screen-inhibit-startup-screen nil) |
| 67 | 67 | ||
| 68 | ;; FIXME? Why does this get such weirdly extreme treatment, when the | ||
| 69 | ;; more important inhibit-startup-screen does not. | ||
| 68 | (defcustom inhibit-startup-echo-area-message nil | 70 | (defcustom inhibit-startup-echo-area-message nil |
| 69 | "Non-nil inhibits the initial startup echo area message. | 71 | "Non-nil inhibits the initial startup echo area message. |
| 70 | Setting this variable takes effect | 72 | Setting this variable takes effect |
| @@ -464,6 +466,10 @@ DIRS are relative." | |||
| 464 | (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail)))))) | 466 | (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail)))))) |
| 465 | 467 | ||
| 466 | (defun normal-top-level () | 468 | (defun normal-top-level () |
| 469 | "Emacs calls this function when it first starts up. | ||
| 470 | It sets `command-line-processed', processes the command-line, | ||
| 471 | reads the initialization files, etc. | ||
| 472 | It is the default value of the variable `top-level'." | ||
| 467 | (if command-line-processed | 473 | (if command-line-processed |
| 468 | (message "Back to top level.") | 474 | (message "Back to top level.") |
| 469 | (setq command-line-processed t) | 475 | (setq command-line-processed t) |
| @@ -701,6 +707,8 @@ opening the first frame (e.g. open a connection to an X server).") | |||
| 701 | (defvar server-process) | 707 | (defvar server-process) |
| 702 | 708 | ||
| 703 | (defun command-line () | 709 | (defun command-line () |
| 710 | "A subroutine of `normal-top-level'. | ||
| 711 | Amongst another things, it parses the command-line arguments." | ||
| 704 | (setq before-init-time (current-time) | 712 | (setq before-init-time (current-time) |
| 705 | after-init-time nil | 713 | after-init-time nil |
| 706 | command-line-default-directory default-directory) | 714 | command-line-default-directory default-directory) |
| @@ -2076,6 +2084,7 @@ A fancy display is used on graphic displays, normal otherwise." | |||
| 2076 | (defalias 'display-splash-screen 'display-startup-screen) | 2084 | (defalias 'display-splash-screen 'display-startup-screen) |
| 2077 | 2085 | ||
| 2078 | (defun command-line-1 (args-left) | 2086 | (defun command-line-1 (args-left) |
| 2087 | "A subroutine of `command-line'." | ||
| 2079 | (display-startup-echo-area-message) | 2088 | (display-startup-echo-area-message) |
| 2080 | (when (and pure-space-overflow | 2089 | (when (and pure-space-overflow |
| 2081 | (not noninteractive)) | 2090 | (not noninteractive)) |