aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-06-06 19:21:15 +0000
committerKarl Heuer1995-06-06 19:21:15 +0000
commitbfe721d172158ccdcd925e55f5a658421ca0d4fe (patch)
tree2d2882c335a04acb20662d2b5aa6dc2246a6f0aa
parent5c4276bc6de449d416cc83dd034892da66badcb7 (diff)
downloademacs-bfe721d172158ccdcd925e55f5a658421ca0d4fe.tar.gz
emacs-bfe721d172158ccdcd925e55f5a658421ca0d4fe.zip
*** empty log message ***
-rw-r--r--lispref/backups.texi54
-rw-r--r--lispref/buffers.texi19
-rw-r--r--lispref/commands.texi265
-rw-r--r--lispref/compile.texi35
-rw-r--r--lispref/control.texi7
-rw-r--r--lispref/debugging.texi23
-rw-r--r--lispref/display.texi121
-rw-r--r--lispref/edebug.texi4
-rw-r--r--lispref/elisp.texi36
-rw-r--r--lispref/errors.texi34
-rw-r--r--lispref/eval.texi66
-rw-r--r--lispref/files.texi103
-rw-r--r--lispref/frames.texi197
-rw-r--r--lispref/functions.texi51
-rw-r--r--lispref/help.texi41
-rw-r--r--lispref/hooks.texi4
-rw-r--r--lispref/internals.texi24
-rw-r--r--lispref/intro.texi4
-rw-r--r--lispref/keymaps.texi53
-rw-r--r--lispref/lists.texi16
-rw-r--r--lispref/loading.texi42
-rw-r--r--lispref/locals.texi9
-rw-r--r--lispref/macros.texi69
-rw-r--r--lispref/maps.texi65
-rw-r--r--lispref/markers.texi8
-rw-r--r--lispref/minibuf.texi64
-rw-r--r--lispref/modes.texi172
-rw-r--r--lispref/numbers.texi111
-rw-r--r--lispref/objects.texi111
-rw-r--r--lispref/os.texi126
-rw-r--r--lispref/positions.texi84
-rw-r--r--lispref/processes.texi47
-rw-r--r--lispref/searching.texi26
-rw-r--r--lispref/sequences.texi22
-rw-r--r--lispref/streams.texi11
-rw-r--r--lispref/strings.texi20
-rw-r--r--lispref/symbols.texi17
-rw-r--r--lispref/syntax.texi6
-rw-r--r--lispref/text.texi250
-rw-r--r--lispref/tips.texi49
-rw-r--r--lispref/variables.texi49
-rw-r--r--lispref/windows.texi140
42 files changed, 1533 insertions, 1122 deletions
diff --git a/lispref/backups.texi b/lispref/backups.texi
index ec1980957e2..d25908fe57c 100644
--- a/lispref/backups.texi
+++ b/lispref/backups.texi
@@ -65,11 +65,12 @@ permanent local; @code{kill-local-variables} does not alter it.
65@end defvar 65@end defvar
66 66
67@defopt make-backup-files 67@defopt make-backup-files
68 This variable determines whether or not to make backup files. If it 68This variable determines whether or not to make backup files. If it
69is non-@code{nil}, then Emacs creates a backup of each file when it is 69is non-@code{nil}, then Emacs creates a backup of each file when it is
70saved for the first time. 70saved for the first time---provided that @code{backup-inhibited}
71is @code{nil} (see below).
71 72
72 The following example shows how to change the @code{make-backup-files} 73The following example shows how to change the @code{make-backup-files}
73variable only in the @file{RMAIL} buffer and not elsewhere. Setting it 74variable only in the @file{RMAIL} buffer and not elsewhere. Setting it
74@code{nil} stops Emacs from making backups of the @file{RMAIL} file, 75@code{nil} stops Emacs from making backups of the @file{RMAIL} file,
75which may save disk space. (You would put this code in your 76which may save disk space. (You would put this code in your
@@ -107,10 +108,12 @@ The default value is this:
107If this variable is non-@code{nil}, backups are inhibited. It records 108If this variable is non-@code{nil}, backups are inhibited. It records
108the result of testing @code{backup-enable-predicate} on the visited file 109the result of testing @code{backup-enable-predicate} on the visited file
109name. It can also coherently be used by other mechanisms that inhibit 110name. It can also coherently be used by other mechanisms that inhibit
110backups based on which file is visited. This is a permanent local, 111backups based on which file is visited. For example, VC sets this
111so that changing the major mode does not lose its value. 112variable non-@code{nil} to prevent making backups for files managed
113with a version control system.
112 114
113Major modes should not set this variable---they should set 115This is a permanent local, so that changing the major mode does not lose
116its value. Major modes should not set this variable---they should set
114@code{make-backup-files} instead. 117@code{make-backup-files} instead.
115@end defvar 118@end defvar
116 119
@@ -506,7 +509,7 @@ If this variable is non-@code{nil}, buffers that are visiting files
506have auto-saving enabled by default. Otherwise, they do not. 509have auto-saving enabled by default. Otherwise, they do not.
507@end defopt 510@end defopt
508 511
509@deffn Command do-auto-save &optional no-message 512@deffn Command do-auto-save &optional no-message current-only
510This function auto-saves all buffers that need to be auto-saved. It 513This function auto-saves all buffers that need to be auto-saved. It
511saves all buffers for which auto-saving is enabled and that have been 514saves all buffers for which auto-saving is enabled and that have been
512changed since the previous auto-save. 515changed since the previous auto-save.
@@ -515,6 +518,9 @@ Normally, if any buffers are auto-saved, a message that says
515@samp{Auto-saving...} is displayed in the echo area while auto-saving is 518@samp{Auto-saving...} is displayed in the echo area while auto-saving is
516going on. However, if @var{no-message} is non-@code{nil}, the message 519going on. However, if @var{no-message} is non-@code{nil}, the message
517is inhibited. 520is inhibited.
521
522If @var{current-only} is non-@code{nil}, only the current buffer
523is auto-saved.
518@end deffn 524@end deffn
519 525
520@defun delete-auto-save-file-if-necessary 526@defun delete-auto-save-file-if-necessary
@@ -545,17 +551,22 @@ in response.
545 551
546If it is -1, that means auto-saving is temporarily shut off in this 552If it is -1, that means auto-saving is temporarily shut off in this
547buffer due to a substantial deletion. Explicitly saving the buffer 553buffer due to a substantial deletion. Explicitly saving the buffer
548stores a positive value in this variable, thus reenabling auto-save. 554stores a positive value in this variable, thus reenabling auto-saving.
549Turning auto-save mode off or on also alters this variable. 555Turning auto-save mode off or on also alters this variable.
550@end defvar 556@end defvar
551 557
552@defvar auto-save-list-file-name 558@defvar auto-save-list-file-name
553This variable (if non-@code{nil}) specifies a file for recording the 559This variable (if non-@code{nil}) specifies a file for recording the
554names of all the auto-save files. Each time Emacs does auto-saving, it 560names of all the auto-save files. Each time Emacs does auto-saving, it
555writes into this file the names of all the auto-save files of all the 561writes two lines into this file for each buffer that has auto-saving
556buffers that have auto-save enabled. If Emacs crashes, you can look in 562enabled. The first line gives the name of the visited file (it's empty
557this file to find all the auto-save files that might contain work that 563if the buffer has none), and the second gives the name of the auto-save
558was otherwise lost. The @code{multi-replace} command uses these files. 564file.
565
566If Emacs exits normally, it deletes this file. If Emacs crashes, you
567can look in the file to find all the auto-save files that might contain
568work that was otherwise lost. The @code{recover-session} command uses
569these files.
559 570
560The default name for this file is in your home directory and starts with 571The default name for this file is in your home directory and starts with
561@samp{.saves-}. It also contains the Emacs process @sc{id} and the host 572@samp{.saves-}. It also contains the Emacs process @sc{id} and the host
@@ -612,9 +623,9 @@ regenerate the contents.
612 623
613@defvar revert-buffer-insert-file-contents-function 624@defvar revert-buffer-insert-file-contents-function
614The value of this variable, if non-@code{nil}, is the function to use to 625The value of this variable, if non-@code{nil}, is the function to use to
615insert contents when reverting this buffer. The function receives two 626insert the updated contents when reverting this buffer. The function
616arguments, first the file name to use; second, @code{t} if the user has 627receives two arguments: first the file name to use; second, @code{t} if
617asked to read the auto-save file. 628the user has asked to read the auto-save file.
618@end defvar 629@end defvar
619 630
620@defvar before-revert-hook 631@defvar before-revert-hook
@@ -635,16 +646,3 @@ Font Lock mode uses this hook to recompute the fonts for the updated
635buffer contents. 646buffer contents.
636@end defvar 647@end defvar
637 648
638@deffn Command recover-file filename
639This function visits @var{filename}, but gets the contents from its
640last auto-save file. This is useful after the system has crashed, to
641resume editing the same file without losing all the work done in the
642previous session.
643
644An error is signaled if there is no auto-save file for @var{filename},
645or if @var{filename} is newer than its auto-save file. If
646@var{filename} does not exist, but its auto-save file does, then the
647auto-save file is read as usual. This last situation may occur if you
648visited a nonexistent file and never actually saved it.
649@end deffn
650
diff --git a/lispref/buffers.texi b/lispref/buffers.texi
index bfa8f020c62..801698408aa 100644
--- a/lispref/buffers.texi
+++ b/lispref/buffers.texi
@@ -45,11 +45,11 @@ current buffer. Each buffer, including the current buffer, may or may
45not be displayed in any windows. 45not be displayed in any windows.
46@end ifinfo 46@end ifinfo
47 47
48 Buffers in Emacs editing are objects that have distinct names and 48 Buffers in Emacs editing are objects that have distinct names and hold
49hold text that can be edited. Buffers appear to Lisp programs as a 49text that can be edited. Buffers appear to Lisp programs as a special
50special data type. The contents of a buffer may be viewed as an 50data type. You can think of the contents of a buffer as an extendable
51extendable string; insertions and deletions may occur in any part of the 51string; insertions and deletions may occur in any part of the buffer.
52buffer. @xref{Text}. 52@xref{Text}.
53 53
54 A Lisp buffer object contains numerous pieces of information. Some of 54 A Lisp buffer object contains numerous pieces of information. Some of
55this information is directly accessible to the programmer through 55this information is directly accessible to the programmer through
@@ -212,7 +212,7 @@ Any argument called @var{buffer} must be an actual buffer
212object, not a name. 212object, not a name.
213 213
214 Buffers that are ephemeral and generally uninteresting to the user 214 Buffers that are ephemeral and generally uninteresting to the user
215have names starting with a space, so that the @code{list-buffers} or 215have names starting with a space, so that the @code{list-buffers} and
216@code{buffer-menu} commands don't mention them. A name starting with 216@code{buffer-menu} commands don't mention them. A name starting with
217space also initially disables recording undo information; see 217space also initially disables recording undo information; see
218@ref{Undo}. 218@ref{Undo}.
@@ -567,7 +567,7 @@ A buffer visiting a write-protected file is normally read-only.
567Here, the purpose is to show the user that editing the buffer with the 567Here, the purpose is to show the user that editing the buffer with the
568aim of saving it in the file may be futile or undesirable. The user who 568aim of saving it in the file may be futile or undesirable. The user who
569wants to change the buffer text despite this can do so after clearing 569wants to change the buffer text despite this can do so after clearing
570the read-only flag with @kbd{C-M-q}. 570the read-only flag with @kbd{C-x C-q}.
571 571
572@item 572@item
573Modes such as Dired and Rmail make buffers read-only when altering the 573Modes such as Dired and Rmail make buffers read-only when altering the
@@ -779,6 +779,9 @@ Therefore, when you kill a buffer, you should also take the precautions
779associated with changing the current buffer (unless you happen to know 779associated with changing the current buffer (unless you happen to know
780that the buffer being killed isn't current). @xref{Current Buffer}. 780that the buffer being killed isn't current). @xref{Current Buffer}.
781 781
782 If you kill a buffer that is the base buffer of one or more indirect
783buffers, the indirect buffers are automatically killed as well.
784
782 The @code{buffer-name} of a killed buffer is @code{nil}. You can use 785 The @code{buffer-name} of a killed buffer is @code{nil}. You can use
783this feature to test whether a buffer has been killed: 786this feature to test whether a buffer has been killed:
784 787
@@ -853,7 +856,7 @@ when set for any reason. @xref{Buffer-Local Variables}.
853 856
854 An @dfn{indirect buffer} shares the text of some other buffer, which 857 An @dfn{indirect buffer} shares the text of some other buffer, which
855is called the @dfn{base buffer} of the indirect buffer. In some ways it 858is called the @dfn{base buffer} of the indirect buffer. In some ways it
856is the equivalent, for buffers, of a symbolic link among files. The base 859is the analogue, for buffers, of a symbolic link among files. The base
857buffer may not itself be an indirect buffer. 860buffer may not itself be an indirect buffer.
858 861
859 The text of the indirect buffer is always identical to the text of its 862 The text of the indirect buffer is always identical to the text of its
diff --git a/lispref/commands.texi b/lispref/commands.texi
index aa7ad7d2852..c03e9169ad6 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -82,40 +82,10 @@ and also when the command loop is first entered. At that time,
82@code{last-command} describes the command before that. @xref{Hooks}. 82@code{last-command} describes the command before that. @xref{Hooks}.
83@end defvar 83@end defvar
84 84
85 An erroneous function in the @code{pre-command-hook} list could easily
86make Emacs go into an infinite loop of errors. To protect you from this
87sort of painful problem, Emacs sets the hook variable to @code{nil}
88temporarily while running the functions in the hook. Thus, if a hook
89function gets an error, the hook variable is left as @code{nil}. Emacs
90does the same thing for @code{post-command-hook}.
91
92 Quitting is suppressed while running @code{pre-command-hook} and 85 Quitting is suppressed while running @code{pre-command-hook} and
93@code{post-command-hook}; this is because otherwise a quit, happening by 86@code{post-command-hook}. If an error happens while executing one of
94chance within one of these hooks, would turn off the hook. 87these hooks, it terminates execution of the hook, but that is all it
95 88does.
96 One inconvenient result of these protective features is that you
97cannot have a function in @code{post-command-hook} or
98@code{pre-command-hook} which changes the value of that variable. But
99that's not a real limitation. If you want hook functions to change the
100hook, simply add one fixed function to the hook, and code that function
101to look in another hook variable for other functions to call. Here is
102an example:
103
104@example
105;; @r{Set up the mechanism.}
106(defvar current-post-command-function nil)
107(defun run-current-post-command-function ()
108 (if current-post-command-function
109 (funcall current-post-command-function)))
110(add-hooks 'post-command-hook
111 'run-current-post-command-function)
112
113;; @r{Here's a hook function which replaces itself}
114;; @r{with a different hook function to run next time.}
115(defun first-post-command-function ()
116 (setq current-post-command-function
117 'second-post-command-function))
118@end example
119 89
120@node Defining Commands 90@node Defining Commands
121@section Defining Commands 91@section Defining Commands
@@ -502,7 +472,7 @@ that is, if @var{object} is a command. Otherwise, returns @code{nil}.
502 472
503The interactively callable objects include strings and vectors (treated 473The interactively callable objects include strings and vectors (treated
504as keyboard macros), lambda expressions that contain a top-level call to 474as keyboard macros), lambda expressions that contain a top-level call to
505@code{interactive}, compiled function objects made from such lambda 475@code{interactive}, byte-code function objects made from such lambda
506expressions, autoload objects that are declared as interactive 476expressions, autoload objects that are declared as interactive
507(non-@code{nil} fourth argument to @code{autoload}), and some of the 477(non-@code{nil} fourth argument to @code{autoload}), and some of the
508primitive functions. 478primitive functions.
@@ -647,6 +617,9 @@ is a symbol with a function definition, but this is not guaranteed.
647The value is copied from @code{this-command} when a command returns to 617The value is copied from @code{this-command} when a command returns to
648the command loop, except when the command specifies a prefix argument 618the command loop, except when the command specifies a prefix argument
649for the following command. 619for the following command.
620
621This variable is always local to the current terminal and cannot be
622buffer-local. @xref{Multiple Displays}.
650@end defvar 623@end defvar
651 624
652@defvar this-command 625@defvar this-command
@@ -662,7 +635,7 @@ command).
662 635
663@cindex kill command repetition 636@cindex kill command repetition
664Some commands set this variable during their execution, as a flag for 637Some commands set this variable during their execution, as a flag for
665whatever command runs next. In particular, the functions that kill text 638whatever command runs next. In particular, the functions for killing text
666set @code{this-command} to @code{kill-region} so that any kill commands 639set @code{this-command} to @code{kill-region} so that any kill commands
667immediately following will know to append the killed text to the 640immediately following will know to append the killed text to the
668previous kill. 641previous kill.
@@ -737,17 +710,6 @@ frame, the value is the frame to which the event was redirected.
737@xref{Input Focus}. 710@xref{Input Focus}.
738@end defvar 711@end defvar
739 712
740@defvar echo-keystrokes
741This variable determines how much time should elapse before command
742characters echo. Its value must be an integer, which specifies the
743number of seconds to wait before echoing. If the user types a prefix
744key (such as @kbd{C-x}) and then delays this many seconds before
745continuing, the prefix key is echoed in the echo area. Any subsequent
746characters in the same command will be echoed as well.
747
748If the value is zero, then command input is not echoed.
749@end defvar
750
751@node Input Events 713@node Input Events
752@section Input Events 714@section Input Events
753@cindex events 715@cindex events
@@ -798,11 +760,25 @@ An input character event consists of a @dfn{basic code} between 0 and
798 760
799@table @asis 761@table @asis
800@item meta 762@item meta
801The 2**23 bit in the character code indicates a character 763The
764@iftex
765$2^{27}$
766@end iftex
767@ifinfo
7682**27
769@end ifinfo
770bit in the character code indicates a character
802typed with the meta key held down. 771typed with the meta key held down.
803 772
804@item control 773@item control
805The 2**22 bit in the character code indicates a non-@sc{ASCII} 774The
775@iftex
776$2^{26}$
777@end iftex
778@ifinfo
7792**26
780@end ifinfo
781bit in the character code indicates a non-@sc{ASCII}
806control character. 782control character.
807 783
808@sc{ASCII} control characters such as @kbd{C-a} have special basic 784@sc{ASCII} control characters such as @kbd{C-a} have special basic
@@ -811,42 +787,95 @@ Thus, the code for @kbd{C-a} is just 1.
811 787
812But if you type a control combination not in @sc{ASCII}, such as 788But if you type a control combination not in @sc{ASCII}, such as
813@kbd{%} with the control key, the numeric value you get is the code 789@kbd{%} with the control key, the numeric value you get is the code
814for @kbd{%} plus 2**22 (assuming the terminal supports non-@sc{ASCII} 790for @kbd{%} plus
791@iftex
792$2^{26}$
793@end iftex
794@ifinfo
7952**26
796@end ifinfo
797(assuming the terminal supports non-@sc{ASCII}
815control characters). 798control characters).
816 799
817@item shift 800@item shift
818The 2**21 bit in the character code indicates an @sc{ASCII} control 801The
802@iftex
803$2^{25}$
804@end iftex
805@ifinfo
8062**25
807@end ifinfo
808bit in the character code indicates an @sc{ASCII} control
819character typed with the shift key held down. 809character typed with the shift key held down.
820 810
821For letters, the basic code indicates upper versus lower case; for 811For letters, the basic code indicates upper versus lower case; for
822digits and punctuation, the shift key selects an entirely different 812digits and punctuation, the shift key selects an entirely different
823character with a different basic code. In order to keep within 813character with a different basic code. In order to keep within
824the @sc{ASCII} character set whenever possible, Emacs avoids using 814the @sc{ASCII} character set whenever possible, Emacs avoids using
825the 2**21 bit for those characters. 815the
816@iftex
817$2^{25}$
818@end iftex
819@ifinfo
8202**25
821@end ifinfo
822bit for those characters.
826 823
827However, @sc{ASCII} provides no way to distinguish @kbd{C-A} from 824However, @sc{ASCII} provides no way to distinguish @kbd{C-A} from
828@kbd{C-a}, so Emacs uses the 2**21 bit in @kbd{C-A} and not in 825@kbd{C-a}, so Emacs uses the
826@iftex
827$2^{25}$
828@end iftex
829@ifinfo
8302**25
831@end ifinfo
832bit in @kbd{C-A} and not in
829@kbd{C-a}. 833@kbd{C-a}.
830 834
831@item hyper 835@item hyper
832The 2**20 bit in the character code indicates a character 836The
837@iftex
838$2^{24}$
839@end iftex
840@ifinfo
8412**24
842@end ifinfo
843bit in the character code indicates a character
833typed with the hyper key held down. 844typed with the hyper key held down.
834 845
835@item super 846@item super
836The 2**19 bit in the character code indicates a character 847The
848@iftex
849$2^{23}$
850@end iftex
851@ifinfo
8522**23
853@end ifinfo
854bit in the character code indicates a character
837typed with the super key held down. 855typed with the super key held down.
838 856
839@item alt 857@item alt
840The 2**18 bit in the character code indicates a character typed with 858The
859@iftex
860$2^{22}$
861@end iftex
862@ifinfo
8632**22
864@end ifinfo
865bit in the character code indicates a character typed with
841the alt key held down. (On some terminals, the key labeled @key{ALT} 866the alt key held down. (On some terminals, the key labeled @key{ALT}
842is actually the meta key.) 867is actually the meta key.)
843@end table 868@end table
844 869
845 In the future, Emacs may support a larger range of basic codes. We 870 It is best to avoid mentioning specific bit numbers in your program.
846may also move the modifier bits to larger bit numbers. Therefore, you 871To test the modifier bits of a character, use the function
847should avoid mentioning specific bit numbers in your program. 872@code{event-modifiers} (@pxref{Classifying Events}). When making key
848Instead, the way to test the modifier bits of a character is with the 873bindings, you can use the read syntax for characters with modifier bits
849function @code{event-modifiers} (@pxref{Classifying Events}). 874(@samp{\C-}, @samp{\M-}, and so on). For making key bindings with
875@code{define-key}, you can use lists such as @code{(control hyper ?x)} to
876specify the characters (@pxref{Changing Key Bindings}). The function
877@code{event-convert-list} converts such a list into an event type
878(@pxref{Classifying Events}).
850 879
851@node Function Keys 880@node Function Keys
852@subsection Function Keys 881@subsection Function Keys
@@ -1258,6 +1287,11 @@ the window manager. Its standard definition is @code{ignore}; since the
1258frame has already been iconified, Emacs has no work to do. 1287frame has already been iconified, Emacs has no work to do.
1259@end table 1288@end table
1260 1289
1290 If one of these events arrives in the middle of a key sequence---that
1291is, after a prefix key---then Emacs reorders the events so that this
1292event comes either before or after the multi-event key sequence, not
1293within it.
1294
1261@node Event Examples 1295@node Event Examples
1262@subsection Event Examples 1296@subsection Event Examples
1263 1297
@@ -1380,6 +1414,20 @@ This function returns non-@code{nil} if @var{object} is a mouse movement
1380event. 1414event.
1381@end defun 1415@end defun
1382 1416
1417@defun event-convert-list list
1418This function converts a list of modifier names and a basic event type
1419to an event type which specifies all of them. For example,
1420
1421@example
1422(event-convert-list '(control ?a))
1423 @result{} 1
1424(event-convert-list '(control meta ?a))
1425 @result{} -134217727
1426(event-convert-list '(control super f1))
1427 @result{} C-s-f1
1428@end example
1429@end defun
1430
1383@node Accessing Events 1431@node Accessing Events
1384@subsection Accessing Events 1432@subsection Accessing Events
1385 1433
@@ -1476,7 +1524,13 @@ limited to the range of 0 to 255 as text characters are.
1476 1524
1477 A keyboard character typed using the @key{META} key is called a 1525 A keyboard character typed using the @key{META} key is called a
1478@dfn{meta character}. The numeric code for such an event includes the 1526@dfn{meta character}. The numeric code for such an event includes the
14792**23 bit; it does not even come close to fitting in a string. However, 1527@iftex
1528$2^{27}$
1529@end iftex
1530@ifinfo
15312**27
1532@end ifinfo
1533bit; it does not even come close to fitting in a string. However,
1480earlier Emacs versions used a different representation for these 1534earlier Emacs versions used a different representation for these
1481characters, which gave them codes in the range of 128 to 255. That did 1535characters, which gave them codes in the range of 128 to 255. That did
1482fit in a string, and many Lisp programs contain string constants that 1536fit in a string, and many Lisp programs contain string constants that
@@ -1493,9 +1547,36 @@ If the keyboard character value is in the range of 0 to 127, it can go
1493in the string unchanged. 1547in the string unchanged.
1494 1548
1495@item 1549@item
1496The meta variants of those characters, with codes in the range of 2**23 1550The meta variants of those characters, with codes in the range of
1497to 2**23+127, can also go in the string, but you must change their 1551@iftex
1498numeric values. You must set the 2**7 bit instead of the 2**23 bit, 1552$2^{27}$
1553@end iftex
1554@ifinfo
15552**27
1556@end ifinfo
1557to
1558@iftex
1559$2^{27} + 127$,
1560@end iftex
1561@ifinfo
15622**27+127,
1563@end ifinfo
1564can also go in the string, but you must change their
1565numeric values. You must set the
1566@iftex
1567$2^{7}$
1568@end iftex
1569@ifinfo
15702**7
1571@end ifinfo
1572bit instead of the
1573@iftex
1574$2^{27}$
1575@end iftex
1576@ifinfo
15772**27
1578@end ifinfo
1579bit,
1499resulting in a value between 128 and 255. 1580resulting in a value between 128 and 255.
1500 1581
1501@item 1582@item
@@ -1609,8 +1690,9 @@ not perform case conversion in this way.
1609 1690
1610The function @code{read-key-sequence} also transforms some mouse events. 1691The function @code{read-key-sequence} also transforms some mouse events.
1611It converts unbound drag events into click events, and discards unbound 1692It converts unbound drag events into click events, and discards unbound
1612button-down events entirely. It also reshuffles focus events so that they 1693button-down events entirely. It also reshuffles focus events and
1613never appear in a key sequence with any other events. 1694miscellaneous window events so that they never appear in a key sequence
1695with any other events.
1614 1696
1615When mouse events occur in special parts of a window, such as a mode 1697When mouse events occur in special parts of a window, such as a mode
1616line or a scroll bar, the event type shows nothing special---it is the 1698line or a scroll bar, the event type shows nothing special---it is the
@@ -1626,7 +1708,7 @@ You can define meanings for mouse clicks in special window parts by
1626defining key sequences using these imaginary prefix keys. 1708defining key sequences using these imaginary prefix keys.
1627 1709
1628For example, if you call @code{read-key-sequence} and then click the 1710For example, if you call @code{read-key-sequence} and then click the
1629mouse on the window's mode line, you get an event like this: 1711mouse on the window's mode line, you get two events, like this:
1630 1712
1631@example 1713@example
1632(read-key-sequence "Click on the mode line: ") 1714(read-key-sequence "Click on the mode line: ")
@@ -1686,8 +1768,9 @@ the echo area.
1686@end group 1768@end group
1687 1769
1688@group 1770@group
1771;; @r{We assume here you use @kbd{M-:} to evaluate this.}
1689(symbol-function 'foo) 1772(symbol-function 'foo)
1690 @result{} "^[^[(read-char)^M1" 1773 @result{} "^[:(read-char)^M1"
1691@end group 1774@end group
1692@group 1775@group
1693(execute-kbd-macro 'foo) 1776(execute-kbd-macro 'foo)
@@ -1794,8 +1877,8 @@ as part of a command or explicitly by a Lisp program.
1794 1877
1795In the example below, the Lisp program reads the character @kbd{1}, 1878In the example below, the Lisp program reads the character @kbd{1},
1796@sc{ASCII} code 49. It becomes the value of @code{last-input-event}, 1879@sc{ASCII} code 49. It becomes the value of @code{last-input-event},
1797while @kbd{C-e} (from the @kbd{C-x C-e} command used to evaluate this 1880while @kbd{C-e} (we assume @kbd{C-x C-e} command is used to evaluate
1798expression) remains the value of @code{last-command-event}. 1881this expression) remains the value of @code{last-command-event}.
1799 1882
1800@example 1883@example
1801@group 1884@group
@@ -1852,12 +1935,15 @@ available. The value is @code{t} if @code{sit-for} waited the full
1852time with no input arriving (see @code{input-pending-p} in @ref{Event 1935time with no input arriving (see @code{input-pending-p} in @ref{Event
1853Input Misc}). Otherwise, the value is @code{nil}. 1936Input Misc}). Otherwise, the value is @code{nil}.
1854 1937
1855@c Emacs 19 feature ??? maybe not working yet 1938The argument @var{seconds} need not be an integer. If it is a floating
1939point number, @code{sit-for} waits for a fractional number of seconds.
1940Some systems support only a whole number of seconds; on these systems,
1941@var{seconds} is rounded down.
1942
1856The optional argument @var{millisec} specifies an additional waiting 1943The optional argument @var{millisec} specifies an additional waiting
1857period measured in milliseconds. This adds to the period specified by 1944period measured in milliseconds. This adds to the period specified by
1858@var{seconds}. Not all operating systems support waiting periods other 1945@var{seconds}. If the system doesn't support waiting fractions of a
1859than multiples of a second; on those that do not, you get an error if 1946second, you get an error if you specify nonzero @var{millisec}.
1860you specify nonzero @var{millisec}.
1861 1947
1862@cindex forcing redisplay 1948@cindex forcing redisplay
1863Redisplay is always preempted if input arrives, and does not happen at 1949Redisplay is always preempted if input arrives, and does not happen at
@@ -1882,12 +1968,15 @@ This function simply pauses for @var{seconds} seconds without updating
1882the display. It pays no attention to available input. It returns 1968the display. It pays no attention to available input. It returns
1883@code{nil}. 1969@code{nil}.
1884 1970
1885@c Emacs 19 feature ??? maybe not working yet 1971The argument @var{seconds} need not be an integer. If it is a floating
1972point number, @code{sleep-for} waits for a fractional number of seconds.
1973Some systems support only a whole number of seconds; on these systems,
1974@var{seconds} is rounded down.
1975
1886The optional argument @var{millisec} specifies an additional waiting 1976The optional argument @var{millisec} specifies an additional waiting
1887period measured in milliseconds. This adds to the period specified by 1977period measured in milliseconds. This adds to the period specified by
1888@var{seconds}. Not all operating systems support waiting periods other 1978@var{seconds}. If the system doesn't support waiting fractions of a
1889than multiples of a second; on those that do not, you get an error if 1979second, you get an error if you specify nonzero @var{millisec}.
1890you specify nonzero @var{millisec}.
1891 1980
1892Use @code{sleep-for} when you wish to guarantee a delay. 1981Use @code{sleep-for} when you wish to guarantee a delay.
1893@end defun 1982@end defun
@@ -2312,7 +2401,7 @@ the user whether to proceed.
2312been executed, to make it convenient to repeat these commands. A 2401been executed, to make it convenient to repeat these commands. A
2313@dfn{complex command} is one for which the interactive argument reading 2402@dfn{complex command} is one for which the interactive argument reading
2314uses the minibuffer. This includes any @kbd{M-x} command, any 2403uses the minibuffer. This includes any @kbd{M-x} command, any
2315@kbd{M-ESC} command, and any command whose @code{interactive} 2404@kbd{M-:} command, and any command whose @code{interactive}
2316specification reads an argument from the minibuffer. Explicit use of 2405specification reads an argument from the minibuffer. Explicit use of
2317the minibuffer during the execution of the command itself does not cause 2406the minibuffer during the execution of the command itself does not cause
2318the command to be considered complex. 2407the command to be considered complex.
@@ -2374,14 +2463,6 @@ executed once. If it is 0, @var{macro} is executed over and over until it
2374encounters an error or a failing search. 2463encounters an error or a failing search.
2375@end defun 2464@end defun
2376 2465
2377@defvar last-kbd-macro
2378This variable is the definition of the most recently defined keyboard
2379macro. Its value is a string or vector, or @code{nil}.
2380
2381The variable is always local to the current X terminal and cannot be
2382buffer-local. @xref{Multiple Displays}.
2383@end defvar
2384
2385@defvar executing-macro 2466@defvar executing-macro
2386This variable contains the string or vector that defines the keyboard 2467This variable contains the string or vector that defines the keyboard
2387macro that is currently executing. It is @code{nil} if no macro is 2468macro that is currently executing. It is @code{nil} if no macro is
@@ -2396,7 +2477,15 @@ command can test this variable to behave differently while a macro is
2396being defined. The commands @code{start-kbd-macro} and 2477being defined. The commands @code{start-kbd-macro} and
2397@code{end-kbd-macro} set this variable---do not set it yourself. 2478@code{end-kbd-macro} set this variable---do not set it yourself.
2398 2479
2399The variable is always local to the current X terminal and cannot be 2480The variable is always local to the current terminal and cannot be
2481buffer-local. @xref{Multiple Displays}.
2482@end defvar
2483
2484@defvar last-kbd-macro
2485This variable is the definition of the most recently defined keyboard
2486macro. Its value is a string or vector, or @code{nil}.
2487
2488The variable is always local to the current terminal and cannot be
2400buffer-local. @xref{Multiple Displays}. 2489buffer-local. @xref{Multiple Displays}.
2401@end defvar 2490@end defvar
2402 2491
diff --git a/lispref/compile.texi b/lispref/compile.texi
index 413adc085a3..7fcaf0f9b76 100644
--- a/lispref/compile.texi
+++ b/lispref/compile.texi
@@ -24,6 +24,12 @@ however, as fast as true compiled code.
24by recent earlier versions of Emacs, but the reverse is not true. In 24by recent earlier versions of Emacs, but the reverse is not true. In
25particular, if you compile a program with Emacs 19.29, the compiled 25particular, if you compile a program with Emacs 19.29, the compiled
26code does not run in earlier versions. 26code does not run in earlier versions.
27@iftex
28@xref{Docs and Compilation}.
29@end iftex
30Files compiled in versions before 19.29 may not work in 19.29 if they
31contain character constants with modifier bits, because the bits were
32renumbered in Emacs 19.29.
27 33
28 @xref{Compilation Errors}, for how to investigate errors occurring in 34 @xref{Compilation Errors}, for how to investigate errors occurring in
29byte compilation. 35byte compilation.
@@ -98,10 +104,13 @@ expanded when they are compiled, so the macros must already be defined
98for proper compilation. For more details, see @ref{Compiling Macros}. 104for proper compilation. For more details, see @ref{Compiling Macros}.
99 105
100 Normally, compiling a file does not evaluate the file's contents or 106 Normally, compiling a file does not evaluate the file's contents or
101load the file. But it does execute any @code{require} calls at 107load the file. But it does execute any @code{require} calls at top
102top level in the file. One way to ensure that necessary macro 108level in the file. One way to ensure that necessary macro definitions
103definitions are available during compilation is to require the file that 109are available during compilation is to require the file that defines
104defines them. @xref{Features}. 110them (@pxref{Named Features}). To avoid loading the macro definition files
111when someone @emph{runs} the compiled program, write
112@code{eval-when-compile} around the @code{require} calls (@pxref{Eval
113During Compile}).
105 114
106@defun byte-compile symbol 115@defun byte-compile symbol
107This function byte-compiles the function definition of @var{symbol}, 116This function byte-compiles the function definition of @var{symbol},
@@ -191,10 +200,10 @@ This function recompiles every @samp{.el} file in @var{directory} that
191needs recompilation. A file needs recompilation if a @samp{.elc} file 200needs recompilation. A file needs recompilation if a @samp{.elc} file
192exists but is older than the @samp{.el} file. 201exists but is older than the @samp{.el} file.
193 202
194If a @samp{.el} file exists, but there is no corresponding @samp{.elc} 203When a @samp{.el} file has no corresponding @samp{.elc} file, then
195file, then @var{flag} says what to do. If it is @code{nil}, the file is 204@var{flag} says what to do. If it is @code{nil}, these files are
196ignored. If it is non-@code{nil}, the user is asked whether to compile 205ignored. If it is non-@code{nil}, the user is asked whether to compile
197the file. 206each such file.
198 207
199The returned value of this command is unpredictable. 208The returned value of this command is unpredictable.
200@end deffn 209@end deffn
@@ -265,7 +274,7 @@ turn off this feature by setting @code{byte-compile-dynamic-docstrings}
265to @code{nil}. Once this is done, you can compile files that will load 274to @code{nil}. Once this is done, you can compile files that will load
266into older Emacs versions. You can do this globally, or for one source 275into older Emacs versions. You can do this globally, or for one source
267file by specifying a file-local binding for the variable. Here's one 276file by specifying a file-local binding for the variable. Here's one
268way: 277way to do that:
269 278
270@example 279@example
271-*-byte-compile-dynamic-docstrings: nil;-*- 280-*-byte-compile-dynamic-docstrings: nil;-*-
@@ -372,7 +381,7 @@ At top level, this is analogous to the Common Lisp idiom
372@end defspec 381@end defspec
373 382
374@node Byte-Code Objects 383@node Byte-Code Objects
375@section Byte-Code Objects 384@section Byte-Code Function Objects
376@cindex compiled function 385@cindex compiled function
377@cindex byte-code function 386@cindex byte-code function
378 387
@@ -408,10 +417,10 @@ symbols used as function names and variable names.
408The maximum stack size this function needs. 417The maximum stack size this function needs.
409 418
410@item docstring 419@item docstring
411The documentation string (if any); otherwise, @code{nil}. For functions 420The documentation string (if any); otherwise, @code{nil}. The value may
412preloaded before Emacs is dumped, this is usually an integer which is an 421be a number or a list, in case the documentation string is stored in a
413index into the @file{DOC} file; use @code{documentation} to convert this 422file. Use the function @code{documentation} to get the real
414into a string (@pxref{Accessing Documentation}). 423documentation string (@pxref{Accessing Documentation}).
415 424
416@item interactive 425@item interactive
417The interactive spec (if any). This can be a string or a Lisp 426The interactive spec (if any). This can be a string or a Lisp
diff --git a/lispref/control.texi b/lispref/control.texi
index aea1c535588..c7367894919 100644
--- a/lispref/control.texi
+++ b/lispref/control.texi
@@ -940,11 +940,11 @@ including those signaled with @code{error}:
940 (if (eq baz 35) 940 (if (eq baz 35)
941 t 941 t
942 ;; @r{This is a call to the function @code{error}.} 942 ;; @r{This is a call to the function @code{error}.}
943 (error "Rats! The variable %s was %s, not 35." 'baz baz)) 943 (error "Rats! The variable %s was %s, not 35" 'baz baz))
944 ;; @r{This is the handler; it is not a form.} 944 ;; @r{This is the handler; it is not a form.}
945 (error (princ (format "The error was: %s" err)) 945 (error (princ (format "The error was: %s" err))
946 2)) 946 2))
947@print{} The error was: (error "Rats! The variable baz was 34, not 35.") 947@print{} The error was: (error "Rats! The variable baz was 34, not 35")
948@result{} 2 948@result{} 2
949@end group 949@end group
950@end smallexample 950@end smallexample
@@ -1005,6 +1005,9 @@ message @samp{peculiar error} is used.
1005This error has three condition names: @code{new-error}, the narrowest 1005This error has three condition names: @code{new-error}, the narrowest
1006classification; @code{my-own-errors}, which we imagine is a wider 1006classification; @code{my-own-errors}, which we imagine is a wider
1007classification; and @code{error}, which is the widest of all. 1007classification; and @code{error}, which is the widest of all.
1008
1009 The error string should start with a capital letter but it should
1010not end with a period. This is for consistency with the rest of Emacs.
1008 1011
1009 Naturally, Emacs will never signal @code{new-error} on its own; only 1012 Naturally, Emacs will never signal @code{new-error} on its own; only
1010an explicit call to @code{signal} (@pxref{Signaling Errors}) in your 1013an explicit call to @code{signal} (@pxref{Signaling Errors}) in your
diff --git a/lispref/debugging.texi b/lispref/debugging.texi
index 3fa300d02f9..6775323049d 100644
--- a/lispref/debugging.texi
+++ b/lispref/debugging.texi
@@ -172,8 +172,8 @@ for @var{function-name} in the minibuffer.
172 If the function is already set up to invoke the debugger on entry, 172 If the function is already set up to invoke the debugger on entry,
173@code{debug-on-entry} does nothing. 173@code{debug-on-entry} does nothing.
174 174
175 Caveat: if you redefine a function after using @code{debug-on-entry} 175 @strong{Note:} if you redefine a function after using
176on it, the code to enter the debugger is lost. 176@code{debug-on-entry} on it, the code to enter the debugger is lost.
177 177
178 @code{debug-on-entry} returns @var{function-name}. 178 @code{debug-on-entry} returns @var{function-name}.
179 179
@@ -217,7 +217,8 @@ Entering:
217@deffn Command cancel-debug-on-entry function-name 217@deffn Command cancel-debug-on-entry function-name
218This function undoes the effect of @code{debug-on-entry} on 218This function undoes the effect of @code{debug-on-entry} on
219@var{function-name}. When called interactively, it prompts for 219@var{function-name}. When called interactively, it prompts for
220@var{function-name} in the minibuffer. 220@var{function-name} in the minibuffer. If @var{function-name} is
221@code{nil} or the empty string, it cancels debugging for all functions.
221 222
222If @code{cancel-debug-on-entry} is called more than once on the same 223If @code{cancel-debug-on-entry} is called more than once on the same
223function, the second call does nothing. @code{cancel-debug-on-entry} 224function, the second call does nothing. @code{cancel-debug-on-entry}
@@ -329,12 +330,12 @@ cancels a @kbd{b} command on that frame.
329 330
330@item e 331@item e
331Read a Lisp expression in the minibuffer, evaluate it, and print the 332Read a Lisp expression in the minibuffer, evaluate it, and print the
332value in the echo area. The debugger alters certain important variables 333value in the echo area. The debugger alters certain important
333as part of its operation; @kbd{e} temporarily restores their 334variables, and the current buffer, as part of its operation; @kbd{e}
334outside-the-debugger values so you can examine them. This makes the 335temporarily restores their outside-the-debugger values so you can
335debugger more transparent. By contrast, @kbd{M-@key{ESC}} does nothing 336examine them. This makes the debugger more transparent. By contrast,
336special in the debugger; it shows you the variable values within the 337@kbd{M-:} does nothing special in the debugger; it shows you the
337debugger. 338variable values within the debugger.
338 339
339@item q 340@item q
340Terminate the program being debugged; return to top-level Emacs 341Terminate the program being debugged; return to top-level Emacs
@@ -376,7 +377,7 @@ whatever called @code{debug}. This is the only way the function
376 377
377If the first of the @var{debugger-args} passed to @code{debug} is 378If the first of the @var{debugger-args} passed to @code{debug} is
378@code{nil} (or if it is not one of the special values in the table 379@code{nil} (or if it is not one of the special values in the table
379below), then @code{debug} displays the rest of its arguments at the the 380below), then @code{debug} displays the rest of its arguments at the
380top of the @samp{*Backtrace*} buffer. This mechanism is used to display 381top of the @samp{*Backtrace*} buffer. This mechanism is used to display
381a message to the user. 382a message to the user.
382 383
@@ -564,7 +565,7 @@ This function is used only by the debugger.
564@end defun 565@end defun
565 566
566@defvar command-debug-status 567@defvar command-debug-status
567This variable records the debugging status of current interactive 568This variable records the debugging status of the current interactive
568command. Each time a command is called interactively, this variable is 569command. Each time a command is called interactively, this variable is
569bound to @code{nil}. The debugger can set this variable to leave 570bound to @code{nil}. The debugger can set this variable to leave
570information for future debugger invocations during the same command. 571information for future debugger invocations during the same command.
diff --git a/lispref/display.texi b/lispref/display.texi
index 146dee69531..8545f23b8c2 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -45,6 +45,11 @@ Even more powerful is @code{redraw-display}:
45This function clears and redisplays all visible frames. 45This function clears and redisplays all visible frames.
46@end deffn 46@end deffn
47 47
48 Processing user input takes absolute priority over redisplay. If you
49call these functions when input is available, they do nothing
50immediately, but a full redisplay does happen eventually---after all the
51input has been processed.
52
48 Normally, suspending and resuming Emacs also refreshes the screen. 53 Normally, suspending and resuming Emacs also refreshes the screen.
49Some terminal emulators record separate contents for display-oriented 54Some terminal emulators record separate contents for display-oriented
50programs such as Emacs and for ordinary sequential display. If you are 55programs such as Emacs and for ordinary sequential display. If you are
@@ -59,11 +64,6 @@ has been suspended and resumed. Non-@code{nil} means yes, @code{nil}
59means no. 64means no.
60@end defvar 65@end defvar
61 66
62 Processing user input takes absolute priority over redisplay. If you
63call these functions when input is available, they do nothing
64immediately, but a full redisplay does happen eventually---after all the
65input has been processed.
66
67@node Screen Size 67@node Screen Size
68@section Screen Size 68@section Screen Size
69@cindex size of screen 69@cindex size of screen
@@ -154,10 +154,10 @@ then truncation is always used for side-by-side windows (within one
154frame) regardless of the value of @code{truncate-lines}. 154frame) regardless of the value of @code{truncate-lines}.
155@end defopt 155@end defopt
156 156
157@defvar default-truncate-lines 157@defopt default-truncate-lines
158This variable is the default value for @code{truncate-lines}, for 158This variable is the default value for @code{truncate-lines}, for
159buffers that do not have local values for it. 159buffers that do not have local values for it.
160@end defvar 160@end defopt
161 161
162@defopt truncate-partial-width-windows 162@defopt truncate-partial-width-windows
163This variable controls display of lines that extend beyond the right 163This variable controls display of lines that extend beyond the right
@@ -171,15 +171,17 @@ with the display table; see @ref{Display Tables}.
171 171
172 If your buffer contains @strong{very} long lines, and you use 172 If your buffer contains @strong{very} long lines, and you use
173continuation to display them, just thinking about them can make Emacs 173continuation to display them, just thinking about them can make Emacs
174redisplay slow. 174redisplay slow. The column computation and indentation functions also
175become slow. Then you might find it advisable to set
176@code{cache-long-line-scans} to @code{t}.
175 177
176@defvar cache-long-line-scans 178@defvar cache-long-line-scans
177If this variable is non-@code{nil}, various indentation and motion 179If this variable is non-@code{nil}, various indentation and motion
178functions, and Emacs redisplay, cache the results of their scans for 180functions, and Emacs redisplay, cache the results of scanning the
179newlines, and consult the cache to avoid rescanning regions of the 181buffer, and consult the cache to avoid rescanning regions of the buffer
180buffer unless they are modified. 182unless they are modified.
181 183
182Turning on the newline cache slows down processing of short lines. 184Turning on the cache slows down processing of short lines somewhat.
183 185
184This variable is automatically local in every buffer. 186This variable is automatically local in every buffer.
185@end defvar 187@end defvar
@@ -248,6 +250,17 @@ how to display a message and prevent it from being logged:
248@end example 250@end example
249@end defopt 251@end defopt
250 252
253@defvar echo-keystrokes
254This variable determines how much time should elapse before command
255characters echo. Its value must be an integer, which specifies the
256number of seconds to wait before echoing. If the user types a prefix
257key (such as @kbd{C-x}) and then delays this many seconds before
258continuing, the prefix key is echoed in the echo area. Any subsequent
259characters in the same command will be echoed as well.
260
261If the value is zero, then command input is not echoed.
262@end defvar
263
251@defvar cursor-in-echo-area 264@defvar cursor-in-echo-area
252This variable controls where the cursor appears when a message is 265This variable controls where the cursor appears when a message is
253displayed in the echo area. If it is non-@code{nil}, then the cursor 266displayed in the echo area. If it is non-@code{nil}, then the cursor
@@ -284,7 +297,7 @@ especially useful in a program to display the list of entries in a data
284base. It permits the implementation of convenient filtering commands to 297base. It permits the implementation of convenient filtering commands to
285view just a part of the entries in the data base. Setting this variable 298view just a part of the entries in the data base. Setting this variable
286is very fast, much faster than scanning all the text in the buffer 299is very fast, much faster than scanning all the text in the buffer
287looking for things to change. 300looking for properties to change.
288 301
289@defvar buffer-invisibility-spec 302@defvar buffer-invisibility-spec
290This variable specifies which kinds of @code{invisible} properties 303This variable specifies which kinds of @code{invisible} properties
@@ -314,13 +327,16 @@ by a visible newline, it displays an ellipsis.
314@end table 327@end table
315@end defvar 328@end defvar
316 329
330 Ordinarily, commands that operate on text or move point do not care
331whether the text is invisible. However, the user-level line motion
332commands explicitly ignore invisible newlines.
333
317@node Selective Display 334@node Selective Display
318@section Selective Display 335@section Selective Display
319@cindex selective display 336@cindex selective display
320 337
321 @dfn{Selective display} is a class of minor modes in which specially 338 @dfn{Selective display} is a pair of features that hide certain
322marked lines do not appear on the screen, or in which highly indented 339lines on the screen.
323lines do not appear.
324 340
325 The first variant, explicit selective display, is designed for use in 341 The first variant, explicit selective display, is designed for use in
326a Lisp program. The program controls which lines are hidden by altering 342a Lisp program. The program controls which lines are hidden by altering
@@ -329,7 +345,7 @@ been partially replaced by the invisible text feature (@pxref{Invisible
329Text}); there is a new version of Outline mode which uses that instead. 345Text}); there is a new version of Outline mode which uses that instead.
330 346
331 In the second variant, the choice of lines to hide is made 347 In the second variant, the choice of lines to hide is made
332automatically based on indentation. This variant is designed as a 348automatically based on indentation. This variant is designed to be a
333user-level feature. 349user-level feature.
334 350
335 The way you control explicit selective display is by replacing a 351 The way you control explicit selective display is by replacing a
@@ -469,9 +485,7 @@ given time.
469 485
470 Temporary displays are used by commands to put output into a buffer 486 Temporary displays are used by commands to put output into a buffer
471and then present it to the user for perusal rather than for editing. 487and then present it to the user for perusal rather than for editing.
472Many of the help commands use this feature. Nowadays you can do the 488Many of the help commands use this feature.
473same job by creating an overlay with a @code{before-string} property.
474@xref{Overlay Properties}.
475 489
476@defspec with-output-to-temp-buffer buffer-name forms@dots{} 490@defspec with-output-to-temp-buffer buffer-name forms@dots{}
477This function executes @var{forms} while arranging to insert any 491This function executes @var{forms} while arranging to insert any
@@ -539,6 +553,10 @@ the display and later (presumably) move point forward. The argument
539 553
540The return value of @code{momentary-string-display} is not meaningful. 554The return value of @code{momentary-string-display} is not meaningful.
541 555
556If the string @var{string} does not contain control characters, you can
557do the same job in a more general way by creating an overlay with a
558@code{before-string} property. @xref{Overlay Properties}.
559
542If @var{message} is non-@code{nil}, it is displayed in the echo area 560If @var{message} is non-@code{nil}, it is displayed in the echo area
543while @var{string} is displayed in the buffer. If it is @code{nil}, a 561while @var{string} is displayed in the buffer. If it is @code{nil}, a
544default message says to type @var{char} to continue. 562default message says to type @var{char} to continue.
@@ -580,10 +598,10 @@ Type RET when done reading
580@cindex overlays 598@cindex overlays
581 599
582You can use @dfn{overlays} to alter the appearance of a buffer's text on 600You can use @dfn{overlays} to alter the appearance of a buffer's text on
583the screen. An overlay is an object that belongs to a particular 601the screen, for the sake of presentation features. An overlay is an
584buffer, and has a specified beginning and end. It also has properties 602object that belongs to a particular buffer, and has a specified
585that you can examine and set; these affect the display of the text 603beginning and end. It also has properties that you can examine and set;
586within the overlay. 604these affect the display of the text within the overlay.
587 605
588@menu 606@menu
589* Overlay Properties:: How to read and set properties. 607* Overlay Properties:: How to read and set properties.
@@ -626,7 +644,7 @@ applies only on that window.
626@item category 644@item category
627@kindex category @r{(overlay property)} 645@kindex category @r{(overlay property)}
628If an overlay has a @code{category} property, we call it the 646If an overlay has a @code{category} property, we call it the
629@dfn{category} of the character. It should be a symbol. The properties 647@dfn{category} of the overlay. It should be a symbol. The properties
630of the symbol serve as defaults for the properties of the overlay. 648of the symbol serve as defaults for the properties of the overlay.
631 649
632@item face 650@item face
@@ -662,7 +680,7 @@ overlay, @code{t}, the beginning and end of the text range just
662modified, and the length of the pre-change text replaced by that range. 680modified, and the length of the pre-change text replaced by that range.
663(For an insertion, the pre-change length is zero; for a deletion, that 681(For an insertion, the pre-change length is zero; for a deletion, that
664length is the number of characters deleted, and the post-change 682length is the number of characters deleted, and the post-change
665beginning and end are at the same place.) 683beginning and end are equal.)
666 684
667@item insert-in-front-hooks 685@item insert-in-front-hooks
668@kindex insert-in-front-hooks @r{(overlay property)} 686@kindex insert-in-front-hooks @r{(overlay property)}
@@ -685,7 +703,7 @@ invisible, which means that it does not appear on the screen.
685@item intangible 703@item intangible
686@kindex intangible @r{(overlay property)} 704@kindex intangible @r{(overlay property)}
687The @code{intangible} property on an overlay works just like the 705The @code{intangible} property on an overlay works just like the
688@code{intangible} text propert. @xref{Special Properties}, for details. 706@code{intangible} text property. @xref{Special Properties}, for details.
689 707
690@item before-string 708@item before-string
691@kindex before-string @r{(overlay property)} 709@kindex before-string @r{(overlay property)}
@@ -891,6 +909,10 @@ With overlays. An overlay may have @code{face} and @code{mouse-face}
891properties too; they apply to all the text covered by the overlay. 909properties too; they apply to all the text covered by the overlay.
892 910
893@item 911@item
912With a region that is active. In Transient Mark mode, the region is
913highlighted with a particular face (see @code{region-face}, below).
914
915@item
894With special glyphs. Each glyph can specify a particular face id 916With special glyphs. Each glyph can specify a particular face id
895number. @xref{Glyphs}. 917number. @xref{Glyphs}.
896@end itemize 918@end itemize
@@ -898,6 +920,7 @@ number. @xref{Glyphs}.
898 If these various sources together specify more than one face for a 920 If these various sources together specify more than one face for a
899particular character, Emacs merges the attributes of the various faces 921particular character, Emacs merges the attributes of the various faces
900specified. The attributes of the faces of special glyphs come first; 922specified. The attributes of the faces of special glyphs come first;
923then comes the face for region highlighting, if appropriate;
901then come attributes of faces from overlays, followed by those from text 924then come attributes of faces from overlays, followed by those from text
902properties, and last the default face. 925properties, and last the default face.
903 926
@@ -951,6 +974,19 @@ new frames.
951These functions set the foreground (or background, respectively) color 974These functions set the foreground (or background, respectively) color
952of face @var{face} to @var{color}. The argument @var{color} should be a 975of face @var{face} to @var{color}. The argument @var{color} should be a
953string, the name of a color. 976string, the name of a color.
977
978Certain shades of gray are implemented by stipple patterns on
979black-and-white screens.
980@end defun
981
982@defun set-face-stipple face pattern &optional frame
983This function sets the background stipple pattern of face @var{face} to
984@var{pattern}. The argument @var{pattern} should be the name of a
985stipple pattern defined by the X server, or @code{nil} meaning don't use
986stipple.
987
988Normally there is no need to pay attention to stipple patterns, because
989they are used automatically to handle certain shades of gray.
954@end defun 990@end defun
955 991
956@defun set-face-font face font &optional frame 992@defun set-face-font face font &optional frame
@@ -979,6 +1015,11 @@ These functions return the foreground color (or background color,
979respectively) of face @var{face}, as a string. 1015respectively) of face @var{face}, as a string.
980@end defun 1016@end defun
981 1017
1018@defun face-stipple face &optional frame
1019This function returns the name of the background stipple pattern of face
1020@var{face}, or @code{nil} if it doesn't have one.
1021@end defun
1022
982@defun face-font face &optional frame 1023@defun face-font face &optional frame
983This function returns the name of the font of face @var{face}. 1024This function returns the name of the font of face @var{face}.
984@end defun 1025@end defun
@@ -987,7 +1028,7 @@ This function returns the name of the font of face @var{face}.
987This function returns the underline attribute of face @var{face}. 1028This function returns the underline attribute of face @var{face}.
988@end defun 1029@end defun
989 1030
990@defun face-id-number face 1031@defun face-id face
991This function returns the face id number of face @var{face}. 1032This function returns the face id number of face @var{face}.
992@end defun 1033@end defun
993 1034
@@ -1048,6 +1089,12 @@ This variable specifies the maximum distance to scan for a matching
1048parenthesis before giving up. 1089parenthesis before giving up.
1049@end defvar 1090@end defvar
1050 1091
1092@defvar blink-matching-paren-delay
1093This variable specifies the number of seconds for the cursor to remain
1094at the matching parenthesis. A fraction of a second often gives
1095good results, but the default is 1, which works on all systems.
1096@end defvar
1097
1051@defun blink-matching-open 1098@defun blink-matching-open
1052This function is the default value of @code{blink-paren-function}. It 1099This function is the default value of @code{blink-paren-function}. It
1053assumes that point follows a character with close parenthesis syntax and 1100assumes that point follows a character with close parenthesis syntax and
@@ -1089,10 +1136,13 @@ default is @code{nil}.
1089 1136
1090@defopt mode-line-inverse-video 1137@defopt mode-line-inverse-video
1091This variable controls the use of inverse video for mode lines. If it 1138This variable controls the use of inverse video for mode lines. If it
1092is non-@code{nil}, then mode lines are displayed in inverse video (under 1139is non-@code{nil}, then mode lines are displayed in inverse video.
1093X, this uses the face named @code{modeline}, which you can set as you 1140Otherwise, mode lines are displayed normally, just like text. The
1094wish). Otherwise, mode lines are displayed normally, just like text. 1141default is @code{t}.
1095The default is @code{t}. 1142
1143For X window frames, this displays mode lines using the face named
1144@code{modeline}, which is normally the inverse of the default face
1145unless you change it.
1096@end defopt 1146@end defopt
1097 1147
1098@node Usual Display 1148@node Usual Display
@@ -1132,7 +1182,7 @@ specify a glyph to use instead of @samp{\}.)
1132 The usual display conventions apply even when there is a display 1182 The usual display conventions apply even when there is a display
1133table, for any character whose entry in the active display table is 1183table, for any character whose entry in the active display table is
1134@code{nil}. Thus, when you set up a display table, you need only 1184@code{nil}. Thus, when you set up a display table, you need only
1135specify the the characters for which you want unusual behavior. 1185specify the characters for which you want unusual behavior.
1136 1186
1137 These variables affect the way certain characters are displayed on the 1187 These variables affect the way certain characters are displayed on the
1138screen. Since they change the number of columns the characters occupy, 1188screen. Since they change the number of columns the characters occupy,
@@ -1390,11 +1440,6 @@ running under X) or @code{nil} (if Emacs is running on an ordinary
1390terminal). 1440terminal).
1391@end defvar 1441@end defvar
1392 1442
1393@defvar window-system-version
1394This variable distinguishes between different versions of the X Window
1395System. Its value is 10 or 11 when using X; @code{nil} otherwise.
1396@end defvar
1397
1398@defvar window-setup-hook 1443@defvar window-setup-hook
1399This variable is a normal hook which Emacs runs after loading your 1444This variable is a normal hook which Emacs runs after loading your
1400@file{.emacs} file and the default initialization file (if any), after 1445@file{.emacs} file and the default initialization file (if any), after
diff --git a/lispref/edebug.texi b/lispref/edebug.texi
index f32b516199e..5aec9f96f46 100644
--- a/lispref/edebug.texi
+++ b/lispref/edebug.texi
@@ -214,7 +214,7 @@ must tell it; @xref{Instrumenting Macro Calls}, for details.
214definition in a way that does not instrument. There are two ways of 214definition in a way that does not instrument. There are two ways of
215evaluating forms that never instrument them: from a file with 215evaluating forms that never instrument them: from a file with
216@code{load}, and from the minibuffer with @code{eval-expression} 216@code{load}, and from the minibuffer with @code{eval-expression}
217(@kbd{M-ESC}). 217(@kbd{M-:}).
218 218
219 If Edebug detects a syntax error while instrumenting, it leaves point 219 If Edebug detects a syntax error while instrumenting, it leaves point
220at the erroneous code and signals an @code{invalid-read-syntax} error. 220at the erroneous code and signals an @code{invalid-read-syntax} error.
@@ -626,7 +626,7 @@ Evaluate expression @var{exp} in the context outside of Edebug
626(@code{edebug-eval-expression}). That is, Edebug tries to minimize its 626(@code{edebug-eval-expression}). That is, Edebug tries to minimize its
627interference with the evaluation. 627interference with the evaluation.
628 628
629@item M-@key{ESC} @var{exp} @key{RET} 629@item M-: @var{exp} @key{RET}
630Evaluate expression @var{exp} in the context of Edebug itself. 630Evaluate expression @var{exp} in the context of Edebug itself.
631 631
632@item C-x C-e 632@item C-x C-e
diff --git a/lispref/elisp.texi b/lispref/elisp.texi
index e1e21b9417c..5ac4053d662 100644
--- a/lispref/elisp.texi
+++ b/lispref/elisp.texi
@@ -180,8 +180,6 @@ Appendices
180* Standard Keymaps:: List of standard keymaps. 180* Standard Keymaps:: List of standard keymaps.
181* Standard Hooks:: List of standard hook variables. 181* Standard Hooks:: List of standard hook variables.
182 182
183* Antinews:: Information about Emacs 18.
184
185* Index:: Index including concepts, functions, variables, 183* Index:: Index including concepts, functions, variables,
186 and other terms. 184 and other terms.
187 185
@@ -422,7 +420,7 @@ Loading
422 420
423* How Programs Do Loading:: The @code{load} function and others. 421* How Programs Do Loading:: The @code{load} function and others.
424* Autoload:: Setting up a function to autoload. 422* Autoload:: Setting up a function to autoload.
425* Features:: Loading a library if it isn't already loaded. 423* Named Features:: Loading a library if it isn't already loaded.
426* Repeated Loading:: Precautions about loading a file twice. 424* Repeated Loading:: Precautions about loading a file twice.
427 425
428Byte Compilation 426Byte Compilation
@@ -650,6 +648,32 @@ Windows
650* Resizing Windows:: Changing the size of a window. 648* Resizing Windows:: Changing the size of a window.
651* Window Configurations:: Saving and restoring the state of the screen. 649* Window Configurations:: Saving and restoring the state of the screen.
652 650
651Frames
652
653* Creating Frames:: Creating additional frames.
654* Multiple Displays:: Creating frames on other X displays.
655* Frame Parameters:: Controlling frame size, position, font, etc.
656* Frame Titles:: Automatic updating of frame titles.
657* Deleting Frames:: Frames last until explicitly deleted.
658* Finding All Frames:: How to examine all existing frames.
659* Frames and Windows:: A frame contains windows;
660 display of text always works through windows.
661* Minibuffers and Frames:: How a frame finds the minibuffer to use.
662* Input Focus:: Specifying the selected frame.
663* Visibility of Frames:: Frames may be visible or invisible, or icons.
664* Raising and Lowering:: Raising a frame makes it hide other X windows;
665 lowering it makes the others hide them.
666* Frame Configurations:: Saving the state of all frames.
667* Mouse Tracking:: Getting events that say when the mouse moves.
668* Mouse Position:: Asking where the mouse is, or moving it.
669* Pop-Up Menus:: Displaying a menu for the user to select from.
670* Dialog Boxes:: Displaying a box to ask yes or no.
671* Pointer Shapes:: Specifying the shape of the mouse pointer.
672* X Selections:: Transferring text to and from other X clients.
673* Color Names:: Getting the definitions of color names.
674* Resources:: Getting resource values from the server.
675* Server Data:: Getting info about the X server.
676
653Positions 677Positions
654 678
655* Point:: The special position where editing takes place. 679* Point:: The special position where editing takes place.
@@ -664,8 +688,6 @@ Motion
664* Buffer End Motion:: Moving to the beginning or end of the buffer. 688* Buffer End Motion:: Moving to the beginning or end of the buffer.
665* Text Lines:: Moving in terms of lines of text. 689* Text Lines:: Moving in terms of lines of text.
666* Screen Lines:: Moving in terms of lines as displayed. 690* Screen Lines:: Moving in terms of lines as displayed.
667* Vertical Motion:: Implementation of @code{next-line} and
668 @code{previous-line}.
669* List Motion:: Moving by parsing lists and sexps. 691* List Motion:: Moving by parsing lists and sexps.
670* Skipping Characters:: Skipping characters belonging to a certain set. 692* Skipping Characters:: Skipping characters belonging to a certain set.
671 693
@@ -693,6 +715,7 @@ Text
693* Undo:: Undoing changes to the text of a buffer. 715* Undo:: Undoing changes to the text of a buffer.
694* Auto Filling:: How auto-fill mode is implemented to break lines. 716* Auto Filling:: How auto-fill mode is implemented to break lines.
695* Filling:: Functions for explicit filling. 717* Filling:: Functions for explicit filling.
718* Margins:: How to specify margins for filling commands.
696* Sorting:: Functions for sorting parts of the buffer. 719* Sorting:: Functions for sorting parts of the buffer.
697* Indentation:: Functions to insert or adjust indentation. 720* Indentation:: Functions to insert or adjust indentation.
698* Columns:: Computing horizontal positions, and using them. 721* Columns:: Computing horizontal positions, and using them.
@@ -769,7 +792,7 @@ Processes
769 an asynchronous subprocess. 792 an asynchronous subprocess.
770* Output from Processes:: Collecting output from an asynchronous subprocess. 793* Output from Processes:: Collecting output from an asynchronous subprocess.
771* Sentinels:: Sentinels run when process run-status changes. 794* Sentinels:: Sentinels run when process run-status changes.
772* TCP:: Opening network connections. 795* Network:: Opening network connections.
773 796
774Receiving Output from Processes 797Receiving Output from Processes
775 798
@@ -886,7 +909,6 @@ Object Internals
886@include locals.texi 909@include locals.texi
887@include maps.texi 910@include maps.texi
888@include hooks.texi 911@include hooks.texi
889@include anti.texi
890 912
891@include index.texi 913@include index.texi
892 914
diff --git a/lispref/errors.texi b/lispref/errors.texi
index 8cedced5c32..36290012285 100644
--- a/lispref/errors.texi
+++ b/lispref/errors.texi
@@ -52,6 +52,10 @@ See @code{/} and @code{%} in @ref{Numbers}.
52@code{"Buffer is read-only"}@* 52@code{"Buffer is read-only"}@*
53@xref{Read Only Buffers}. 53@xref{Read Only Buffers}.
54 54
55@item cyclic-function-indirection
56@code{"Symbol's chain of function indirections contains a loop"}@*
57@xref{Function Indirection}.
58
55@item end-of-buffer 59@item end-of-buffer
56@code{"End of buffer"}@* 60@code{"End of buffer"}@*
57@xref{Motion}. 61@xref{Motion}.
@@ -105,6 +109,10 @@ The values of the symbols @code{nil} and @code{t}
105may not be changed.@* 109may not be changed.@*
106@xref{Constant Variables, , Variables that Never Change}. 110@xref{Constant Variables, , Variables that Never Change}.
107 111
112@item undefined-color
113@code{"Undefined color"}@*
114@xref{Color Names}.
115
108@item void-function 116@item void-function
109@code{"Symbol's function definition is void"}@* 117@code{"Symbol's function definition is void"}@*
110@xref{Function Cells}. 118@xref{Function Cells}.
@@ -121,3 +129,29 @@ may not be changed.@*
121@code{"Wrong type argument"}@* 129@code{"Wrong type argument"}@*
122@xref{Type Predicates}. 130@xref{Type Predicates}.
123@end table 131@end table
132
133 These error types, which are all classified as special cases of
134@code{arith-error}, can occur on certain systems for invalid use of
135mathematical functions.
136
137@table @code
138@item domain-error
139@code{"Arithmetic domain error"}@*
140@xref{Math Functions}.
141
142@item overflow-error
143@code{"Arithmetic overflow error"}@*
144@xref{Math Functions}.
145
146@item range-error
147@code{"Arithmetic range error"}@*
148@xref{Math Functions}.
149
150@item singularity-error
151@code{"Arithmetic singularity error"}@*
152@xref{Math Functions}.
153
154@item underflow-error
155@code{"Arithmetic underflow error"}@*
156@xref{Math Functions}.
157@end table
diff --git a/lispref/eval.texi b/lispref/eval.texi
index 1bbd672f5fc..494a8145baf 100644
--- a/lispref/eval.texi
+++ b/lispref/eval.texi
@@ -73,6 +73,12 @@ of the form @code{(car x)}: the subform @code{x} must first be evaluated
73recursively, so that its value can be passed as an argument to the 73recursively, so that its value can be passed as an argument to the
74function @code{car}. 74function @code{car}.
75 75
76 Evaluation of a function call ultimately calls the function specified
77in it. @xref{Functions}. The execution of the function may itself work
78by evaluating the function definition; or the function may be a Lisp
79primitive implemented in C, or it may be a byte-compiled function
80(@pxref{Byte Compilation}).
81
76@cindex environment 82@cindex environment
77 The evaluation of forms takes place in a context called the 83 The evaluation of forms takes place in a context called the
78@dfn{environment}, which consists of the current values and bindings of 84@dfn{environment}, which consists of the current values and bindings of
@@ -90,17 +96,12 @@ is complete. The form may also make changes that persist; these changes
90are called @dfn{side effects}. An example of a form that produces side 96are called @dfn{side effects}. An example of a form that produces side
91effects is @code{(setq foo 1)}. 97effects is @code{(setq foo 1)}.
92 98
93 Finally, evaluation of one particular function call, @code{byte-code},
94invokes the @dfn{byte-code interpreter} on its arguments. Although the
95byte-code interpreter is not the same as the Lisp interpreter, it uses
96the same environment as the Lisp interpreter, and may on occasion invoke
97the Lisp interpreter. (@xref{Byte Compilation}.)
98
99 The details of what evaluation means for each kind of form are 99 The details of what evaluation means for each kind of form are
100described below (@pxref{Forms}). 100described below (@pxref{Forms}).
101 101
102@node Eval 102@node Eval
103@section Eval 103@section Eval
104@c ??? Perhaps this should be the last section in the chapter.
104 105
105 Most often, forms are evaluated automatically, by virtue of their 106 Most often, forms are evaluated automatically, by virtue of their
106occurrence in a program being run. On rare occasions, you may need to 107occurrence in a program being run. On rare occasions, you may need to
@@ -108,10 +109,14 @@ write code that evaluates a form that is computed at run time, such as
108after reading a form from text being edited or getting one from a 109after reading a form from text being edited or getting one from a
109property list. On these occasions, use the @code{eval} function. 110property list. On these occasions, use the @code{eval} function.
110 111
111 The functions and variables described in this section evaluate 112 @strong{Note:} it is generally cleaner and more flexible to call
112forms, specify limits to the evaluation process, or record recently 113functions that are stored in data structures, rather than to evaluate
113returned values. Loading a file also does evaluation 114expressions stored in data structures. Using functions provides the
114(@pxref{Loading}). 115ability to pass information to them as arguments.
116
117 The functions and variables described in this section evaluate forms,
118specify limits to the evaluation process, or record recently returned
119values. Loading a file also does evaluation (@pxref{Loading}).
115 120
116@defun eval form 121@defun eval form
117This is the basic function for performing evaluation. It evaluates 122This is the basic function for performing evaluation. It evaluates
@@ -143,19 +148,6 @@ The number of currently active calls to @code{eval} is limited to
143@code{max-lisp-eval-depth} (see below). 148@code{max-lisp-eval-depth} (see below).
144@end defun 149@end defun
145 150
146@cindex evaluation of buffer contents
147@deffn Command eval-current-buffer &optional stream
148This function evaluates the forms in the current buffer. It reads
149forms from the buffer and calls @code{eval} on them until the end of the
150buffer is reached, or until an error is signaled and not handled.
151
152If @var{stream} is supplied, the variable @code{standard-output} is
153bound to @var{stream} during the evaluation (@pxref{Output
154Functions}).
155
156@code{eval-current-buffer} always returns @code{nil}.
157@end deffn
158
159@deffn Command eval-region start end &optional stream 151@deffn Command eval-region start end &optional stream
160This function evaluates the forms in the current buffer in the region 152This function evaluates the forms in the current buffer in the region
161defined by the positions @var{start} and @var{end}. It reads forms from 153defined by the positions @var{start} and @var{end}. It reads forms from
@@ -172,6 +164,12 @@ expressions. @xref{How Programs Do Loading}.
172@code{eval-region} always returns @code{nil}. 164@code{eval-region} always returns @code{nil}.
173@end deffn 165@end deffn
174 166
167@cindex evaluation of buffer contents
168@deffn Command eval-current-buffer &optional stream
169This is like @code{eval-region} except that it operates on the whole
170buffer.
171@end deffn
172
175@defvar max-lisp-eval-depth 173@defvar max-lisp-eval-depth
176This variable defines the maximum depth allowed in calls to @code{eval}, 174This variable defines the maximum depth allowed in calls to @code{eval},
177@code{apply}, and @code{funcall} before an error is signaled (with error 175@code{apply}, and @code{funcall} before an error is signaled (with error
@@ -296,9 +294,9 @@ unchanged.
296 It is common to write numbers, characters, strings, and even vectors 294 It is common to write numbers, characters, strings, and even vectors
297in Lisp code, taking advantage of the fact that they self-evaluate. 295in Lisp code, taking advantage of the fact that they self-evaluate.
298However, it is quite unusual to do this for types that lack a read 296However, it is quite unusual to do this for types that lack a read
299syntax, because there's no way to write them textually; however, it is 297syntax, because there's no way to write them textually. It is possible
300possible to construct Lisp expressions containing these types by means 298to construct Lisp expressions containing these types by means of a Lisp
301of a Lisp program. Here is an example: 299program. Here is an example:
302 300
303@example 301@example
304@group 302@group
@@ -654,14 +652,15 @@ definition loaded from that file. @xref{Autoload}.
654@section Quoting 652@section Quoting
655@cindex quoting 653@cindex quoting
656 654
657 The special form @code{quote} returns its single argument 655 The special form @code{quote} returns its single argument, as written,
658``unchanged''. 656without evaluating it. This provides a way to include constant symbols
657and lists, which are not self-evaluating objects, in a program. (It is
658not necessary to quote self-evaluating objects such as numbers, strings,
659and vectors.)
659 660
660@defspec quote object 661@defspec quote object
661This special form returns @var{object}, without evaluating it. This 662This special form returns @var{object}, without evaluating it.
662provides a way to include constant symbols and lists, which are not 663@end defspec
663self-evaluating objects, in a program. (It is not necessary to quote
664self-evaluating objects such as numbers, strings, and vectors.)
665 664
666@cindex @samp{'} for quoting 665@cindex @samp{'} for quoting
667@cindex quoting using apostrophe 666@cindex quoting using apostrophe
@@ -700,9 +699,8 @@ Here are some examples of expressions that use @code{quote}:
700 @result{} [(quote foo)] 699 @result{} [(quote foo)]
701@end group 700@end group
702@end example 701@end example
703@end defspec
704 702
705 Other quoting constructs include @code{function} (@pxref{Anonymous 703 Other quoting constructs include @code{function} (@pxref{Anonymous
706Functions}), which causes an anonymous lambda expression written in Lisp 704Functions}), which causes an anonymous lambda expression written in Lisp
707to be compiled, and @code{`} (@pxref{Backquote}), which is used to quote 705to be compiled, and @samp{`} (@pxref{Backquote}), which is used to quote
708only part of a list, while computing and substituting other parts. 706only part of a list, while computing and substituting other parts.
diff --git a/lispref/files.texi b/lispref/files.texi
index cfcab286d7b..1fa70df853d 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -79,6 +79,11 @@ For historical reasons, these functions have names starting with
79functions and variables that access the visited file name of a buffer or 79functions and variables that access the visited file name of a buffer or
80that find an existing buffer by its visited file name. 80that find an existing buffer by its visited file name.
81 81
82 In a Lisp program, if you want to look at the contents of a file but
83not alter it, the fastest way is to use @code{insert-file-contents} in a
84temporary buffer. Visiting the file is not necessary and takes longer.
85@xref{Reading from Files}.
86
82@deffn Command find-file filename 87@deffn Command find-file filename
83This command selects a buffer visiting the file @var{filename}, 88This command selects a buffer visiting the file @var{filename},
84using an existing buffer if there is one, and otherwise creating a 89using an existing buffer if there is one, and otherwise creating a
@@ -132,16 +137,6 @@ visiting the file @var{filename}.
132@end example 137@end example
133@end defun 138@end defun
134 139
135@deffn Command find-alternate-file filename
136This command selects a buffer visiting the file @var{filename}, then
137kills the buffer that was previously displayed in the selected window.
138It is useful if you have visited the wrong file by mistake, so that you
139can get rid of the buffer that you did not want to create, at the same
140time as you visit the file you intended.
141
142When this command is called interactively, it prompts for @var{filename}.
143@end deffn
144
145@deffn Command find-file-other-window filename 140@deffn Command find-file-other-window filename
146This command selects a buffer visiting the file @var{filename}, but 141This command selects a buffer visiting the file @var{filename}, but
147does so in a window other than the selected window. It may use another 142does so in a window other than the selected window. It may use another
@@ -161,10 +156,11 @@ When this command is called interactively, it prompts for
161@end deffn 156@end deffn
162 157
163@deffn Command view-file filename 158@deffn Command view-file filename
164This command visits @var{filename} in View mode, returning to the 159This command visits @var{filename} in View mode, and displays it in a
165previous buffer when done. View mode is a mode that allows you to skim 160recursive edit, returning to the previous buffer when done. View mode
166rapidly through the file but does not let you modify it. Entering View 161is a mode that allows you to skim rapidly through the file but does not
167mode runs the normal hook @code{view-mode-hook}. @xref{Hooks}. 162let you modify it. Entering View mode runs the normal hook
163@code{view-mode-hook}. @xref{Hooks}.
168 164
169When @code{view-file} is called interactively, it prompts for 165When @code{view-file} is called interactively, it prompts for
170@var{filename}. 166@var{filename}.
@@ -208,6 +204,7 @@ as the name if that name is free; otherwise, it appends a string such as
208 204
209@strong{Please note:} @code{create-file-buffer} does @emph{not} 205@strong{Please note:} @code{create-file-buffer} does @emph{not}
210associate the new buffer with a file and does not select the buffer. 206associate the new buffer with a file and does not select the buffer.
207It also does not use the default major mode.
211 208
212@example 209@example
213@group 210@group
@@ -368,9 +365,11 @@ the intended name after it is clear there are no errors. This procedure
368prevents problems such as a lack of disk space from resulting in an 365prevents problems such as a lack of disk space from resulting in an
369invalid file. 366invalid file.
370 367
371(This feature worked differently in older Emacs versions.) 368As a side effect, backups must be made by copying.
369@xref{Rename or Copy}.
372 370
373Some modes set this non-@code{nil} locally in particular buffers. 371Some modes set this variable non-@code{nil} locally in particular
372buffers.
374@end defvar 373@end defvar
375 374
376@defopt require-final-newline 375@defopt require-final-newline
@@ -401,9 +400,11 @@ current buffer after point. It returns a list of the absolute file name
401and the length of the data inserted. An error is signaled if 400and the length of the data inserted. An error is signaled if
402@var{filename} is not the name of a file that can be read. 401@var{filename} is not the name of a file that can be read.
403 402
404To set up saved text properties, @code{insert-file-contents} calls the 403The function @code{insert-file-contents} checks the file contents
405functions in the list @code{after-insert-file-functions}. For more 404against the defined file formats, and converts the file contents if
406information, see @ref{Saving Properties}. 405appropriate. @xref{Format Conversion}. It also calls the functions in
406the list @code{after-insert-file-functions}; see @ref{Saving
407Properties}.
407 408
408If @var{visit} is non-@code{nil}, this function additionally marks the 409If @var{visit} is non-@code{nil}, this function additionally marks the
409buffer as unmodified and sets up various fields in the buffer so that it 410buffer as unmodified and sets up various fields in the buffer so that it
@@ -427,10 +428,6 @@ contents of the buffer (actually, just the accessible portion) with the
427contents of the file. This is better than simply deleting the buffer 428contents of the file. This is better than simply deleting the buffer
428contents and inserting the whole file, because (1) it preserves some 429contents and inserting the whole file, because (1) it preserves some
429marker positions and (2) it puts less data in the undo list. 430marker positions and (2) it puts less data in the undo list.
430
431The function @code{insert-file-contents} checks the file contents
432against the defined file formats, and converts the file contents if
433appropriate. @xref{Format Conversion}.
434@end defun 431@end defun
435 432
436If you want to pass a file name to another process so that another 433If you want to pass a file name to another process so that another
@@ -484,19 +481,16 @@ the buffer as visiting another file (@var{visit}). The argument
484to implement @code{file-precious-flag}; don't use it yourself unless you 481to implement @code{file-precious-flag}; don't use it yourself unless you
485really know what you're doing. 482really know what you're doing.
486 483
487To output information about text properties, @code{write-region} calls 484The function @code{write-region} converts the data which it writes to
488the functions in the list @code{write-region-annotation-functions}. For 485the appropriate file formats specified by @code{buffer-file-format}.
489more information, see @ref{Saving Properties}. 486@xref{Format Conversion}. It also calls the functions in the list
487@code{write-region-annotate-functions}; see @ref{Saving Properties}.
490 488
491Normally, @code{write-region} displays a message @samp{Wrote file 489Normally, @code{write-region} displays a message @samp{Wrote file
492@var{filename}} in the echo area. If @var{visit} is neither @code{t} 490@var{filename}} in the echo area. If @var{visit} is neither @code{t}
493nor @code{nil} nor a string, then this message is inhibited. This 491nor @code{nil} nor a string, then this message is inhibited. This
494feature is useful for programs that use files for internal purposes, 492feature is useful for programs that use files for internal purposes,
495files that the user does not need to know about. 493files that the user does not need to know about.
496
497The function @code{write-region} converts the data which it writes to
498the appropriate file formats specified by @code{buffer-file-format}.
499@xref{Format Conversion}.
500@end deffn 494@end deffn
501 495
502@node File Locks 496@node File Locks
@@ -737,8 +731,8 @@ time as a list of two numbers. @xref{File Attributes}.
737@comment node-name, next, previous, up 731@comment node-name, next, previous, up
738@subsection Distinguishing Kinds of Files 732@subsection Distinguishing Kinds of Files
739 733
740 This section describes how to distinguish directories and symbolic 734 This section describes how to distinguish various kinds of files, such
741links from ordinary files. 735as directories, symbolic links, and ordinary files.
742 736
743@defun file-symlink-p filename 737@defun file-symlink-p filename
744@cindex file symbolic links 738@cindex file symbolic links
@@ -1330,9 +1324,16 @@ backup version numbers, or trailing tildes.
1330@end defun 1324@end defun
1331 1325
1332@defun file-name-sans-extension filename 1326@defun file-name-sans-extension filename
1333This function returns @var{filename} sans its final ``extension'', if 1327This function returns @var{filename} minus its ``extension,'' if any.
1334any. The extension, in a file name, is the part that follows the last 1328The extension, in a file name, is the part that starts with the last
1335@samp{.}. 1329@samp{.} in the last name component. For example,
1330
1331@example
1332(file-name-sans-extension "foo.lose.c")
1333 @result{} "foo.lose"
1334(file-name-sans-extension "big.hack/foo")
1335 @result{} "big.hack/foo"
1336@end example
1336@end defun 1337@end defun
1337 1338
1338@node Directory Names 1339@node Directory Names
@@ -1825,7 +1826,8 @@ This function creates a directory named @var{dirname}.
1825@defun delete-directory dirname 1826@defun delete-directory dirname
1826This function deletes the directory named @var{dirname}. The function 1827This function deletes the directory named @var{dirname}. The function
1827@code{delete-file} does not work for files that are directories; you 1828@code{delete-file} does not work for files that are directories; you
1828must use @code{delete-directory} in that case. 1829must use @code{delete-directory} for them. If the directory contains
1830any files, @code{delete-directory} signals an error.
1829@end defun 1831@end defun
1830 1832
1831@node Magic File Names 1833@node Magic File Names
@@ -1887,7 +1889,8 @@ Here are the operations that a magic file name handler gets to handle:
1887@code{file-name-directory}, @code{file-name-nondirectory}, 1889@code{file-name-directory}, @code{file-name-nondirectory},
1888@code{file-name-sans-versions}, @code{file-newer-than-file-p}, 1890@code{file-name-sans-versions}, @code{file-newer-than-file-p},
1889@code{file-readable-p}, @code{file-regular-p}, @code{file-symlink-p}, 1891@code{file-readable-p}, @code{file-regular-p}, @code{file-symlink-p},
1890@code{file-truename}, @code{file-writable-p}, @code{insert-directory}, 1892@code{file-truename}, @code{get-file-buffer}, @code{file-writable-p},
1893@code{insert-directory},
1891@code{insert-file-contents}, @code{load}, @code{make-directory}, 1894@code{insert-file-contents}, @code{load}, @code{make-directory},
1892@code{make-symbolic-link}, @code{rename-file}, @code{set-file-modes}, 1895@code{make-symbolic-link}, @code{rename-file}, @code{set-file-modes},
1893@code{set-visited-file-modtime}, @code{unhandled-file-name-directory}, 1896@code{set-visited-file-modtime}, @code{unhandled-file-name-directory},
@@ -1977,9 +1980,10 @@ is a good way to come up with one.
1977@cindex encoding file formats 1980@cindex encoding file formats
1978@cindex decoding file formats 1981@cindex decoding file formats
1979 The variable @code{format-alist} defines a list of @dfn{file formats}, 1982 The variable @code{format-alist} defines a list of @dfn{file formats},
1980which are textual representations used in files for the data (text, 1983which describe textual representations used in files for the data (text,
1981text-properties, and possibly other information) in an Emacs buffer. 1984text-properties, and possibly other information) in an Emacs buffer.
1982Emacs performs format conversion when reading and writing files. 1985Emacs performs format conversion if appropriate when reading and writing
1986files.
1983 1987
1984@defvar format-alist 1988@defvar format-alist
1985This list contains one format definition for each defined file format. 1989This list contains one format definition for each defined file format.
@@ -2014,7 +2018,7 @@ which specify the part of the buffer it should convert. It should convert
2014the text by editing it in place. Since this can change the length of the 2018the text by editing it in place. Since this can change the length of the
2015text, @var{from-fn} should return the modified end position. 2019text, @var{from-fn} should return the modified end position.
2016 2020
2017One responsibility of @var{from-fm} is to make sure that the beginning 2021One responsibility of @var{from-fn} is to make sure that the beginning
2018of the file no longer matches @var{regexp}. Otherwise it is likely to 2022of the file no longer matches @var{regexp}. Otherwise it is likely to
2019get called again. 2023get called again.
2020 2024
@@ -2061,23 +2065,26 @@ It keeps checking them until none of them is applicable.
2061 2065
2062Visiting a file, with @code{find-file-noselect} or the commands that use 2066Visiting a file, with @code{find-file-noselect} or the commands that use
2063it, performs conversion likewise (because it calls 2067it, performs conversion likewise (because it calls
2064@code{insert-file-contents}); but it also calls the mode function for 2068@code{insert-file-contents}); it also calls the mode function for each
2065each format that it decodes. It stores a list of the format names 2069format that it decodes. It stores a list of the format names in the
2066in the buffer-local variable @code{buffer-file-format}. 2070buffer-local variable @code{buffer-file-format}.
2067 2071
2068@defvar buffer-file-format 2072@defvar buffer-file-format
2069This variable holds a list of the file formats that were decoded in the 2073This variable states the format of the visited file. More precisely,
2070course of visiting the current buffer's file. It is always local in all 2074this is a list of the file format names that were decoded in the course
2075of visiting the current buffer's file. It is always local in all
2071buffers. 2076buffers.
2072@end defvar 2077@end defvar
2073 2078
2074When @code{write-region} writes data into a file, it first calls the 2079When @code{write-region} writes data into a file, it first calls the
2075encoding functions for the formats listed in @code{buffer-file-format}. 2080encoding functions for the formats listed in @code{buffer-file-format},
2081in the order of appearance in the list.
2076 2082
2077@defun format-write-file file format 2083@defun format-write-file file format
2078This command writes the current buffer contents into the file @var{file} 2084This command writes the current buffer contents into the file @var{file}
2079in format @var{format}, and makes that format the default for future 2085in format @var{format}, and makes that format the default for future
2080saves of the buffer. 2086saves of the buffer. The argument @var{format} is a list of format
2087names.
2081@end defun 2088@end defun
2082 2089
2083@defvar auto-save-file-format 2090@defvar auto-save-file-format
@@ -2098,7 +2105,7 @@ is always local in all buffers.
2098 Emacs on MS-DOS makes a distinction between text files and binary 2105 Emacs on MS-DOS makes a distinction between text files and binary
2099files. This is necessary because ordinary text files on MS-DOS use a 2106files. This is necessary because ordinary text files on MS-DOS use a
2100two character sequence between lines: carriage-return and linefeed 2107two character sequence between lines: carriage-return and linefeed
2101(CRLF). Emacs expects just a newline character (a linefeed) between 2108(@sc{crlf}). Emacs expects just a newline character (a linefeed) between
2102lines. When Emacs reads or writes a text file on MS-DOS, it needs to 2109lines. When Emacs reads or writes a text file on MS-DOS, it needs to
2103convert the line separators. This means it needs to know which files 2110convert the line separators. This means it needs to know which files
2104are text files and which are binary. It makes this decision when 2111are text files and which are binary. It makes this decision when
diff --git a/lispref/frames.texi b/lispref/frames.texi
index 97d8e3e940a..b7d64e55332 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -18,9 +18,10 @@ horizontally into smaller windows.
18@dfn{terminal frames}. If you create additional ones, Emacs displays 18@dfn{terminal frames}. If you create additional ones, Emacs displays
19one and only one at any given time---on the terminal screen, of course. 19one and only one at any given time---on the terminal screen, of course.
20 20
21 When Emacs uses X for display, it does not have a terminal frame; 21 When Emacs communicates directly with an X server, it does not have a
22instead, it starts with a single @dfn{X window frame}. It can display 22terminal frame; instead, it starts with a single @dfn{X window frame}.
23multiple X window frames at the same time, each in its own X window. 23It can display multiple X window frames at the same time, each in its
24own X window.
24 25
25@defun framep object 26@defun framep object
26This predicate returns @code{t} if @var{object} is a frame, and 27This predicate returns @code{t} if @var{object} is a frame, and
@@ -48,7 +49,7 @@ This predicate returns @code{t} if @var{object} is a frame, and
48* Dialog Boxes:: Displaying a box to ask yes or no. 49* Dialog Boxes:: Displaying a box to ask yes or no.
49* Pointer Shapes:: Specifying the shape of the mouse pointer. 50* Pointer Shapes:: Specifying the shape of the mouse pointer.
50* X Selections:: Transferring text to and from other X clients. 51* X Selections:: Transferring text to and from other X clients.
51* X Connections:: Opening and closing the X server connection. 52* Color Names:: Getting the definitions of color names.
52* Resources:: Getting resource values from the server. 53* Resources:: Getting resource values from the server.
53* Server Data:: Getting info about the X server. 54* Server Data:: Getting info about the X server.
54@end menu 55@end menu
@@ -66,8 +67,8 @@ an X window frame; otherwise, it makes a terminal frame.
66 67
67The argument is an alist specifying frame parameters. Any parameters 68The argument is an alist specifying frame parameters. Any parameters
68not mentioned in @var{alist} default according to the value of the 69not mentioned in @var{alist} default according to the value of the
69variable @code{default-frame-alist}; parameters not specified there 70variable @code{default-frame-alist}; parameters not specified even there
70either default from the standard X defaults file and X resources. 71default from the standard X defaults file and X resources.
71 72
72The set of possible parameters depends in principle on what kind of 73The set of possible parameters depends in principle on what kind of
73window system Emacs uses to display its frames. @xref{X Frame 74window system Emacs uses to display its frames. @xref{X Frame
@@ -120,7 +121,8 @@ argument, it is like @code{make-frame} (@pxref{Creating Frames}).
120 121
121@defun x-display-list 122@defun x-display-list
122This returns a list that indicates which X displays Emacs has a 123This returns a list that indicates which X displays Emacs has a
123connection to. The elements of the list are display names (strings). 124connection to. The elements of the list are strings, and each one is
125a display name.
124@end defun 126@end defun
125 127
126@defun x-open-connection display &optional xrm-string 128@defun x-open-connection display &optional xrm-string
@@ -128,9 +130,18 @@ This function opens a connection to the X display @var{display}. It
128does not create a frame on that display, but it permits you to check 130does not create a frame on that display, but it permits you to check
129that communication can be established with that display. 131that communication can be established with that display.
130 132
131The optional second argument @var{xrm-string} should be a string of 133The optional argument @var{resource-string}, if not @code{nil}, is a
132resources in xrdb format, or @code{nil}. The resources, if specified, 134string of resource names and values, in the same format used in the
133apply to all Emacs frames created on this display. 135@file{.Xresources} file. The values you specify override the resource
136values recorded in the X server itself; they apply to all Emacs frames
137created on this display. Here's an example of what this string might
138look like:
139
140@example
141"*BorderWidth: 3\n*InternalBorder: 2\n"
142@end example
143
144@xref{Resources}.
134@end defun 145@end defun
135 146
136@defun x-close-connection display 147@defun x-close-connection display
@@ -147,9 +158,8 @@ Just what parameters a frame has depends on what display mechanism it
147uses. 158uses.
148 159
149Frame parameters exist for the sake of window systems. A terminal frame 160Frame parameters exist for the sake of window systems. A terminal frame
150has a few parameters, for compatibility's sake only. You can't change 161has a few parameters, mostly for compatibility's sake; only the height,
151these parameters directly; the only ones that ever change are the height 162width and @code{buffer-predicate} parameters really do something.
152and width.
153 163
154@menu 164@menu
155* Parameter Access:: How to change a frame's parameters. 165* Parameter Access:: How to change a frame's parameters.
@@ -196,11 +206,11 @@ file. After reading that file, Emacs checks @code{initial-frame-alist},
196and applies the parameter settings in the altered value to the already 206and applies the parameter settings in the altered value to the already
197created initial frame. 207created initial frame.
198 208
199If these settings affect the frame geometry, you'll see the frame appear 209If these settings affect the frame geometry and appearance, you'll see
200with the wrong geometry and then change to the specified one. If you 210the frame appear with the wrong ones and then change to the specified
201like, you can specify the same geometry with X resources; those do take 211ones. If that bothers you, you can specify the same geometry and
202affect before the frame is created. @xref{Resources X,, X Resources, 212appearance with X resources; those do take affect before the frame is
203emacs, The GNU Emacs Manual}. 213created. @xref{Resources X,, X Resources, emacs, The GNU Emacs Manual}.
204 214
205X resource settings typically apply to all frames. If you want to 215X resource settings typically apply to all frames. If you want to
206specify some X resources solely for the sake of the initial frame, and 216specify some X resources solely for the sake of the initial frame, and
@@ -211,8 +221,9 @@ the initial frame, specify the same parameters in
211@code{initial-frame-alist} with values that match the X resources. 221@code{initial-frame-alist} with values that match the X resources.
212@end defvar 222@end defvar
213 223
214If these parameters specify a separate minibuffer-only frame, 224If these parameters specify a separate minibuffer-only frame with
215and you have not created one, Emacs creates one for you. 225@code{(minibuffer . nil)}, and you have not created one, Emacs creates
226one for you.
216 227
217@defvar minibuffer-frame-alist 228@defvar minibuffer-frame-alist
218This variable's value is an alist of parameter values used when creating 229This variable's value is an alist of parameter values used when creating
@@ -220,20 +231,18 @@ an initial minibuffer-only frame---if such a frame is needed, according
220to the parameters for the main initial frame. 231to the parameters for the main initial frame.
221@end defvar 232@end defvar
222 233
223@defvar special-display-frame-alist
224The variable @code{special-display-frame-alist} specifies the frame
225parameters for special display frames.
226@end defvar
227
228@defvar default-frame-alist 234@defvar default-frame-alist
229This is an alist specifying default values of frame parameters for 235This is an alist specifying default values of frame parameters for
230subsequent Emacs frames (not the initial ones). 236subsequent Emacs frames (not the initial ones).
231@end defvar 237@end defvar
232 238
239See also @code{special-display-frame-alist}, in @ref{Choosing Window}.
240
233If you use options that specify window appearance when you invoke Emacs, 241If you use options that specify window appearance when you invoke Emacs,
234they take effect by adding elements to @code{default-frame-alist}. One 242they take effect by adding elements to @code{default-frame-alist}. One
235exception is @samp{-geometry}, which adds to @code{initial-frame-alist} 243exception is @samp{-geometry}, which adds the specified position to
236instead. @xref{Command Arguments,,, emacs, The GNU Emacs Manual}. 244@code{initial-frame-alist} instead. @xref{Command Arguments,,, emacs,
245The GNU Emacs Manual}.
237 246
238@node X Frame Parameters 247@node X Frame Parameters
239@subsection X Window Frame Parameters 248@subsection X Window Frame Parameters
@@ -267,8 +276,9 @@ negative @var{pos} value.
267 276
268A negative number @minus{}@var{pos}, or a list of the form @code{(- 277A negative number @minus{}@var{pos}, or a list of the form @code{(-
269@var{pos})}, actually specifies the position of the right edge of the 278@var{pos})}, actually specifies the position of the right edge of the
270window with respect to the right edge of the screen, counting toward the 279window with respect to the right edge of the screen. A positive value
271left. 280of @var{pos} counts toward the left. If the parameter is a negative
281integer @minus{}@var{pos} then @var{pos} is positive!
272 282
273@item top 283@item top
274The screen position of the top edge, in pixels, with respect to the 284The screen position of the top edge, in pixels, with respect to the
@@ -278,8 +288,9 @@ negative @var{pos} value.
278 288
279A negative number @minus{}@var{pos}, or a list of the form @code{(- 289A negative number @minus{}@var{pos}, or a list of the form @code{(-
280@var{pos})}, actually specifies the position of the bottom edge of the 290@var{pos})}, actually specifies the position of the bottom edge of the
281window with respect to the bottom edge of the screen, counting toward the 291window with respect to the bottom edge of the screen. A positive value
282top. 292of @var{pos} counts toward the top. If the parameter is a negative
293integer @minus{}@var{pos} then @var{pos} is positive!
283 294
284@item icon-left 295@item icon-left
285The screen position of the left edge @emph{of the frame's icon}, in 296The screen position of the left edge @emph{of the frame's icon}, in
@@ -312,8 +323,8 @@ The number of the X window for the frame.
312@item minibuffer 323@item minibuffer
313Whether this frame has its own minibuffer. The value @code{t} means 324Whether this frame has its own minibuffer. The value @code{t} means
314yes, @code{nil} means no, @code{only} means this frame is just a 325yes, @code{nil} means no, @code{only} means this frame is just a
315minibuffer, a minibuffer window (in some other frame) means the new 326minibuffer. If the value is a minibuffer window (in some other frame),
316frame uses that minibuffer. 327the new frame uses that minibuffer.
317 328
318@item buffer-predicate 329@item buffer-predicate
319The buffer-predicate function for this frame. The function 330The buffer-predicate function for this frame. The function
@@ -351,6 +362,10 @@ value is a string, that specifies a file containing a bitmap to use.
351Any other non-@code{nil} value specifies the default bitmap icon (a 362Any other non-@code{nil} value specifies the default bitmap icon (a
352picture of a gnu); @code{nil} specifies a text icon. 363picture of a gnu); @code{nil} specifies a text icon.
353 364
365@item icon-name
366The name to use in the icon for this frame, when and if the icon
367appears. If this is @code{nil}, the frame's title is used.
368
354@item foreground-color 369@item foreground-color
355The color to use for the image of a character. This is a string; the X 370The color to use for the image of a character. This is a string; the X
356server defines the meaningful color names. 371server defines the meaningful color names.
@@ -414,9 +429,10 @@ by the window manager in its usual fashion.
414 Here are some special features for working with sizes and positions: 429 Here are some special features for working with sizes and positions:
415 430
416@defun set-frame-position frame left top 431@defun set-frame-position frame left top
417This function sets the position of the top left corner of 432This function sets the position of the top left corner of @var{frame} to
418@var{frame} to @var{left} and @var{top}. These arguments are measured 433@var{left} and @var{top}. These arguments are measured in pixels, and
419in pixels, counting from the top left corner of the screen. 434count from the top left corner of the screen. Negative parameter values
435count up or rightward from the top left corner of the screen.
420@end defun 436@end defun
421 437
422@defun frame-height &optional frame 438@defun frame-height &optional frame
@@ -479,13 +495,13 @@ the left or top edge of the screen. A negative integer relates the
479right or bottom edge of the window to the right or bottom edge of the 495right or bottom edge of the window to the right or bottom edge of the
480screen. 496screen.
481 497
482@item (+ @var{position}) 498@item @code{(+ @var{position})}
483This specifies the position of the left or top edge of the window 499This specifies the position of the left or top edge of the window
484relative to the left or top edge of the screen. The integer 500relative to the left or top edge of the screen. The integer
485@var{position} may be positive or negative; a negative value specifies a 501@var{position} may be positive or negative; a negative value specifies a
486position outside the screen. 502position outside the screen.
487 503
488@item (- @var{position}) 504@item @code{(- @var{position})}
489This specifies the position of the right or bottom edge of the window 505This specifies the position of the right or bottom edge of the window
490relative to the right or bottom edge of the screen. The integer 506relative to the right or bottom edge of the screen. The integer
491@var{position} may be positive or negative; a negative value specifies a 507@var{position} may be positive or negative; a negative value specifies a
@@ -494,10 +510,11 @@ position outside the screen.
494 510
495Here is an example: 511Here is an example:
496 512
497@smallexample 513@example
498(x-parse-geometry "35x70+0-0") 514(x-parse-geometry "35x70+0-0")
499 @result{} ((width . 35) (height . 70) (left . 0) (top - 0)) 515 @result{} ((width . 35) (height . 70)
500@end smallexample 516 (left . 0) (top - 0))
517@end example
501@end defun 518@end defun
502 519
503@ignore 520@ignore
@@ -538,7 +555,7 @@ invisible frames). The default value of @code{frame-title-format} uses
538@code{multiple-frames} so as to put the buffer name in the frame title 555@code{multiple-frames} so as to put the buffer name in the frame title
539only when there is more than one frame. 556only when there is more than one frame.
540 557
541The variable is always local to the current X terminal and cannot be 558The variable is always local to the current terminal and cannot be
542buffer-local. @xref{Multiple Displays}. 559buffer-local. @xref{Multiple Displays}.
543@end defvar 560@end defvar
544 561
@@ -598,6 +615,8 @@ The second argument, @var{minibuf}, says which frames to consider:
598Exclude minibuffer-only frames. 615Exclude minibuffer-only frames.
599@item @code{visible} 616@item @code{visible}
600Consider all visible frames. 617Consider all visible frames.
618@item 0
619Consider all visible or iconified frames.
601@item a window 620@item a window
602Consider only the frames using that particular window as their 621Consider only the frames using that particular window as their
603minibuffer. 622minibuffer.
@@ -611,6 +630,9 @@ Like @code{next-frame}, but cycles through all frames in the opposite
611direction. 630direction.
612@end defun 631@end defun
613 632
633 See also @code{next-window} and @code{previous-window}, in @ref{Cyclic
634Window Ordering}.
635
614@node Frames and Windows 636@node Frames and Windows
615@section Frames and Windows 637@section Frames and Windows
616 638
@@ -644,6 +666,9 @@ This function returns the window on @var{frame} that is selected within
644Conversely, selecting a window for Emacs with @code{select-window} also 666Conversely, selecting a window for Emacs with @code{select-window} also
645makes that window selected within its frame. @xref{Selecting Windows}. 667makes that window selected within its frame. @xref{Selecting Windows}.
646 668
669Another function that (usually) returns one of the windows in a frame is
670@code{minibuffer-window}. @xref{Minibuffer Misc}.
671
647@node Minibuffers and Frames 672@node Minibuffers and Frames
648@section Minibuffers and Frames 673@section Minibuffers and Frames
649 674
@@ -653,11 +678,10 @@ you can get it with @code{minibuffer-window} (@pxref{Minibuffer Misc}).
653 678
654However, you can also create a frame with no minibuffer. Such a frame 679However, you can also create a frame with no minibuffer. Such a frame
655must use the minibuffer window of some other frame. When you create the 680must use the minibuffer window of some other frame. When you create the
656frame, you can specify explicitly the frame on which to find the 681frame, you can specify explicitly the minibuffer window to use (in some
657minibuffer to use. If you don't, then the minibuffer is found in the 682other frame). If you don't, then the minibuffer is found in the frame
658frame which is the value of the variable 683which is the value of the variable @code{default-minibuffer-frame}. Its
659@code{default-minibuffer-frame}. Its value should be a frame that does 684value should be a frame that does have a minibuffer.
660have a minibuffer.
661 685
662If you use a minibuffer-only frame, you might want that frame to raise 686If you use a minibuffer-only frame, you might want that frame to raise
663when you enter the minibuffer. If so, set the variable 687when you enter the minibuffer. If so, set the variable
@@ -665,7 +689,7 @@ when you enter the minibuffer. If so, set the variable
665 689
666@defvar default-minibuffer-frame 690@defvar default-minibuffer-frame
667This variable specifies the frame to use for the minibuffer window, by 691This variable specifies the frame to use for the minibuffer window, by
668default. It is always local to the current X terminal and cannot be 692default. It is always local to the current terminal and cannot be
669buffer-local. @xref{Multiple Displays}. 693buffer-local. @xref{Multiple Displays}.
670@end defvar 694@end defvar
671 695
@@ -697,7 +721,7 @@ lasts until overridden by a subsequent call to @code{switch-frame}.
697Only the selected terminal frame is actually displayed on the terminal. 721Only the selected terminal frame is actually displayed on the terminal.
698Each terminal screen except for the initial one has a number, and the 722Each terminal screen except for the initial one has a number, and the
699number of the selected frame appears in the mode line after the word 723number of the selected frame appears in the mode line after the word
700@samp{Emacs}. 724@samp{Emacs} (@pxref{Mode Line Variables}).
701 725
702@c ??? This is not yet implemented properly. 726@c ??? This is not yet implemented properly.
703@defun select-frame frame 727@defun select-frame frame
@@ -758,7 +782,7 @@ change it.
758@cindex iconified frame 782@cindex iconified frame
759@cindex frame visibility 783@cindex frame visibility
760 784
761An X windo frame may be @dfn{visible}, @dfn{invisible}, or 785An X window frame may be @dfn{visible}, @dfn{invisible}, or
762@dfn{iconified}. If it is visible, you can see its contents. If it is 786@dfn{iconified}. If it is visible, you can see its contents. If it is
763iconified, the frame's contents do not appear on the screen, but an icon 787iconified, the frame's contents do not appear on the screen, but an icon
764does. If the frame is invisible, it doesn't show on the screen, not 788does. If the frame is invisible, it doesn't show on the screen, not
@@ -882,6 +906,11 @@ The usual purpose of tracking mouse motion is to indicate on the screen
882the consequences of pushing or releasing a button at the current 906the consequences of pushing or releasing a button at the current
883position. 907position.
884 908
909In many cases, you can avoid the need to track the mouse by using
910the @code{mouse-face} text property (@pxref{Special Properties}).
911That works at a much lower level and runs more smoothly than
912Lisp-level mouse tracking.
913
885@ignore 914@ignore
886@c These are not implemented yet. 915@c These are not implemented yet.
887 916
@@ -991,7 +1020,7 @@ can have the following form:
991where each pane is a list of form 1020where each pane is a list of form
992 1021
993@example 1022@example
994(@var{title} (@var{line} @var{item})...) 1023(@var{title} (@var{line} . @var{item})...)
995@end example 1024@end example
996 1025
997Each @var{line} should be a string, and each @var{item} should be the 1026Each @var{line} should be a string, and each @var{item} should be the
@@ -1005,8 +1034,8 @@ individual items in that menu and provide help for them. If instead you
1005implement the menu by defining a command that calls @code{x-popup-menu}, 1034implement the menu by defining a command that calls @code{x-popup-menu},
1006the help facilities cannot know what happens inside that command, so 1035the help facilities cannot know what happens inside that command, so
1007they cannot give any help for the menu's items. This is the reason why 1036they cannot give any help for the menu's items. This is the reason why
1008all the menu bar items except @samp{Buffers} are implemented with menu 1037all the menu bar items are normally implemented with menu keymaps
1009keymaps (@pxref{Menu Keymaps}). 1038(@pxref{Menu Keymaps}).
1010 1039
1011@node Dialog Boxes 1040@node Dialog Boxes
1012@section Dialog Boxes 1041@section Dialog Boxes
@@ -1144,40 +1173,8 @@ This function stores @var{string} into the first cut buffer (cut buffer
1144like the way successive kills in Emacs move down the kill ring. 1173like the way successive kills in Emacs move down the kill ring.
1145@end defun 1174@end defun
1146 1175
1147@node X Connections 1176@node Color Names
1148@section X Connections 1177@section Color Names
1149
1150You can close the connection with the X server with the function
1151@code{x-close-current-connection}, and open a new one with
1152@code{x-open-connection} (perhaps with a different server and display).
1153
1154@defun x-close-current-connection
1155This function closes the connection to the X server. It deletes all
1156frames, making Emacs effectively inaccessible to the user; therefore, a
1157Lisp program that closes the connection should open another one.
1158@end defun
1159
1160@defun x-open-connection display &optional resource-string
1161This function opens a connection to an X server, for use of display
1162@var{display}.
1163
1164The optional argument @var{resource-string} is a string of resource
1165names and values, in the same format used in the @file{.Xresources}
1166file. The values you specify override the resource values recorded in
1167the X server itself. Here's an example of what this string might look
1168like:
1169
1170@example
1171"*BorderWidth: 3\n*InternalBorder: 2\n"
1172@end example
1173
1174@xref{Resources}.
1175@end defun
1176
1177@defun x-display-color-p
1178This returns @code{t} if the connected X display has color, and
1179@code{nil} otherwise.
1180@end defun
1181 1178
1182@defun x-color-defined-p color 1179@defun x-color-defined-p color
1183This function reports whether a color name is meaningful. It returns 1180This function reports whether a color name is meaningful. It returns
@@ -1221,39 +1218,27 @@ defined, the value is @code{nil}.
1221@end example 1218@end example
1222@end defun 1219@end defun
1223 1220
1224@defun x-synchronize flag
1225The function @code{x-synchronize} enables or disables synchronous
1226communication with the X server. It enables synchronous communication
1227if @var{flag} is non-@code{nil}, and disables it if @var{flag} is
1228@code{nil}.
1229
1230In synchronous mode, Emacs waits for a response to each X protocol
1231command before doing anything else. This is useful for debugging Emacs,
1232because protocol errors are reported right away, which helps you find
1233the erroneous command. Synchronous mode is not the default because it
1234is much slower.
1235@end defun
1236
1237@node Resources 1221@node Resources
1238@section X Resources 1222@section X Resources
1239 1223
1240@defun x-get-resource attribute &optional component subclass 1224@defun x-get-resource attribute class &optional component subclass
1241The function @code{x-get-resource} retrieves a resource value from the X 1225The function @code{x-get-resource} retrieves a resource value from the X
1242Windows defaults database. 1226Windows defaults database.
1243 1227
1244Resources are indexed by a combination of a @dfn{key} and a @dfn{class}. 1228Resources are indexed by a combination of a @dfn{key} and a @dfn{class}.
1245This function searches using a key of the form 1229This function searches using a key of the form
1246@samp{@var{instance}.@var{attribute}} (where @var{instance} is the name 1230@samp{@var{instance}.@var{attribute}} (where @var{instance} is the name
1247under which Emacs was invoked), and using @samp{Emacs} as the class. 1231under which Emacs was invoked), and using @samp{Emacs.@var{class}} as
1232the class.
1248 1233
1249The optional arguments @var{component} and @var{subclass} add to the key 1234The optional arguments @var{component} and @var{subclass} add to the key
1250and the class, respectively. You must specify both of them or neither. 1235and the class, respectively. You must specify both of them or neither.
1251If you specify them, the key is 1236If you specify them, the key is
1252@samp{@var{instance}.@var{component}.@var{attribute}}, and the class is 1237@samp{@var{instance}.@var{component}.@var{attribute}}, and the class is
1253@samp{Emacs.@var{subclass}}. 1238@samp{Emacs.@var{class}.@var{subclass}}.
1254@end defun 1239@end defun
1255 1240
1256 @xref{Resources X, X Resources,, emacs, The GNU Emacs Manual}. 1241 @xref{Resources X,, X Resources, emacs, The GNU Emacs Manual}.
1257 1242
1258@node Server Data 1243@node Server Data
1259@section Data about the X Server 1244@section Data about the X Server
@@ -1263,8 +1248,8 @@ get information about the capabilities and origin of an X display that
1263Emacs is using. Each of these functions lets you specify the display 1248Emacs is using. Each of these functions lets you specify the display
1264you are interested in: the @var{display} argument can be either a 1249you are interested in: the @var{display} argument can be either a
1265display name, or a frame (meaning use the display that frame is on). If 1250display name, or a frame (meaning use the display that frame is on). If
1266you omit the @var{display} argument, that means to use the selected 1251you omit the @var{display} argument, or specify @code{nil}, that means
1267frame's display. 1252to use the selected frame's display.
1268 1253
1269@defun x-display-screens &optional display 1254@defun x-display-screens &optional display
1270This function returns the number of screens associated with the display. 1255This function returns the number of screens associated with the display.
diff --git a/lispref/functions.texi b/lispref/functions.texi
index 0f596cb6216..27a521df702 100644
--- a/lispref/functions.texi
+++ b/lispref/functions.texi
@@ -79,7 +79,9 @@ Structures}.
79A @dfn{macro} is a construct defined in Lisp by the programmer. It 79A @dfn{macro} is a construct defined in Lisp by the programmer. It
80differs from a function in that it translates a Lisp expression that you 80differs from a function in that it translates a Lisp expression that you
81write into an equivalent expression to be evaluated instead of the 81write into an equivalent expression to be evaluated instead of the
82original expression. @xref{Macros}, for how to define and use macros. 82original expression. Macros enable Lisp programmers to do the sorts of
83things that special forms can do. @xref{Macros}, for how to define and
84use macros.
83 85
84@item command 86@item command
85@cindex command 87@cindex command
@@ -150,9 +152,11 @@ function. For example:
150@end example 152@end example
151 153
152@noindent 154@noindent
153(Such a list is called a @dfn{lambda expression} for historical reasons, 155Such a list is called a @dfn{lambda expression}. In Emacs Lisp, it
154even though it is not really an expression at all---it is not a form 156actually is valid as an expression---it evaluates to itself. In some
155that can be evaluated meaningfully.) 157other Lisp dialects, a lambda expression is not a valid expression at
158all. In either case, its main use is not to be evaluated as an
159expression, but to be called as a function.
156 160
157@menu 161@menu
158* Lambda Components:: The parts of a lambda expression. 162* Lambda Components:: The parts of a lambda expression.
@@ -374,17 +378,17 @@ actually appears inside the Lisp world and can be used by the Emacs help
374facilities. @xref{Documentation}, for how the @var{documentation-string} is 378facilities. @xref{Documentation}, for how the @var{documentation-string} is
375accessed. 379accessed.
376 380
377 It is a good idea to provide documentation strings for all commands, 381 It is a good idea to provide documentation strings for all the
378and for all other functions in your program that users of your program 382functions in your program, even those that are only called from within
379should know about; internal functions might as well have only comments, 383your program. Documentation strings are like comments, except that they
380since comments don't take up any room when your program is loaded. 384are easier to access.
381 385
382 The first line of the documentation string should stand on its own, 386 The first line of the documentation string should stand on its own,
383because @code{apropos} displays just this first line. It should consist 387because @code{apropos} displays just this first line. It should consist
384of one or two complete sentences that summarize the function's purpose. 388of one or two complete sentences that summarize the function's purpose.
385 389
386 The start of the documentation string is usually indented, but since 390 The start of the documentation string is usually indented in the source file,
387these spaces come before the starting double-quote, they are not part of 391but since these spaces come before the starting double-quote, they are not part of
388the string. Some people make a practice of indenting any additional 392the string. Some people make a practice of indenting any additional
389lines of the string so that the text lines up in the program source. 393lines of the string so that the text lines up in the program source.
390@emph{This is a mistake.} The indentation of the following lines is 394@emph{This is a mistake.} The indentation of the following lines is
@@ -532,11 +536,21 @@ deliberate redefinition from unintentional redefinition.
532@defun defalias name definition 536@defun defalias name definition
533This special form defines the symbol @var{name} as a function, with 537This special form defines the symbol @var{name} as a function, with
534definition @var{definition} (which can be any valid Lisp function). 538definition @var{definition} (which can be any valid Lisp function).
535It's best to use this rather than @code{fset} when defining a function 539
536in a file, because @code{defalias} records which file defined the 540The proper place to use @code{defalias} is where a specific function
537function (@pxref{Unloading}), while @code{fset} does not. 541name is being defined---especially where that name appears explicitly in
542the source file being loaded. This is because @code{defalias} records
543which file defined the function, just like @code{defun}
544(@pxref{Unloading}).
545
546By contrast, in programs that manipulate function definitions for other
547purposes, it is better to use @code{fset}, which does not keep such
548records.
538@end defun 549@end defun
539 550
551 See also @code{defsubst}, which defines a function like @code{defun}
552and tells the Lisp compiler to open-code it. @xref{Inline Functions}.
553
540@node Calling Functions 554@node Calling Functions
541@section Calling Functions 555@section Calling Functions
542@cindex function invocation 556@cindex function invocation
@@ -645,8 +659,8 @@ find them in data structures (especially in hook variables and property
645lists) and call them using @code{funcall} or @code{apply}. Functions 659lists) and call them using @code{funcall} or @code{apply}. Functions
646that accept function arguments are often called @dfn{functionals}. 660that accept function arguments are often called @dfn{functionals}.
647 661
648 Sometimes, when you call such a function, it is useful to supply a 662 Sometimes, when you call a functional, it is useful to supply a no-op
649no-op function as the argument. Here are two different kinds of no-op 663function as the argument. Here are two different kinds of no-op
650function: 664function:
651 665
652@defun identity arg 666@defun identity arg
@@ -1007,7 +1021,7 @@ Functions}.
1007@end defun 1021@end defun
1008 1022
1009 When writing a function that extends a previously defined function, 1023 When writing a function that extends a previously defined function,
1010the following idiom is often used: 1024the following idiom is sometimes used:
1011 1025
1012@example 1026@example
1013(fset 'old-foo (symbol-function 'foo)) 1027(fset 'old-foo (symbol-function 'foo))
@@ -1027,6 +1041,9 @@ defines @code{foo} rather than @code{old-foo}, it does not produce the
1027proper results. The only way to avoid this problem is to make sure the 1041proper results. The only way to avoid this problem is to make sure the
1028file is loaded before moving aside the old definition of @code{foo}. 1042file is loaded before moving aside the old definition of @code{foo}.
1029 1043
1044 But it is unmodular and unclean, in any case, for a Lisp file to
1045redefine a function defined elsewhere.
1046
1030@node Inline Functions 1047@node Inline Functions
1031@section Inline Functions 1048@section Inline Functions
1032@cindex inline functions 1049@cindex inline functions
@@ -1063,7 +1080,7 @@ Evaluation}.)
1063Inline functions can be used and open-coded later on in the same file, 1080Inline functions can be used and open-coded later on in the same file,
1064following the definition, just like macros. 1081following the definition, just like macros.
1065 1082
1066Emacs versions prior to 19 did not have inline functions. 1083@c Emacs versions prior to 19 did not have inline functions.
1067 1084
1068@node Related Topics 1085@node Related Topics
1069@section Other Topics Related to Functions 1086@section Other Topics Related to Functions
diff --git a/lispref/help.texi b/lispref/help.texi
index 396d11b01ed..b0466962a6c 100644
--- a/lispref/help.texi
+++ b/lispref/help.texi
@@ -60,7 +60,7 @@ documentation is displayed. This allows documentation strings to refer
60to the keys for related commands and be accurate even when a user 60to the keys for related commands and be accurate even when a user
61rearranges the key bindings. (@xref{Accessing Documentation}.) 61rearranges the key bindings. (@xref{Accessing Documentation}.)
62 62
63 Within the Lisp world, a documentation string is kept with the 63 Within the Lisp world, a documentation string accessible through the
64function or variable that it describes: 64function or variable that it describes:
65 65
66@itemize @bullet 66@itemize @bullet
@@ -81,14 +81,17 @@ function @code{documentation-property} knows how to extract it.
81@cindex @file{etc/DOC-@var{version}} 81@cindex @file{etc/DOC-@var{version}}
82To save space, the documentation for preloaded functions and variables 82To save space, the documentation for preloaded functions and variables
83(including primitive functions and autoloaded functions) is stored in 83(including primitive functions and autoloaded functions) is stored in
84the file @file{emacs/etc/DOC-@var{version}}. The data structure inside 84the file @file{emacs/etc/DOC-@var{version}}. The documentation for
85Emacs has an integer offset into the file, where the documentation 85functions and variables loaded during the Emacs session from
86string ought to be. The functions @code{documentation} and 86byte-compiled files is stored in those files (@pxref{Docs and
87@code{documentation-property} read the documentation from the file 87Compilation}).
88@file{emacs/etc/DOC-@var{version}} when they notice the integer there; 88
89this is transparent to the user. Keeping the documentation strings out 89The data structure inside Emacs has an integer offset into the file, or
90of the Emacs core image saves a significant amount of space. 90a list containing a string and an integer, in place of the documentation
91@xref{Building Emacs}. 91string. The functions @code{documentation} and
92@code{documentation-property} use that information to read the
93documentation from the appropriate file; this is transparent to the
94user.
92 95
93 For information on the uses of documentation strings, see @ref{Help, , 96 For information on the uses of documentation strings, see @ref{Help, ,
94Help, emacs, The GNU Emacs Manual}. 97Help, emacs, The GNU Emacs Manual}.
@@ -105,10 +108,10 @@ use to print nice-looking hardcopy for the file
105@defun documentation-property symbol property &optional verbatim 108@defun documentation-property symbol property &optional verbatim
106This function returns the documentation string that is recorded 109This function returns the documentation string that is recorded
107@var{symbol}'s property list under property @var{property}. It 110@var{symbol}'s property list under property @var{property}. It
108retrieves the text from the file @file{emacs/etc/DOC-@var{version}} if 111retrieves the text from a file if necessary, and runs
109necessary, and runs @code{substitute-command-keys} to substitute actual 112@code{substitute-command-keys} to substitute actual key bindings. (This
110key bindings. (This substitution is not done if @var{verbatim} is 113substitution is not done if @var{verbatim} is non-@code{nil}; the
111non-@code{nil}; the @var{verbatim} argument exists only as of Emacs 19.) 114@var{verbatim} argument exists only as of Emacs 19.)
112 115
113@smallexample 116@smallexample
114@group 117@group
@@ -124,14 +127,10 @@ non-@code{nil}; the @var{verbatim} argument exists only as of Emacs 19.)
124@end defun 127@end defun
125 128
126@defun documentation function &optional verbatim 129@defun documentation function &optional verbatim
127This function returns the documentation string of @var{function}. 130This function returns the documentation string of @var{function}. It
128This function will access the documentation string if it is stored in 131reads the text from a file if necessary. Then (unless @var{verbatim} is
129the @file{emacs/etc/DOC-@var{version}} file. 132non-@code{nil}) it calls @code{substitute-command-keys}, to return a
130 133value containing the actual (current) key bindings.
131In addition, @code{documentation} runs @code{substitute-command-keys}
132on the resulting string, so the value contains the actual (current) key
133bindings. (This is not done if @var{verbatim} is non-@code{nil}; the
134@var{verbatim} argument exists only as of Emacs 19.)
135 134
136The function @code{documentation} signals a @code{void-function} error 135The function @code{documentation} signals a @code{void-function} error
137if @var{function} has no function definition. However, it is ok if 136if @var{function} has no function definition. However, it is ok if
diff --git a/lispref/hooks.texi b/lispref/hooks.texi
index 472b57fd1a6..18f8bcfcad5 100644
--- a/lispref/hooks.texi
+++ b/lispref/hooks.texi
@@ -3,7 +3,7 @@
3@c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. 3@c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
4@c See the file elisp.texi for copying conditions. 4@c See the file elisp.texi for copying conditions.
5@setfilename ../info/hooks 5@setfilename ../info/hooks
6@node Standard Hooks, Antinews, Standard Keymaps, Top 6@node Standard Hooks, Index, Standard Keymaps, Top
7@appendix Standard Hooks 7@appendix Standard Hooks
8 8
9The following is a list of hook variables that let you provide 9The following is a list of hook variables that let you provide
@@ -122,5 +122,5 @@ special way (they are passed arguments, or else their values are used).
122@item window-setup-hook 122@item window-setup-hook
123@item write-contents-hooks 123@item write-contents-hooks
124@item write-file-hooks 124@item write-file-hooks
125@item write-region-annotation-functions 125@item write-region-annotate-functions
126@end table 126@end table
diff --git a/lispref/internals.texi b/lispref/internals.texi
index 352dd226d28..c1b17f62b4a 100644
--- a/lispref/internals.texi
+++ b/lispref/internals.texi
@@ -103,8 +103,8 @@ running. It is useful to include this string in bug reports.
103@example 103@example
104@group 104@group
105(emacs-version) 105(emacs-version)
106 @result{} "GNU Emacs 19.22.1 of Fri Feb 27 1994 \ 106 @result{} "GNU Emacs 19.29.1 (i386-debian-linux) \
107on slug (berkeley-unix)" 107 of Tue Jun 6 1995 on balloon"
108@end group 108@end group
109@end example 109@end example
110 110
@@ -113,20 +113,20 @@ echo area.
113@end deffn 113@end deffn
114 114
115@defvar emacs-build-time 115@defvar emacs-build-time
116 The value of this variable is the time at which Emacs was built at the 116The value of this variable is the time at which Emacs was built at the
117local site. 117local site.
118 118
119@example 119@example
120@group 120@group
121emacs-build-time 121emacs-build-time
122 @result{} "Fri Feb 27 14:55:57 1994" 122 @result{} "Tue Jun 6 14:55:57 1995"
123@end group 123@end group
124@end example 124@end example
125@end defvar 125@end defvar
126 126
127@defvar emacs-version 127@defvar emacs-version
128The value of this variable is the version of Emacs being run. It is a 128The value of this variable is the version of Emacs being run. It is a
129string such as @code{"19.22.1"}. 129string such as @code{"19.29.1"}.
130@end defvar 130@end defvar
131 131
132 The following two variables did not exist before Emacs version 19.23, 132 The following two variables did not exist before Emacs version 19.23,
@@ -135,12 +135,12 @@ convenient in the future.
135 135
136@defvar emacs-major-version 136@defvar emacs-major-version
137The major version number of Emacs, as an integer. For Emacs version 137The major version number of Emacs, as an integer. For Emacs version
13819.23, the value is 19. 13819.29, the value is 19.
139@end defvar 139@end defvar
140 140
141@defvar emacs-minor-version 141@defvar emacs-minor-version
142The minor version number of Emacs, as an integer. For Emacs version 142The minor version number of Emacs, as an integer. For Emacs version
14319.23, the value is 23. 14319.29, the value is 29.
144@end defvar 144@end defvar
145 145
146@node Pure Storage, Garbage Collection, Building Emacs, GNU Emacs Internals 146@node Pure Storage, Garbage Collection, Building Emacs, GNU Emacs Internals
@@ -332,7 +332,7 @@ that the subsequent garbage collection does not happen immediately when
332the threshold is exhausted, but only the next time the Lisp evaluator is 332the threshold is exhausted, but only the next time the Lisp evaluator is
333called. 333called.
334 334
335The initial threshold value is 100,000. If you specify a larger 335The initial threshold value is 300,000. If you specify a larger
336value, garbage collection will happen less often. This reduces the 336value, garbage collection will happen less often. This reduces the
337amount of time spent garbage collecting, but increases total memory use. 337amount of time spent garbage collecting, but increases total memory use.
338You may want to do this when running a program that creates lots of 338You may want to do this when running a program that creates lots of
@@ -727,6 +727,10 @@ in this buffer, and their values, with the exception of local variables
727that have special slots in the buffer object. (Those slots are omitted 727that have special slots in the buffer object. (Those slots are omitted
728from this table.) @xref{Buffer-Local Variables}. 728from this table.) @xref{Buffer-Local Variables}.
729 729
730@item base_buffer
731This field holds the buffer's base buffer (if it is an indirect buffer),
732or @code{nil}.
733
730@item keymap 734@item keymap
731This field holds the buffer's local keymap. @xref{Keymaps}. 735This field holds the buffer's local keymap. @xref{Keymaps}.
732 736
@@ -920,4 +924,8 @@ The file descriptor for output to the process.
920The file descriptor for the terminal that the subprocess is using. (On 924The file descriptor for the terminal that the subprocess is using. (On
921some systems, there is no need to record this, so the value is 925some systems, there is no need to record this, so the value is
922@code{nil}.) 926@code{nil}.)
927
928@item tty_name
929The name of the terminal that the subprocess is using,
930or @code{nil} if it is using pipes.
923@end table 931@end table
diff --git a/lispref/intro.texi b/lispref/intro.texi
index f6fe12dfa88..3b310cdf3ed 100644
--- a/lispref/intro.texi
+++ b/lispref/intro.texi
@@ -536,7 +536,7 @@ manual. You may want to skip this section and refer back to it later.
536 536
537 Throughout this manual, the phrases ``the Lisp reader'' and ``the Lisp 537 Throughout this manual, the phrases ``the Lisp reader'' and ``the Lisp
538printer'' are used to refer to those routines in Lisp that convert 538printer'' are used to refer to those routines in Lisp that convert
539textual representations of Lisp objects into actual objects, and vice 539textual representations of Lisp objects into actual Lisp objects, and vice
540versa. @xref{Printed Representation}, for more details. You, the 540versa. @xref{Printed Representation}, for more details. You, the
541person reading this manual, are thought of as ``the programmer'' and are 541person reading this manual, are thought of as ``the programmer'' and are
542addressed as ``you''. ``The user'' is the person who uses Lisp programs, 542addressed as ``you''. ``The user'' is the person who uses Lisp programs,
@@ -554,7 +554,7 @@ in this font or form: @var{first-number}.
554@cindex boolean 554@cindex boolean
555@cindex false 555@cindex false
556 556
557 In Lisp, the symbol @code{nil} is overloaded with three meanings: it 557 In Lisp, the symbol @code{nil} has three separate meanings: it
558is a symbol with the name @samp{nil}; it is the logical truth value 558is a symbol with the name @samp{nil}; it is the logical truth value
559@var{false}; and it is the empty list---the list of zero elements. 559@var{false}; and it is the empty list---the list of zero elements.
560When used as a variable, @code{nil} always has the value @code{nil}. 560When used as a variable, @code{nil} always has the value @code{nil}.
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index 8e09e3e4dfc..274e36f451f 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -74,7 +74,7 @@ intermediate bindings (found for the events before the last) are all
74keymaps; if this is not so, the sequence of events does not form a 74keymaps; if this is not so, the sequence of events does not form a
75unit---it is not really a key sequence. In other words, removing one or 75unit---it is not really a key sequence. In other words, removing one or
76more events from the end of any valid key must always yield a prefix 76more events from the end of any valid key must always yield a prefix
77key. For example, @kbd{C-f C-f} is not a key; @kbd{C-f} is not a prefix 77key. For example, @kbd{C-f C-n} is not a key; @kbd{C-f} is not a prefix
78key, so a longer sequence starting with @kbd{C-f} cannot be a key. 78key, so a longer sequence starting with @kbd{C-f} cannot be a key.
79 79
80 Note that the set of possible multi-event key sequences depends on the 80 Note that the set of possible multi-event key sequences depends on the
@@ -207,6 +207,7 @@ otherwise. More precisely, this function tests for a list whose
207 207
208 Here we describe the functions for creating keymaps. 208 Here we describe the functions for creating keymaps.
209 209
210@c ??? This should come after makr-sparse-keymap
210@defun make-keymap &optional prompt 211@defun make-keymap &optional prompt
211This function creates and returns a new full keymap (i.e., one 212This function creates and returns a new full keymap (i.e., one
212containing a vector of length 128 for defining all the @sc{ASCII} 213containing a vector of length 128 for defining all the @sc{ASCII}
@@ -570,9 +571,8 @@ is the order of @code{minor-mode-map-alist}. But you should design
570minor modes so that they don't interfere with each other. If you do 571minor modes so that they don't interfere with each other. If you do
571this properly, the order will not matter. 572this properly, the order will not matter.
572 573
573See also @code{minor-mode-key-binding} in @ref{Functions for Key 574See also @code{minor-mode-key-binding}, above. See @ref{Keymaps and
574Lookup}. See @ref{Keymaps and Minor Modes}, for more information about 575Minor Modes}, for more information about minor modes.
575minor modes.
576@end defvar 576@end defvar
577 577
578@defvar overriding-local-map 578@defvar overriding-local-map
@@ -594,7 +594,7 @@ menu bar display. So if a menu bar key sequence comes in, you should
594clear @code{overriding-local-map} before looking up and executing that 594clear @code{overriding-local-map} before looking up and executing that
595key sequence. Modes that use @code{overriding-local-map} would 595key sequence. Modes that use @code{overriding-local-map} would
596typically do this anyway; normally they respond to events that they do 596typically do this anyway; normally they respond to events that they do
597not handle by ``unreading'' them and and exiting. 597not handle by ``unreading'' them and exiting.
598@end defvar 598@end defvar
599 599
600@node Key Lookup 600@node Key Lookup
@@ -650,12 +650,11 @@ event of the key sequence is looked up in @var{keymap}.
650The events used so far in the lookup form a complete key, 650The events used so far in the lookup form a complete key,
651and @var{command} is its binding. @xref{What Is a Function}. 651and @var{command} is its binding. @xref{What Is a Function}.
652 652
653@item @var{string} 653@item @var{array}
654@itemx @var{vector}
655@cindex string in keymap 654@cindex string in keymap
656The events used so far in the lookup form a complete key, whose 655The array (either a string or a vector) is a keyboard macro. The events
657binding is a keyboard macro. See @ref{Keyboard Macros}, for more 656used so far in the lookup form a complete key, and the array is its
658information. 657binding. See @ref{Keyboard Macros}, for more information.
659 658
660@item @var{list} 659@item @var{list}
661@cindex list in keymap 660@cindex list in keymap
@@ -685,7 +684,7 @@ binding of @var{othertype} in @var{othermap} and uses that.
685 684
686This feature permits you to define one key as an alias for another key. 685This feature permits you to define one key as an alias for another key.
687For example, an entry whose @sc{car} is the keymap called @code{esc-map} 686For example, an entry whose @sc{car} is the keymap called @code{esc-map}
688and whose @sc{cdr} is 32 (the code for space) means, ``Use the global 687and whose @sc{cdr} is 32 (the code for @key{SPC}) means, ``Use the global
689binding of @kbd{Meta-@key{SPC}}, whatever that may be.'' 688binding of @kbd{Meta-@key{SPC}}, whatever that may be.''
690@end itemize 689@end itemize
691 690
@@ -935,6 +934,10 @@ key name). For example, @code{(control ?a)} is equivalent to
935@code{?\C-a} and @code{(hyper control left)} is equivalent to 934@code{?\C-a} and @code{(hyper control left)} is equivalent to
936@code{C-H-left}. 935@code{C-H-left}.
937 936
937 One advantage of using a list to represent the event type is that the
938precise numeric codes for the modifier bits don't appear in compiled
939files.
940
938 For the functions below, an error is signaled if @var{keymap} is not a 941 For the functions below, an error is signaled if @var{keymap} is not a
939keymap or if @var{key} is not a string or vector representing a key 942keymap or if @var{key} is not a string or vector representing a key
940sequence. You can use event types (symbols) as shorthand for events 943sequence. You can use event types (symbols) as shorthand for events
@@ -1146,6 +1149,13 @@ or
1146@end smallexample 1149@end smallexample
1147 1150
1148@noindent 1151@noindent
1152or
1153
1154@smallexample
1155(global-set-key [(control ?x) (control ?\\)] 'next-line)
1156@end smallexample
1157
1158@noindent
1149redefines @kbd{C-x C-\} to move down a line. 1159redefines @kbd{C-x C-\} to move down a line.
1150 1160
1151@smallexample 1161@smallexample
@@ -1431,8 +1441,8 @@ You can also supply a second string, called the help string, as follows:
1431 1441
1432Currently Emacs does not actually use @var{help-string}; it knows only 1442Currently Emacs does not actually use @var{help-string}; it knows only
1433how to ignore @var{help-string} in order to extract @var{real-binding}. 1443how to ignore @var{help-string} in order to extract @var{real-binding}.
1434In the future we hope to make @var{help-string} serve as extended 1444In the future we may use @var{help-string} as extended documentation for
1435documentation for the menu item, available on request. 1445the menu item, available on request.
1436 1446
1437If @var{real-binding} is @code{nil}, then @var{string} appears in the 1447If @var{real-binding} is @code{nil}, then @var{string} appears in the
1438menu but cannot be selected. 1448menu but cannot be selected.
@@ -1445,6 +1455,11 @@ the menu item only if the expression's value is non-@code{nil}. When a
1445menu item is disabled, it is displayed in a ``fuzzy'' fashion, and 1455menu item is disabled, it is displayed in a ``fuzzy'' fashion, and
1446cannot be selected with the mouse. 1456cannot be selected with the mouse.
1447 1457
1458The menu bar does not recalculate which items are enabled every time you
1459look at a menu. This is because the X toolkit requires the whole tree
1460of menus in advance. To force recalculation of the menu bar, call
1461@code{force-mode-line-update} (@pxref{Mode Line Format}).
1462
1448Sometimes it is useful to make menu items that use the ``same'' command 1463Sometimes it is useful to make menu items that use the ``same'' command
1449but with different enable conditions. You can do this by defining alias 1464but with different enable conditions. You can do this by defining alias
1450commands. Here's an example that makes two aliases for 1465commands. Here's an example that makes two aliases for
@@ -1539,10 +1554,14 @@ When the user has found the desired alternative from the menu, he or she
1539should type the corresponding character---the one whose binding is that 1554should type the corresponding character---the one whose binding is that
1540alternative. 1555alternative.
1541 1556
1557@ignore
1542In a menu intended for keyboard use, each menu item must clearly 1558In a menu intended for keyboard use, each menu item must clearly
1543indicate what character to type. The best convention to use is to make 1559indicate what character to type. The best convention to use is to make
1544the character the first letter of the item string. That is something 1560the character the first letter of the item string---that is something
1545users will understand without being told. 1561users will understand without being told. We plan to change this; by
1562the time you read this manual, keyboard menus may explicitly name the
1563key for each alternative.
1564@end ignore
1546 1565
1547This way of using menus in an Emacs-like editor was inspired by the 1566This way of using menus in an Emacs-like editor was inspired by the
1548Hierarkey system. 1567Hierarkey system.
@@ -1616,8 +1635,8 @@ were @code{nil}. @xref{Active Keymaps}.
1616parameter must be greater than zero. Emacs uses just one line for the 1635parameter must be greater than zero. Emacs uses just one line for the
1617menu bar itself; if you specify more than one line, the other lines 1636menu bar itself; if you specify more than one line, the other lines
1618serve to separate the menu bar from the windows in the frame. We 1637serve to separate the menu bar from the windows in the frame. We
1619recommend you try 1 or 2 as the value of @code{menu-bar-lines}. @xref{X 1638recommend 1 or 2 as the value of @code{menu-bar-lines}. @xref{X Frame
1620Frame Parameters}. 1639Parameters}.
1621 1640
1622 Here's an example of setting up a menu bar item: 1641 Here's an example of setting up a menu bar item:
1623 1642
diff --git a/lispref/lists.texi b/lispref/lists.texi
index 55ce93c9547..6bb33b80126 100644
--- a/lispref/lists.texi
+++ b/lispref/lists.texi
@@ -543,9 +543,9 @@ Here are some examples where the final argument is not a list:
543 543
544@example 544@example
545(append '(x y) 'z) 545(append '(x y) 'z)
546 @result{} (x y z) 546 @result{} (x y . z)
547(append '(x y) [z]) 547(append '(x y) [z])
548 @result{} (x y [z]) 548 @result{} (x y . [z])
549@end example 549@end example
550 550
551@noindent 551@noindent
@@ -980,11 +980,6 @@ sorted order. If you wish to make a sorted copy without destroying the
980original, copy it first with @code{copy-sequence} and then sort. 980original, copy it first with @code{copy-sequence} and then sort.
981 981
982Sorting does not change the @sc{car}s of the cons cells in @var{list}; 982Sorting does not change the @sc{car}s of the cons cells in @var{list};
983each cons cell in the result contains the same element that it contained
984before. The result differs from the argument @var{list} because the
985cells themselves have been reordered.
986
987Sorting does not change the @sc{car}s of the cons cells in @var{list};
988the cons cell that originally contained the element @code{a} in 983the cons cell that originally contained the element @code{a} in
989@var{list} still has @code{a} in its @sc{car} after sorting, but it now 984@var{list} still has @code{a} in its @sc{car} after sorting, but it now
990appears in a different position in the list due to the change of 985appears in a different position in the list due to the change of
@@ -1106,8 +1101,8 @@ sample-list
1106@end group 1101@end group
1107@end example 1102@end example
1108 1103
1109Note that @code{(delq 'b sample-list)} modifies @code{sample-list} to 1104Note that @code{(delq 'c sample-list)} modifies @code{sample-list} to
1110splice out the second element, but @code{(delq 'a sample-list)} does not 1105splice out the third element, but @code{(delq 'a sample-list)} does not
1111splice anything---it just returns a shorter list. Don't assume that a 1106splice anything---it just returns a shorter list. Don't assume that a
1112variable which formerly held the argument @var{list} now has fewer 1107variable which formerly held the argument @var{list} now has fewer
1113elements, or that it still holds the original list! Instead, save the 1108elements, or that it still holds the original list! Instead, save the
@@ -1178,6 +1173,9 @@ GNU Emacs Lisp are derived from Maclisp, not Common Lisp. The Common
1178Lisp versions do not use @code{equal} to compare elements. 1173Lisp versions do not use @code{equal} to compare elements.
1179@end quotation 1174@end quotation
1180 1175
1176 See also the function @code{add-to-list}, in @ref{Setting Variables},
1177for another way to add an element to a list stored in a variable.
1178
1181@node Association Lists 1179@node Association Lists
1182@section Association Lists 1180@section Association Lists
1183@cindex association list 1181@cindex association list
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 645ada83976..3f88132b20b 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -37,7 +37,7 @@ containing Lisp code.
37* How Programs Do Loading:: The @code{load} function and others. 37* How Programs Do Loading:: The @code{load} function and others.
38* Autoload:: Setting up a function to autoload. 38* Autoload:: Setting up a function to autoload.
39* Repeated Loading:: Precautions about loading a file twice. 39* Repeated Loading:: Precautions about loading a file twice.
40* Features:: Loading a library if it isn't already loaded. 40* Named Features:: Loading a library if it isn't already loaded.
41* Unloading:: How to ``unload'' a library that was loaded. 41* Unloading:: How to ``unload'' a library that was loaded.
42* Hooks for Loading:: Providing code to be run when 42* Hooks for Loading:: Providing code to be run when
43 particular libraries are loaded. 43 particular libraries are loaded.
@@ -50,7 +50,7 @@ containing Lisp code.
50@code{autoload} creates a placeholder object for a function in a file; 50@code{autoload} creates a placeholder object for a function in a file;
51trying to call the autoloading function loads the file to get the 51trying to call the autoloading function loads the file to get the
52function's real definition (@pxref{Autoload}). @code{require} loads a 52function's real definition (@pxref{Autoload}). @code{require} loads a
53file if it isn't already loaded (@pxref{Features}). Ultimately, all 53file if it isn't already loaded (@pxref{Named Features}). Ultimately, all
54these facilities call the @code{load} function to do the work. 54these facilities call the @code{load} function to do the work.
55 55
56@defun load filename &optional missing-ok nomessage nosuffix 56@defun load filename &optional missing-ok nomessage nosuffix
@@ -136,9 +136,10 @@ default value is specified in @file{emacs/src/paths.h} when Emacs is
136built. 136built.
137 137
138The syntax of @code{EMACSLOADPATH} is the same as used for @code{PATH}; 138The syntax of @code{EMACSLOADPATH} is the same as used for @code{PATH};
139@samp{:} separates directory names, and @samp{.} is used for the current 139@samp{:} (or @samp{;}, according to the operating system) separates
140default directory. Here is an example of how to set your 140directory names, and @samp{.} is used for the current default directory.
141@code{EMACSLOADPATH} variable from a @code{csh} @file{.login} file: 141Here is an example of how to set your @code{EMACSLOADPATH} variable from
142a @code{csh} @file{.login} file:
142 143
143@c This overfull hbox is OK. --rjc 16mar92 144@c This overfull hbox is OK. --rjc 16mar92
144@smallexample 145@smallexample
@@ -192,9 +193,7 @@ calls to @code{load}.
192 193
193@defvar load-in-progress 194@defvar load-in-progress
194This variable is non-@code{nil} if Emacs is in the process of loading a 195This variable is non-@code{nil} if Emacs is in the process of loading a
195file, and it is @code{nil} otherwise. This is how @code{defun} and 196file, and it is @code{nil} otherwise.
196@code{provide} determine whether a load is in progress, so that their
197effect can be undone if the load fails.
198@end defvar 197@end defvar
199 198
200@defvar load-read-function 199@defvar load-read-function
@@ -213,9 +212,9 @@ functions should use @code{read}.
213@cindex autoload 212@cindex autoload
214 213
215 The @dfn{autoload} facility allows you to make a function or macro 214 The @dfn{autoload} facility allows you to make a function or macro
216available but put off loading its actual definition. The first call to 215known in Lisp, but put off loading the file that defines it. The first
217the function automatically reads the proper file to install the real 216call to the function automatically reads the proper file to install the
218definition and other associated code, then runs the real definition 217real definition and other associated code, then runs the real definition
219as if it had been loaded all along. 218as if it had been loaded all along.
220 219
221 There are two ways to set up an autoloaded function: by calling 220 There are two ways to set up an autoloaded function: by calling
@@ -378,11 +377,16 @@ To avoid the problem, write this:
378 (cons '(leif-mode " Leif") minor-mode-alist))) 377 (cons '(leif-mode " Leif") minor-mode-alist)))
379@end example 378@end example
380 379
380 To add an element to a list just once, use @code{add-to-list}
381(@pxref{Setting Variables}).
382
381 Occasionally you will want to test explicitly whether a library has 383 Occasionally you will want to test explicitly whether a library has
382already been loaded. Here's one way to test, in a library, whether it 384already been loaded. Here's one way to test, in a library, whether it
383has been loaded before: 385has been loaded before:
384 386
385@example 387@example
388(defvar foo-was-loaded)
389
386(if (not (boundp 'foo-was-loaded)) 390(if (not (boundp 'foo-was-loaded))
387 @var{execute-first-time-only}) 391 @var{execute-first-time-only})
388 392
@@ -393,10 +397,10 @@ has been loaded before:
393If the library uses @code{provide} to provide a named feature, you can 397If the library uses @code{provide} to provide a named feature, you can
394use @code{featurep} to test whether the library has been loaded. 398use @code{featurep} to test whether the library has been loaded.
395@ifinfo 399@ifinfo
396@xref{Features}. 400@xref{Named Features}.
397@end ifinfo 401@end ifinfo
398 402
399@node Features 403@node Named Features
400@section Features 404@section Features
401@cindex features 405@cindex features
402@cindex requiring features 406@cindex requiring features
@@ -500,9 +504,10 @@ features
500 @result{} (foo bar bish) 504 @result{} (foo bar bish)
501@end smallexample 505@end smallexample
502 506
503If the file isn't completely loaded, due to an error in the evaluating 507When a file is loaded to satisfy an autoload, and it stops due to an
504its contents, any function definitions or @code{provide} calls that 508error in the evaluating its contents, any function definitions or
505occurred during the load are undone. @xref{Autoload}. 509@code{provide} calls that occurred during the load are undone.
510@xref{Autoload}.
506@end defun 511@end defun
507 512
508@defun require feature &optional filename 513@defun require feature &optional filename
@@ -544,7 +549,8 @@ This command unloads the library that provided feature @var{feature}.
544It undefines all functions, macros, and variables defined in that 549It undefines all functions, macros, and variables defined in that
545library with @code{defconst}, @code{defvar}, @code{defun}, 550library with @code{defconst}, @code{defvar}, @code{defun},
546@code{defmacro}, @code{defsubst} and @code{defalias}. It then restores 551@code{defmacro}, @code{defsubst} and @code{defalias}. It then restores
547any autoloads formerly associated with those symbols. 552any autoloads formerly associated with those symbols. (Loading
553saves these in the @code{autoload} property of the symbol.)
548 554
549Ordinarily, @code{unload-feature} refuses to unload a library on which 555Ordinarily, @code{unload-feature} refuses to unload a library on which
550other loaded libraries depend. (A library @var{a} depends on library 556other loaded libraries depend. (A library @var{a} depends on library
@@ -615,7 +621,7 @@ do (1), you can do it immediately---there is no need to wait for when
615the library is loaded. To do (2), you must load the library (preferably 621the library is loaded. To do (2), you must load the library (preferably
616with @code{require}). 622with @code{require}).
617 623
618But it is to use @code{eval-after-load} in your personal customizations 624But it is ok to use @code{eval-after-load} in your personal customizations
619if you don't feel they must meet the design standards of programs to be 625if you don't feel they must meet the design standards of programs to be
620released. 626released.
621 627
diff --git a/lispref/locals.texi b/lispref/locals.texi
index 24db38d7f60..86e6750248c 100644
--- a/lispref/locals.texi
+++ b/lispref/locals.texi
@@ -28,6 +28,9 @@ define such variables for their internal use; we don't list them here.
28@item buffer-display-table 28@item buffer-display-table
29@pxref{Display Tables} 29@pxref{Display Tables}
30 30
31@item buffer-file-format
32@pxref{Format Conversion}
33
31@item buffer-file-name 34@item buffer-file-name
32@pxref{Buffer File Name} 35@pxref{Buffer File Name}
33 36
@@ -40,6 +43,9 @@ define such variables for their internal use; we don't list them here.
40@item buffer-file-type 43@item buffer-file-type
41@pxref{Files and MS-DOS} 44@pxref{Files and MS-DOS}
42 45
46@item buffer-invisibility-spec
47@pxref{Invisible Text}
48
43@item buffer-offer-save 49@item buffer-offer-save
44@pxref{Saving Buffers} 50@pxref{Saving Buffers}
45 51
@@ -121,6 +127,9 @@ define such variables for their internal use; we don't list them here.
121@item paragraph-start 127@item paragraph-start
122@pxref{Standard Regexps} 128@pxref{Standard Regexps}
123 129
130@item point-before-scroll
131Used for communication between mouse commands and scroll-bar commands.
132
124@item require-final-newline 133@item require-final-newline
125@pxref{Insertion} 134@pxref{Insertion}
126 135
diff --git a/lispref/macros.texi b/lispref/macros.texi
index c5cf625c8c7..22a07f14dbe 100644
--- a/lispref/macros.texi
+++ b/lispref/macros.texi
@@ -163,8 +163,11 @@ macro in the same file where it is used and before its first use.
163 Byte-compiling a file executes any @code{require} calls at top-level 163 Byte-compiling a file executes any @code{require} calls at top-level
164in the file. This is in case the file needs the required packages for 164in the file. This is in case the file needs the required packages for
165proper compilation. One way to ensure that necessary macro definitions 165proper compilation. One way to ensure that necessary macro definitions
166are available during compilation is to require the file that defines 166are available during compilation is to require the files that define
167them. @xref{Features}. 167them (@pxref{Named Features}). To avoid loading the macro definition files
168when someone @emph{runs} the compiled program, write
169@code{eval-when-compile} around the @code{require} calls (@pxref{Eval
170During Compile}).
168 171
169@node Defining Macros 172@node Defining Macros
170@section Defining Macros 173@section Defining Macros
@@ -176,9 +179,9 @@ from the macro call.
176 179
177 It is possible to use an anonymous Lisp macro just like an anonymous 180 It is possible to use an anonymous Lisp macro just like an anonymous
178function, but this is never done, because it does not make sense to pass 181function, but this is never done, because it does not make sense to pass
179an anonymous macro to mapping functions such as @code{mapcar}. In 182an anonymous macro to functionals such as @code{mapcar}. In practice,
180practice, all Lisp macros have names, and they are usually defined with 183all Lisp macros have names, and they are usually defined with the
181the special form @code{defmacro}. 184special form @code{defmacro}.
182 185
183@defspec defmacro name argument-list body-forms@dots{} 186@defspec defmacro name argument-list body-forms@dots{}
184@code{defmacro} defines the symbol @var{name} as a macro that looks 187@code{defmacro} defines the symbol @var{name} as a macro that looks
@@ -207,7 +210,7 @@ called interactively.
207 210
208 Macros often need to construct large list structures from a mixture of 211 Macros often need to construct large list structures from a mixture of
209constants and nonconstant parts. To make this easier, use the macro 212constants and nonconstant parts. To make this easier, use the macro
210@code{`} (often called @dfn{backquote}). 213@samp{`} (often called @dfn{backquote}).
211 214
212 Backquote allows you to quote a list, but selectively evaluate 215 Backquote allows you to quote a list, but selectively evaluate
213elements of that list. In the simplest case, it is identical to the 216elements of that list. In the simplest case, it is identical to the
@@ -226,9 +229,9 @@ two forms yield identical results:
226@end example 229@end example
227 230
228@findex , @r{(with Backquote)} 231@findex , @r{(with Backquote)}
229The special marker @code{,} inside of the argument to backquote 232The special marker @samp{,} inside of the argument to backquote
230indicates a value that isn't constant. Backquote evaluates the 233indicates a value that isn't constant. Backquote evaluates the
231argument of @code{,} and puts the value in the list structure: 234argument of @samp{,} and puts the value in the list structure:
232 235
233@example 236@example
234@group 237@group
@@ -244,9 +247,9 @@ argument of @code{,} and puts the value in the list structure:
244@findex ,@@ @r{(with Backquote)} 247@findex ,@@ @r{(with Backquote)}
245@cindex splicing (with backquote) 248@cindex splicing (with backquote)
246You can also @dfn{splice} an evaluated value into the resulting list, 249You can also @dfn{splice} an evaluated value into the resulting list,
247using the special marker @code{,@@}. The elements of the spliced list 250using the special marker @samp{,@@}. The elements of the spliced list
248become elements at the same level as the other elements of the resulting 251become elements at the same level as the other elements of the resulting
249list. The equivalent code without using @code{`} is often unreadable. 252list. The equivalent code without using @samp{`} is often unreadable.
250Here are some examples: 253Here are some examples:
251 254
252@example 255@example
@@ -280,12 +283,12 @@ Here are some examples:
280@end example 283@end example
281 284
282@quotation 285@quotation
283Before Emacs version 19.29, @code{`} used a different syntax which 286Before Emacs version 19.29, @samp{`} used a different syntax which
284required an extra level of parentheses around the entire backquote 287required an extra level of parentheses around the entire backquote
285construct. Likewise, each @code{,} or @code{,@@} substition required an 288construct. Likewise, each @samp{,} or @samp{,@@} substition required an
286extra level of parentheses surrounding both the @code{,} or @code{,@@} 289extra level of parentheses surrounding both the @samp{,} or @samp{,@@}
287and the following expression. The old syntax required whitespace 290and the following expression. The old syntax required whitespace
288between the @code{`}, @code{,} or @code{,@@} and the following 291between the @samp{`}, @samp{,} or @samp{,@@} and the following
289expression. 292expression.
290 293
291This syntax is still accepted, but no longer recommended except for 294This syntax is still accepted, but no longer recommended except for
@@ -363,10 +366,10 @@ Here's an equivalent definition simplified through use of backquote:
363(defmacro for (var from init to final do &rest body) 366(defmacro for (var from init to final do &rest body)
364 "Execute a simple \"for\" loop. 367 "Execute a simple \"for\" loop.
365For example, (for i from 1 to 10 do (print i))." 368For example, (for i from 1 to 10 do (print i))."
366 (` (let (((, var) (, init))) 369 `(let ((,var ,init))
367 (while (<= (, var) (, final)) 370 (while (<= ,var ,final)
368 (,@@ body) 371 ,@@body
369 (inc (, var)))))) 372 (inc ,var))))
370@end group 373@end group
371@end smallexample 374@end smallexample
372 375
@@ -400,11 +403,11 @@ Here is a macro definition that creates this expansion:
400@group 403@group
401(defmacro for (var from init to final do &rest body) 404(defmacro for (var from init to final do &rest body)
402 "Execute a simple for loop: (for i from 1 to 10 do (print i))." 405 "Execute a simple for loop: (for i from 1 to 10 do (print i))."
403 (` (let (((, var) (, init)) 406 `(let ((,var ,init)
404 (max (, final))) 407 (max ,final))
405 (while (<= (, var) max) 408 (while (<= ,var max)
406 (,@@ body) 409 ,@@body
407 (inc (, var)))))) 410 (inc ,var))))
408@end group 411@end group
409@end smallexample 412@end smallexample
410 413
@@ -427,11 +430,11 @@ number of times:
427 "Execute a simple for loop: (for i from 1 to 10 do (print i))." 430 "Execute a simple for loop: (for i from 1 to 10 do (print i))."
428@end group 431@end group
429@group 432@group
430 (` (let (((, var) (, init)) 433 `(let ((,var ,init)
431 (max (, final))) 434 (max ,final))
432 (while (<= (, var) max) 435 (while (<= ,var max)
433 (,@@ body) 436 ,@@body
434 (inc (, var)))))) 437 (inc ,var))))
435@end group 438@end group
436@end smallexample 439@end smallexample
437@end ifinfo 440@end ifinfo
@@ -469,11 +472,11 @@ this way:
469(defmacro for (var from init to final do &rest body) 472(defmacro for (var from init to final do &rest body)
470 "Execute a simple for loop: (for i from 1 to 10 do (print i))." 473 "Execute a simple for loop: (for i from 1 to 10 do (print i))."
471 (let ((tempvar (make-symbol "max"))) 474 (let ((tempvar (make-symbol "max")))
472 (` (let (((, var) (, init)) 475 `(let ((,var ,init)
473 ((, tempvar) (, final))) 476 (,tempvar ,final))
474 (while (<= (, var) (, tempvar)) 477 (while (<= ,var ,tempvar)
475 (,@@ body) 478 ,@@body
476 (inc (, var))))))) 479 (inc ,var)))))
477@end group 480@end group
478@end smallexample 481@end smallexample
479 482
diff --git a/lispref/maps.texi b/lispref/maps.texi
index d27be34d76e..77dc80001b9 100644
--- a/lispref/maps.texi
+++ b/lispref/maps.texi
@@ -29,9 +29,15 @@ A sparse keymap used by C mode.
29A full keymap used by Command History mode. 29A full keymap used by Command History mode.
30 30
31@item ctl-x-4-map 31@item ctl-x-4-map
32@vindex ctl-x-4-map
32A sparse keymap for subcommands of the prefix @kbd{C-x 4}. 33A sparse keymap for subcommands of the prefix @kbd{C-x 4}.
33 34
35@item ctl-x-5-map
36@vindex ctl-x-5-map
37A sparse keymap for subcommands of the prefix @kbd{C-x 5}.
38
34@item ctl-x-map 39@item ctl-x-map
40@vindex ctl-x-map
35A full keymap for @kbd{C-x} commands. 41A full keymap for @kbd{C-x} commands.
36 42
37@item debugger-mode-map 43@item debugger-mode-map
@@ -42,10 +48,6 @@ A full keymap used by Debugger mode.
42@vindex dired-mode-map 48@vindex dired-mode-map
43A full keymap for @code{dired-mode} buffers. 49A full keymap for @code{dired-mode} buffers.
44 50
45@item doctor-mode-map
46@vindex doctor-mode-map
47A sparse keymap used by Doctor mode.
48
49@item edit-abbrevs-map 51@item edit-abbrevs-map
50@vindex edit-abbrevs-map 52@vindex edit-abbrevs-map
51A sparse keymap used in @code{edit-abbrevs}. 53A sparse keymap used in @code{edit-abbrevs}.
@@ -66,6 +68,38 @@ A full keymap used by Electric Command History mode.
66@vindex emacs-lisp-mode-map 68@vindex emacs-lisp-mode-map
67A sparse keymap used by Emacs Lisp mode. 69A sparse keymap used by Emacs Lisp mode.
68 70
71@item facemenu-menu
72@vindex facemenu-menu
73The keymap that displays the Text Properties menu.
74
75@item facemenu-background-menu
76@vindex facemenu-background-menu
77The keymap that displays the Background Color submenu of the Text
78Properties menu.
79
80@item facemenu-face-menu
81@vindex facemenu-face-menu
82The keymap that displays the Face submenu of the Text Properties menu.
83
84@item facemenu-foreground-menu
85@vindex facemenu-foreground-menu
86The keymap that displays the Foreground Color submenu of the Text
87Properties menu.
88
89@item facemenu-indentation-menu
90@vindex facemenu-indentation-menu
91The keymap that displays the Indentation submenu of the Text Properties menu.
92
93@item facemenu-justification-menu
94@vindex facemenu-justification-menu
95The keymap that displays the Justification submenu of the Text
96Properties menu.
97
98@item facemenu-special-menu
99@vindex facemenu-special-menu
100The keymap that displays the Special Props submenu of the Text
101Properties menu.
102
69@item function-key-map 103@item function-key-map
70@vindex function-key-map 104@vindex function-key-map
71The keymap for translating keypad and function keys.@* 105The keymap for translating keypad and function keys.@*
@@ -91,6 +125,7 @@ A sparse keymap used by the @kbd{e} command of Info.
91A sparse keymap containing Info commands. 125A sparse keymap containing Info commands.
92 126
93@item isearch-mode-map 127@item isearch-mode-map
128@vindex isearch-mode-map
94A keymap that defines the characters you can type within incremental 129A keymap that defines the characters you can type within incremental
95search. 130search.
96 131
@@ -107,7 +142,28 @@ A sparse keymap used by Lisp mode.
107@vindex lisp-mode-map 142@vindex lisp-mode-map
108A sparse keymap used by Lisp mode. 143A sparse keymap used by Lisp mode.
109 144
145@item menu-bar-edit-menu
146@vindex menu-bar-edit-menu
147The keymap which displays the Edit menu in the menu bar.
148
149@item menu-bar-files-menu
150@vindex menu-bar-files-menu
151The keymap which displays the Files menu in the menu bar.
152
153@item menu-bar-help-menu
154@vindex menu-bar-help-menu
155The keymap which displays the Help menu in the menu bar.
156
157@item menu-bar-search-menu
158@vindex menu-bar-search-menu
159The keymap which displays the Search menu in the menu bar.
160
161@item menu-bar-tools-menu
162@vindex menu-bar-tools-menu
163The keymap which displays the Tools menu in the menu bar.
164
110@item mode-specific-map 165@item mode-specific-map
166@vindex mode-specific-map
111The keymap for characters following @kbd{C-c}. Note, this is in the 167The keymap for characters following @kbd{C-c}. Note, this is in the
112global map. This map is not actually mode specific: its name was chosen 168global map. This map is not actually mode specific: its name was chosen
113to be informative for the user in @kbd{C-h b} (@code{display-bindings}), 169to be informative for the user in @kbd{C-h b} (@code{display-bindings}),
@@ -118,6 +174,7 @@ where it describes the main use of the @kbd{C-c} prefix key.
118A local keymap used by Occur mode. 174A local keymap used by Occur mode.
119 175
120@item query-replace-map 176@item query-replace-map
177@vindex query-replace-map
121A local keymap used for responses in @code{query-replace} and related 178A local keymap used for responses in @code{query-replace} and related
122commands; also for @code{y-or-n-p} and @code{map-y-or-n-p}. The functions 179commands; also for @code{y-or-n-p} and @code{map-y-or-n-p}. The functions
123that use this map do not support prefix keys; they look up one event at a 180that use this map do not support prefix keys; they look up one event at a
diff --git a/lispref/markers.texi b/lispref/markers.texi
index ef991890a18..8c41fa17f17 100644
--- a/lispref/markers.texi
+++ b/lispref/markers.texi
@@ -496,10 +496,10 @@ The return value is not meaningful.
496 496
497@defopt transient-mark-mode 497@defopt transient-mark-mode
498@cindex Transient Mark mode 498@cindex Transient Mark mode
499This variable enables Transient Mark mode, in which every 499This variable if non-@code{nil} enables Transient Mark mode, in which
500buffer-modifying primitive sets @code{deactivate-mark}. The consequence 500every buffer-modifying primitive sets @code{deactivate-mark}. The
501of this is that commands that modify the buffer normally make the mark 501consequence of this is that commands that modify the buffer normally
502inactive. 502make the mark inactive.
503@end defopt 503@end defopt
504 504
505@defvar deactivate-mark 505@defvar deactivate-mark
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index 10dc146535e..17efa0e8dc8 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -61,7 +61,7 @@ name on command symbols (@pxref{Minibuffer Misc}).
61 61
62 Like other buffers, a minibuffer may use any of several local keymaps 62 Like other buffers, a minibuffer may use any of several local keymaps
63(@pxref{Keymaps}); these contain various exit commands and in some cases 63(@pxref{Keymaps}); these contain various exit commands and in some cases
64completion commands. @xref{Completion}. 64completion commands (@pxref{Completion}).
65 65
66@itemize @bullet 66@itemize @bullet
67@item 67@item
@@ -87,6 +87,11 @@ also be used to read a Lisp object in textual form. The most basic
87primitive for minibuffer input is @code{read-from-minibuffer}; it can do 87primitive for minibuffer input is @code{read-from-minibuffer}; it can do
88either one. 88either one.
89 89
90 In most cases, you should not call minibuffer input functions in the
91middle of a Lisp function. Instead, do all minibuffer input as part of
92reading the arguments for a command, in the @code{interactive} spec.
93@xref{Defining Commands}.
94
90@defun read-from-minibuffer prompt-string &optional initial-contents keymap read hist 95@defun read-from-minibuffer prompt-string &optional initial-contents keymap read hist
91This function is the most general way to get input through the 96This function is the most general way to get input through the
92minibuffer. By default, it accepts arbitrary text and returns it as a 97minibuffer. By default, it accepts arbitrary text and returns it as a
@@ -199,12 +204,9 @@ possible to put a space into the string, by quoting it.
199@defvar minibuffer-local-ns-map 204@defvar minibuffer-local-ns-map
200This built-in variable is the keymap used as the minibuffer local keymap 205This built-in variable is the keymap used as the minibuffer local keymap
201in the function @code{read-no-blanks-input}. By default, it makes the 206in the function @code{read-no-blanks-input}. By default, it makes the
202following bindings: 207following bindings, in addition to those of @code{minibuffer-local-map}:
203 208
204@table @asis 209@table @asis
205@item @key{LFD}
206@code{exit-minibuffer}
207
208@item @key{SPC} 210@item @key{SPC}
209@cindex @key{SPC} in minibuffer 211@cindex @key{SPC} in minibuffer
210@code{exit-minibuffer} 212@code{exit-minibuffer}
@@ -213,27 +215,9 @@ following bindings:
213@cindex @key{TAB} in minibuffer 215@cindex @key{TAB} in minibuffer
214@code{exit-minibuffer} 216@code{exit-minibuffer}
215 217
216@item @key{RET}
217@code{exit-minibuffer}
218
219@item @kbd{C-g}
220@code{abort-recursive-edit}
221
222@item @kbd{?} 218@item @kbd{?}
223@cindex @kbd{?} in minibuffer 219@cindex @kbd{?} in minibuffer
224@code{self-insert-and-exit} 220@code{self-insert-and-exit}
225
226@item @kbd{M-n}
227@code{next-history-element}
228
229@item @kbd{M-p}
230@code{previous-history-element}
231
232@item @kbd{M-r}
233@code{next-matching-history-element}
234
235@item @kbd{M-s}
236@code{previous-matching-history-element}
237@end table 221@end table
238@end defvar 222@end defvar
239 223
@@ -805,6 +789,11 @@ can be completed because the next character is not uniquely determined.
805 This section describes the higher-level convenient functions for 789 This section describes the higher-level convenient functions for
806reading certain sorts of names with completion. 790reading certain sorts of names with completion.
807 791
792 In most cases, you should not call these functions in the middle of a
793Lisp function. When possible, do all minibuffer input as part of
794reading the arguments for a command, in the @code{interactive} spec.
795@xref{Defining Commands}.
796
808@defun read-buffer prompt &optional default existing 797@defun read-buffer prompt &optional default existing
809This function reads the name of a buffer and returns it as a string. 798This function reads the name of a buffer and returns it as a string.
810The argument @var{default} is the default name to use, the value to 799The argument @var{default} is the default name to use, the value to
@@ -1000,7 +989,8 @@ This variable is used by @code{read-file-name}. Its value controls
1000whether @code{read-file-name} starts by placing the name of the default 989whether @code{read-file-name} starts by placing the name of the default
1001directory in the minibuffer, plus the initial file name if any. If the 990directory in the minibuffer, plus the initial file name if any. If the
1002value of this variable is @code{nil}, then @code{read-file-name} does 991value of this variable is @code{nil}, then @code{read-file-name} does
1003not place any initial input in the minibuffer. In that case, the 992not place any initial input in the minibuffer (unless you specify
993initial input with the @var{initial} argument). In that case, the
1004default directory is still used for completion of relative file names, 994default directory is still used for completion of relative file names,
1005but is not displayed. 995but is not displayed.
1006 996
@@ -1085,7 +1075,7 @@ match for some possibility; @code{nil} otherwise.
1085@end itemize 1075@end itemize
1086 1076
1087 It would be consistent and clean for completion functions to allow 1077 It would be consistent and clean for completion functions to allow
1088lambda expressions (lists tha are functions) as well as function 1078lambda expressions (lists that are functions) as well as function
1089symbols as @var{collection}, but this is impossible. Lists as 1079symbols as @var{collection}, but this is impossible. Lists as
1090completion tables are already assigned another meaning---as alists. It 1080completion tables are already assigned another meaning---as alists. It
1091would be unreliable to fail to handle an alist normally because it is 1081would be unreliable to fail to handle an alist normally because it is
@@ -1357,6 +1347,16 @@ This command replaces the minibuffer contents with the value of the next
1357expression). 1347expression).
1358@end deffn 1348@end deffn
1359 1349
1350@defun minibuffer-prompt
1351This function returns the prompt string of the currently active
1352minibuffer. If no minibuffer is active, it returns @code{nil}.
1353@end defun
1354
1355@defun minibuffer-prompt-width
1356This function returns the display width of the prompt string of the
1357currently active minibuffer. If no minibuffer is active, it returns 0.
1358@end defun
1359
1360@defvar minibuffer-setup-hook 1360@defvar minibuffer-setup-hook
1361This is a normal hook that is run whenever the minibuffer is entered. 1361This is a normal hook that is run whenever the minibuffer is entered.
1362@xref{Hooks}. 1362@xref{Hooks}.
@@ -1415,16 +1415,6 @@ minibuffer, a nonnegative integer. If no minibuffers are active, it
1415returns zero. 1415returns zero.
1416@end defun 1416@end defun
1417 1417
1418@defun minibuffer-prompt
1419This function returns the prompt string of the currently active
1420minibuffer. If no minibuffer is active, it returns @code{nil}.
1421@end defun
1422
1423@defun minibuffer-prompt-width
1424This function returns the display width of the prompt string of the
1425currently active minibuffer. If no minibuffer is active, it returns 0.
1426@end defun
1427
1428@defopt enable-recursive-minibuffers 1418@defopt enable-recursive-minibuffers
1429If this variable is non-@code{nil}, you can invoke commands (such as 1419If this variable is non-@code{nil}, you can invoke commands (such as
1430@code{find-file}) that use minibuffers even while in the minibuffer 1420@code{find-file}) that use minibuffers even while in the minibuffer
@@ -1442,5 +1432,5 @@ window is selected.
1442If a command name has a property @code{enable-recursive-minibuffers} 1432If a command name has a property @code{enable-recursive-minibuffers}
1443that is non-@code{nil}, then the command can use the minibuffer to read 1433that is non-@code{nil}, then the command can use the minibuffer to read
1444arguments even if it is invoked from the minibuffer. The minibuffer 1434arguments even if it is invoked from the minibuffer. The minibuffer
1445command @code{next-matching-history-element} (normally bound to 1435command @code{next-matching-history-element} (normally @kbd{M-s} in the
1446@kbd{M-s} in the minibuffer) uses this feature. 1436minibuffer) uses this feature.
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 1927797080b..77cb11302a0 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -395,6 +395,8 @@ rest of @code{lisp-mode-variables}.
395@smallexample 395@smallexample
396@group 396@group
397 (make-local-variable 'paragraph-start) 397 (make-local-variable 'paragraph-start)
398 ;; @r{Having @samp{^} is not clean, but @code{page-delimiter}}
399 ;; @r{has them too, and removing those is a pain.}
398 (setq paragraph-start (concat "^$\\|" page-delimiter)) 400 (setq paragraph-start (concat "^$\\|" page-delimiter))
399 @dots{} 401 @dots{}
400@end group 402@end group
@@ -486,25 +488,25 @@ state of Emacs.)
486@end deffn 488@end deffn
487 489
488@deffn Command normal-mode &optional find-file 490@deffn Command normal-mode &optional find-file
489 This function establishes the proper major mode and local variable 491This function establishes the proper major mode and local variable
490bindings for the current buffer. First it calls @code{set-auto-mode}, 492bindings for the current buffer. First it calls @code{set-auto-mode},
491then it runs @code{hack-local-variables} to parse, and bind or 493then it runs @code{hack-local-variables} to parse, and bind or
492evaluate as appropriate, any local variables. 494evaluate as appropriate, any local variables.
493 495
494 If the @var{find-file} argument to @code{normal-mode} is 496If the @var{find-file} argument to @code{normal-mode} is
495non-@code{nil}, @code{normal-mode} assumes that the @code{find-file} 497non-@code{nil}, @code{normal-mode} assumes that the @code{find-file}
496function is calling it. In this case, it may process a local variables 498function is calling it. In this case, it may process a local variables
497list at the end of the file. The variable @code{enable-local-variables} 499list at the end of the file and in the @samp{-*-} line. The variable
498controls whether to do so. 500@code{enable-local-variables} controls whether to do so.
499 501
500 If you run @code{normal-mode} interactively, the argument 502If you run @code{normal-mode} interactively, the argument
501@var{find-file} is normally @code{nil}. In this case, 503@var{find-file} is normally @code{nil}. In this case,
502@code{normal-mode} unconditionally processes any local variables list. 504@code{normal-mode} unconditionally processes any local variables list.
503@xref{File variables, , Local Variables in Files, emacs, The GNU Emacs 505@xref{File variables, , Local Variables in Files, emacs, The GNU Emacs
504Manual}, for the syntax of the local variables section of a file. 506Manual}, for the syntax of the local variables section of a file.
505 507
506@cindex file mode specification error 508@cindex file mode specification error
507 @code{normal-mode} uses @code{condition-case} around the call to the 509@code{normal-mode} uses @code{condition-case} around the call to the
508major mode function, so errors are caught and reported as a @samp{File 510major mode function, so errors are caught and reported as a @samp{File
509mode specification error}, followed by the original error message. 511mode specification error}, followed by the original error message.
510@end deffn 512@end deffn
@@ -516,6 +518,15 @@ lists unconditionally; @code{nil} means ignore them; anything else means
516ask the user what to do for each file. The default value is @code{t}. 518ask the user what to do for each file. The default value is @code{t}.
517@end defopt 519@end defopt
518 520
521@defvar ignored-local-variables
522This variable holds a list of variables that should not be
523set by a local variables list. Any value specified
524for one of these variables is ignored.
525@end defvar
526
527In addition to this list, any variable whose name has a non-@code{nil}
528@code{risky-local-variable} property is also ignored.
529
519@defopt enable-local-eval 530@defopt enable-local-eval
520This variable controls processing of @samp{Eval:} in local variables 531This variable controls processing of @samp{Eval:} in local variables
521lists in files being visited. A value of @code{t} means process them 532lists in files being visited. A value of @code{t} means process them
@@ -553,8 +564,8 @@ This function sets the major mode of @var{buffer} to the value of
553the current buffer's major mode (if that is suitable). 564the current buffer's major mode (if that is suitable).
554 565
555The low-level primitives for creating buffers do not use this function, 566The low-level primitives for creating buffers do not use this function,
556but medium-level commands such as @code{switch-to-buffer} should use it 567but medium-level commands such as @code{switch-to-buffer} and
557whenever they create buffers. 568@code{find-file-noselect} use it whenever they create buffers.
558@end defun 569@end defun
559 570
560@defvar initial-major-mode 571@defvar initial-major-mode
@@ -757,7 +768,7 @@ minor modes in effect.
757 768
758 Often the biggest problem in implementing a minor mode is finding a 769 Often the biggest problem in implementing a minor mode is finding a
759way to insert the necessary hook into the rest of Emacs. Minor mode 770way to insert the necessary hook into the rest of Emacs. Minor mode
760keymaps make this easier in Emacs 19 than it used to be. 771keymaps make this easier than it used to be.
761 772
762@menu 773@menu
763* Minor Mode Conventions:: Tips for writing a minor mode. 774* Minor Mode Conventions:: Tips for writing a minor mode.
@@ -805,15 +816,15 @@ a positive integer, a symbol other than @code{nil} or @code{-}, or a
805list whose @sc{car} is such an integer or symbol; it should turn the 816list whose @sc{car} is such an integer or symbol; it should turn the
806mode off otherwise. 817mode off otherwise.
807 818
808Here is an example taken from the definition of @code{overwrite-mode}. 819Here is an example taken from the definition of @code{transient-mark-mode}.
809It shows the use of @code{overwrite-mode} as a variable that enables or 820It shows the use of @code{transient-mark-mode} as a variable that enables or
810disables the mode's behavior, and also shows the proper way to toggle, 821disables the mode's behavior, and also shows the proper way to toggle,
811enable or disable the minor mode based on the raw prefix argument value. 822enable or disable the minor mode based on the raw prefix argument value.
812 823
813@smallexample 824@smallexample
814@group 825@group
815(setq overwrite-mode 826(setq transient-mark-mode
816 (if (null arg) (not overwrite-mode) 827 (if (null arg) (not transient-mark-mode)
817 (> (prefix-numeric-value arg) 0))) 828 (> (prefix-numeric-value arg) 0)))
818@end group 829@end group
819@end smallexample 830@end smallexample
@@ -847,10 +858,9 @@ check for an existing element, to avoid duplication. For example:
847@node Keymaps and Minor Modes 858@node Keymaps and Minor Modes
848@subsection Keymaps and Minor Modes 859@subsection Keymaps and Minor Modes
849 860
850As of Emacs version 19, each minor mode can have its own keymap, which is 861 Each minor mode can have its own keymap, which is active when the mode
851active when the mode is enabled. @xref{Active Keymaps}. To set up a 862is enabled. To set up a keymap for a minor mode, add an element to the
852keymap for a minor mode, add an element to the alist 863alist @code{minor-mode-map-alist}. @xref{Active Keymaps}.
853@code{minor-mode-map-alist}.
854 864
855@cindex @code{self-insert-command}, minor modes 865@cindex @code{self-insert-command}, minor modes
856One use of minor mode keymaps is to modify the behavior of certain 866One use of minor mode keymaps is to modify the behavior of certain
@@ -861,34 +871,6 @@ special cases (designed for abbrevs and Auto Fill mode). (Do not try
861substituting your own definition of @code{self-insert-command} for the 871substituting your own definition of @code{self-insert-command} for the
862standard one. The editor command loop handles this function specially.) 872standard one. The editor command loop handles this function specially.)
863 873
864@defvar minor-mode-map-alist
865This variable is an alist of elements that look like this:
866
867@example
868(@var{variable} . @var{keymap})
869@end example
870
871@noindent
872where @var{variable} is the variable that indicates whether the minor
873mode is enabled, and @var{keymap} is the keymap. The keymap
874@var{keymap} is active whenever @var{variable} has a non-@code{nil}
875value.
876
877Note that elements of @code{minor-mode-map-alist} do not have the same
878structure as elements of @code{minor-mode-alist}. The map must be the
879@sc{cdr} of the element; a list with the map as the second element will
880not do.
881
882What's more, the keymap itself must appear in the @sc{cdr}. It does not
883work to store a variable in the @sc{cdr} and make the map the value of
884that variable.
885
886When more than one minor mode keymap is active, their order of priority
887is the order of @code{minor-mode-map-alist}. But you should design
888minor modes so that they don't interfere with each other. If you do
889this properly, the order will not matter.
890@end defvar
891
892@node Mode Line Format 874@node Mode Line Format
893@section Mode Line Format 875@section Mode Line Format
894@cindex mode line 876@cindex mode line
@@ -906,8 +888,8 @@ minor modes.
906 888
907 @code{mode-line-format} is a buffer-local variable that holds a 889 @code{mode-line-format} is a buffer-local variable that holds a
908template used to display the mode line of the current buffer. All 890template used to display the mode line of the current buffer. All
909windows for the same buffer use the same @code{mode-line-format} and the 891windows for the same buffer use the same @code{mode-line-format} and
910mode lines will appear the same (except for scrolling percentages and 892their mode lines appear the same (except for scrolling percentages and
911line numbers). 893line numbers).
912 894
913 The mode line of a window is normally updated whenever a different 895 The mode line of a window is normally updated whenever a different
@@ -940,7 +922,7 @@ strings, symbols, and numbers kept in the buffer-local variable
940@code{mode-line-format}. The data structure is called a @dfn{mode line 922@code{mode-line-format}. The data structure is called a @dfn{mode line
941construct}, and it is built in recursive fashion out of simpler mode line 923construct}, and it is built in recursive fashion out of simpler mode line
942constructs. The same data structure is used for constructing 924constructs. The same data structure is used for constructing
943frame titles (pxref{Frame Titles}). 925frame titles (@pxref{Frame Titles}).
944 926
945@defvar mode-line-format 927@defvar mode-line-format
946The value of this variable is a mode line construct with overall 928The value of this variable is a mode line construct with overall
@@ -967,7 +949,7 @@ value is a list, each element may be a list, a symbol, or a string.
967@cindex percent symbol in mode line 949@cindex percent symbol in mode line
968@item @var{string} 950@item @var{string}
969A string as a mode line construct is displayed verbatim in the mode line 951A string as a mode line construct is displayed verbatim in the mode line
970except for @dfn{@code{%}-constructs}. Decimal digits after the @code{%} 952except for @dfn{@code{%}-constructs}. Decimal digits after the @samp{%}
971specify the field width for space filling on the right (i.e., the data 953specify the field width for space filling on the right (i.e., the data
972is left justified). @xref{%-Constructs}. 954is left justified). @xref{%-Constructs}.
973 955
@@ -1010,8 +992,8 @@ the top of the window is to use a list like this: @code{(-3 "%p")}.
1010use the same variables that appear in the default value (@pxref{Mode 992use the same variables that appear in the default value (@pxref{Mode
1011Line Variables}), rather than duplicating their contents or displaying 993Line Variables}), rather than duplicating their contents or displaying
1012the information in another fashion. This way, customizations made by 994the information in another fashion. This way, customizations made by
1013the user, by libraries (such as @code{display-time}) and by major modes 995the user or by Lisp programs (such as @code{display-time} and major
1014via changes to those variables remain effective. 996modes) via changes to those variables remain effective.
1015 997
1016@cindex Shell mode @code{mode-line-format} 998@cindex Shell mode @code{mode-line-format}
1017 Here is an example of a @code{mode-line-format} that might be 999 Here is an example of a @code{mode-line-format} that might be
@@ -1037,7 +1019,7 @@ directory.
1037 "%n" 1019 "%n"
1038 ")%]----" 1020 ")%]----"
1039@group 1021@group
1040 (line-number-mode "L%l--") 1022 '(line-number-mode "L%l--")
1041 '(-3 . "%p") 1023 '(-3 . "%p")
1042 "-%-")) 1024 "-%-"))
1043@end group 1025@end group
@@ -1056,19 +1038,22 @@ other variables could have the same effects on the mode line if
1056This variable holds the value of the mode-line construct that displays 1038This variable holds the value of the mode-line construct that displays
1057whether the current buffer is modified. 1039whether the current buffer is modified.
1058 1040
1059The default value of @code{mode-line-modified} is 1041The default value of @code{mode-line-modified} is @code{("--%1*%1+-")}.
1060@code{("--%1*%1*-")}. This means that the mode line displays 1042This means that the mode line displays @samp{--**-} if the buffer is
1061@samp{--**-} if the buffer is modified, @samp{-----} if the buffer is 1043modified, @samp{-----} if the buffer is not modified, @samp{--%%-} if
1062not modified, and @samp{--%%-} if the buffer is read only. 1044the buffer is read only, and @samp{--%*--} if the buffer is read only
1045and modified.
1063 1046
1064Changing this variable does not force an update of the mode line. 1047Changing this variable does not force an update of the mode line.
1065@end defvar 1048@end defvar
1066 1049
1067@defvar mode-line-buffer-identification 1050@defvar mode-line-buffer-identification
1068This variable identifies the buffer being displayed in the window. Its 1051This variable identifies the buffer being displayed in the window. Its
1069default value is @code{("Emacs: %17b")}, which means that it displays 1052default value is @code{("%F: %17b")}, which means that it usually
1070@samp{Emacs:} followed by seventeen characters of the buffer name. You 1053displays @samp{Emacs:} followed by seventeen characters of the buffer
1071may want to change this in modes such as Rmail that do not behave like a 1054name. (In a terminal frame, it displays the frame name instead of
1055@samp{Emacs}; this has the effect of showing the frame number.) You may
1056want to change this in modes such as Rmail that do not behave like a
1072``normal'' Emacs. 1057``normal'' Emacs.
1073@end defvar 1058@end defvar
1074 1059
@@ -1111,18 +1096,16 @@ The default value of @code{minor-mode-alist} is:
1111@example 1096@example
1112@group 1097@group
1113minor-mode-alist 1098minor-mode-alist
1114@result{} ((abbrev-mode " Abbrev") 1099@result{} ((vc-mode vc-mode)
1115 (overwrite-mode " Ovwrt") 1100 (abbrev-mode " Abbrev")
1101 (overwrite-mode overwrite-mode)
1116 (auto-fill-function " Fill") 1102 (auto-fill-function " Fill")
1117 (defining-kbd-macro " Def")) 1103 (defining-kbd-macro " Def")
1104 (isearch-mode isearch-mode))
1118@end group 1105@end group
1119@end example 1106@end example
1120 1107
1121@noindent 1108@code{minor-mode-alist} is not buffer-local. The variables mentioned
1122(In earlier Emacs versions, @code{auto-fill-function} was called
1123@code{auto-fill-hook}.)
1124
1125 @code{minor-mode-alist} is not buffer-local. The variables mentioned
1126in the alist should be buffer-local if the minor mode can be enabled 1109in the alist should be buffer-local if the minor mode can be enabled
1127separately in each buffer. 1110separately in each buffer.
1128@end defvar 1111@end defvar
@@ -1155,10 +1138,11 @@ The default value of @code{default-mode-line-format} is:
1155 mode-name 1138 mode-name
1156@end group 1139@end group
1157@group 1140@group
1141 mode-line-process
1158 minor-mode-alist 1142 minor-mode-alist
1159 "%n" 1143 "%n"
1160 mode-line-process
1161 ")%]----" 1144 ")%]----"
1145 (line-number-mode "L%l--")
1162 (-3 . "%p") 1146 (-3 . "%p")
1163 "-%-") 1147 "-%-")
1164@end group 1148@end group
@@ -1293,15 +1277,15 @@ the functions are called with arguments, or their values are meaningful.
1293The name shows you that the hook is abnormal and that you should look at 1277The name shows you that the hook is abnormal and that you should look at
1294its documentation string to see how to use it properly. 1278its documentation string to see how to use it properly.
1295 1279
1296 Most major modes run hooks as the last step of initialization. This 1280 Major mode functions are supposed to run a hook called the @dfn{mode
1297makes it easy for a user to customize the behavior of the mode, by 1281hook} as the last step of initialization. This makes it easy for a user
1298overriding the local variable assignments already made by the mode. But 1282to customize the behavior of the mode, by overriding the local variable
1299hooks are used in other contexts too. For example, the hook 1283assignments already made by the mode. But hooks are used in other
1300@code{suspend-hook} runs just before Emacs suspends itself 1284contexts too. For example, the hook @code{suspend-hook} runs just
1301(@pxref{Suspending Emacs}). 1285before Emacs suspends itself (@pxref{Suspending Emacs}).
1302 1286
1303 Here's an expression you can put in your @file{.emacs} file to turn on 1287 Here's an expression that uses a mode hook to turn on Auto Fill mode
1304Auto Fill mode when in Lisp Interaction mode: 1288when in Lisp Interaction mode:
1305 1289
1306@example 1290@example
1307(add-hook 'lisp-interaction-mode-hook 'turn-on-auto-fill) 1291(add-hook 'lisp-interaction-mode-hook 'turn-on-auto-fill)
@@ -1330,39 +1314,9 @@ expression.
1330@end group 1314@end group
1331@end example 1315@end example
1332 1316
1333 Finally, here is an example of how to use the Text mode hook to
1334provide a customized mode line for buffers in Text mode, displaying the
1335default directory in addition to the standard components of the
1336mode line. (This may cause the mode line to run out of space if you
1337have very long file names or display the time and load.)
1338
1339@example
1340@group
1341(add-hook 'text-mode-hook
1342 (function (lambda ()
1343 (setq mode-line-format
1344@end group
1345 '(mode-line-modified
1346 "Emacs: %14b"
1347 " "
1348 default-directory
1349 " "
1350 global-mode-string
1351 "%[("
1352 mode-name
1353 minor-mode-alist
1354@group
1355 "%n"
1356 mode-line-process
1357 ") %]---"
1358 (-3 . "%p")
1359 "-%-")))))
1360@end group
1361@end example
1362
1363 At the appropriate time, Emacs uses the @code{run-hooks} function to 1317 At the appropriate time, Emacs uses the @code{run-hooks} function to
1364run particular hooks. This function calls the hook functions you have 1318run particular hooks. This function calls the hook functions that have
1365added with @code{add-hooks}. 1319been added with @code{add-hook}.
1366 1320
1367@defun run-hooks &rest hookvar 1321@defun run-hooks &rest hookvar
1368This function takes one or more hook variable names as arguments, and 1322This function takes one or more hook variable names as arguments, and
@@ -1376,7 +1330,7 @@ lambda expression or a symbol with a function definition), it is
1376called. If it is a list, the elements are called, in order. 1330called. If it is a list, the elements are called, in order.
1377The hook functions are called with no arguments. 1331The hook functions are called with no arguments.
1378 1332
1379For example, here's how @code{emacs-lisp-hooks} runs its mode hook: 1333For example, here's how @code{emacs-lisp-mode} runs its mode hook:
1380 1334
1381@example 1335@example
1382(run-hooks 'emacs-lisp-mode-hook) 1336(run-hooks 'emacs-lisp-mode-hook)
diff --git a/lispref/numbers.texi b/lispref/numbers.texi
index 0c331545e1d..e7db42f727b 100644
--- a/lispref/numbers.texi
+++ b/lispref/numbers.texi
@@ -249,9 +249,10 @@ Here's a function to do this:
249@example 249@example
250(defvar fuzz-factor 1.0e-6) 250(defvar fuzz-factor 1.0e-6)
251(defun approx-equal (x y) 251(defun approx-equal (x y)
252 (< (/ (abs (- x y)) 252 (or (and (= x 0) (= y 0))
253 (max (abs x) (abs y))) 253 (< (/ (abs (- x y))
254 fuzz-factor)) 254 (max (abs x) (abs y)))
255 fuzz-factor)))
255@end example 256@end example
256 257
257@cindex CL note---integers vrs @code{eq} 258@cindex CL note---integers vrs @code{eq}
@@ -356,7 +357,9 @@ This returns @var{number}, converted to an integer by rounding upward
356 357
357@defun round number 358@defun round number
358This returns @var{number}, converted to an integer by rounding towards the 359This returns @var{number}, converted to an integer by rounding towards the
359nearest integer. 360nearest integer. Rounding a value equidistant between two integers
361may choose the integer closer to zero, or it may prefer an even integer,
362depending on your machine.
360@end defun 363@end defun
361 364
362@node Arithmetic Operations 365@node Arithmetic Operations
@@ -386,8 +389,8 @@ For example,
386 @result{} 5 389 @result{} 5
387@end example 390@end example
388 391
389This function is not analogous to the C operator @code{++}---it does 392This function is not analogous to the C operator @code{++}---it does not
390not increment a variable. It just computes a sum. Thus, 393increment a variable. It just computes a sum. Thus, if we continue,
391 394
392@example 395@example
393foo 396foo
@@ -413,7 +416,7 @@ This returns the absolute value of @var{number}.
413 416
414@defun + &rest numbers-or-markers 417@defun + &rest numbers-or-markers
415This function adds its arguments together. When given no arguments, 418This function adds its arguments together. When given no arguments,
416@code{+} returns 0. It does not check for overflow. 419@code{+} returns 0.
417 420
418@example 421@example
419(+) 422(+)
@@ -430,8 +433,7 @@ The @code{-} function serves two purposes: negation and subtraction.
430When @code{-} has a single argument, the value is the negative of the 433When @code{-} has a single argument, the value is the negative of the
431argument. When there are multiple arguments, @code{-} subtracts each of 434argument. When there are multiple arguments, @code{-} subtracts each of
432the @var{other-numbers-or-markers} from @var{number-or-marker}, 435the @var{other-numbers-or-markers} from @var{number-or-marker},
433cumulatively. If there are no arguments, the result is 0. This 436cumulatively. If there are no arguments, the result is 0.
434function does not check for overflow.
435 437
436@example 438@example
437(- 10 1 2 3 4) 439(- 10 1 2 3 4)
@@ -445,8 +447,7 @@ function does not check for overflow.
445 447
446@defun * &rest numbers-or-markers 448@defun * &rest numbers-or-markers
447This function multiplies its arguments together, and returns the 449This function multiplies its arguments together, and returns the
448product. When given no arguments, @code{*} returns 1. It does 450product. When given no arguments, @code{*} returns 1.
449not check for overflow.
450 451
451@example 452@example
452(*) 453(*)
@@ -562,8 +563,9 @@ For any two numbers @var{dividend} and @var{divisor},
562@end example 563@end example
563 564
564@noindent 565@noindent
565always equals @var{dividend}, subject to rounding error if 566always equals @var{dividend}, subject to rounding error if either
566either argument is floating point. 567argument is floating point. For @code{floor}, see @ref{Numeric
568Conversions}.
567@end defun 569@end defun
568 570
569@node Rounding Operations 571@node Rounding Operations
@@ -640,36 +642,7 @@ As the examples illustrate, shifting the pattern of bits one place to
640the left produces a number that is twice the value of the previous 642the left produces a number that is twice the value of the previous
641number. 643number.
642 644
643The function @code{lsh}, like all Emacs Lisp arithmetic functions, does 645Shifting a pattern of bits two places to the left produces results
644not check for overflow, so shifting left can discard significant bits
645and change the sign of the number. For example, left shifting
646134,217,727 produces @minus{}2 on a 28-bit machine:
647
648@example
649(lsh 134217727 1) ; @r{left shift}
650 @result{} -2
651@end example
652
653In binary, in the 28-bit implementation, the argument looks like this:
654
655@example
656@group
657;; @r{Decimal 134.217,727}
6580111 1111 1111 1111 1111 1111 1111
659@end group
660@end example
661
662@noindent
663which becomes the following when left shifted:
664
665@example
666@group
667;; @r{Decimal @minus{}2}
6681111 1111 1111 1111 1111 1111 1110
669@end group
670@end example
671
672Shifting the pattern of bits two places to the left produces results
673like this (with 8-bit binary numbers): 646like this (with 8-bit binary numbers):
674 647
675@example 648@example
@@ -681,8 +654,7 @@ like this (with 8-bit binary numbers):
681@end group 654@end group
682@end example 655@end example
683 656
684On the other hand, shifting the pattern of bits one place to the right 657On the other hand, shifting one place to the right looks like this:
685looks like this:
686 658
687@example 659@example
688@group 660@group
@@ -701,8 +673,37 @@ looks like this:
701@end example 673@end example
702 674
703@noindent 675@noindent
704As the example illustrates, shifting the pattern of bits one place to 676As the example illustrates, shifting one place to the right divides the
705the right divides the value of the binary number by two, rounding downward. 677value of a positive integer by two, rounding downward.
678
679The function @code{lsh}, like all Emacs Lisp arithmetic functions, does
680not check for overflow, so shifting left can discard significant bits
681and change the sign of the number. For example, left shifting
682134,217,727 produces @minus{}2 on a 28-bit machine:
683
684@example
685(lsh 134217727 1) ; @r{left shift}
686 @result{} -2
687@end example
688
689In binary, in the 28-bit implementation, the argument looks like this:
690
691@example
692@group
693;; @r{Decimal 134.217,727}
6940111 1111 1111 1111 1111 1111 1111
695@end group
696@end example
697
698@noindent
699which becomes the following when left shifted:
700
701@example
702@group
703;; @r{Decimal @minus{}2}
7041111 1111 1111 1111 1111 1111 1110
705@end group
706@end example
706@end defun 707@end defun
707 708
708@defun ash integer1 count 709@defun ash integer1 count
@@ -713,8 +714,8 @@ is negative.
713 714
714@code{ash} gives the same results as @code{lsh} except when 715@code{ash} gives the same results as @code{lsh} except when
715@var{integer1} and @var{count} are both negative. In that case, 716@var{integer1} and @var{count} are both negative. In that case,
716@code{ash} puts a one in the leftmost position, while @code{lsh} puts 717@code{ash} puts ones in the empty bit positions on the left, while
717a zero in the leftmost position. 718@code{lsh} puts zeros in those bit positions.
718 719
719Thus, with @code{ash}, shifting the pattern of bits one place to the right 720Thus, with @code{ash}, shifting the pattern of bits one place to the right
720looks like this: 721looks like this:
@@ -1008,18 +1009,8 @@ Emacs's process @sc{id} number.
1008This function returns a pseudo-random integer. Repeated calls return a 1009This function returns a pseudo-random integer. Repeated calls return a
1009series of pseudo-random integers. 1010series of pseudo-random integers.
1010 1011
1011If @var{limit} is @code{nil}, then the value may in principle be any
1012integer. However, on machines where integers have more than 32 bits,
1013the possible values may be limited to the interval
1014@tex
1015$[0,2^{32})$.
1016@end tex
1017@ifinfo
1018[0,2**32).
1019@end ifinfo
1020
1021If @var{limit} is a positive integer, the value is chosen to be 1012If @var{limit} is a positive integer, the value is chosen to be
1022nonnegative and less than @var{limit} (only in Emacs 19). 1013nonnegative and less than @var{limit}.
1023 1014
1024If @var{limit} is @code{t}, it means to choose a new seed based on the 1015If @var{limit} is @code{t}, it means to choose a new seed based on the
1025current time of day and on Emacs's process @sc{id} number. 1016current time of day and on Emacs's process @sc{id} number.
diff --git a/lispref/objects.texi b/lispref/objects.texi
index fc06466112c..4952f07514e 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -115,6 +115,11 @@ the end of line. The Lisp reader discards comments; they do not become
115part of the Lisp objects which represent the program within the Lisp 115part of the Lisp objects which represent the program within the Lisp
116system. 116system.
117 117
118 The @samp{#@@@var{count}} construct, which skips the next @var{count}
119characters, is useful for program-generated comments containing binary
120data. The Emacs Lisp byte compiler uses this in its output files
121(@pxref{Byte Compilation}). It isn't meant for source files, however.
122
118 @xref{Comment Tips}, for conventions for formatting comments. 123 @xref{Comment Tips}, for conventions for formatting comments.
119 124
120@node Programming Types 125@node Programming Types
@@ -305,17 +310,30 @@ equivalent to @samp{?\^I} and to @samp{?\^i}:
305characters that exist in @sc{ASCII}, but for keyboard input purposes, 310characters that exist in @sc{ASCII}, but for keyboard input purposes,
306you can turn any character into a control character with @samp{C-}. The 311you can turn any character into a control character with @samp{C-}. The
307character codes for these non-@sc{ASCII} control characters include the 312character codes for these non-@sc{ASCII} control characters include the
3082**22 bit as well as the code for the corresponding non-control 313@iftex
314$2^{26}$
315@end iftex
316@ifinfo
3172**26
318@end ifinfo
319bit as well as the code for the corresponding non-control
309character. Ordinary terminals have no way of generating non-@sc{ASCII} 320character. Ordinary terminals have no way of generating non-@sc{ASCII}
310control characters, but you can generate them straightforwardly using an 321control characters, but you can generate them straightforwardly using an
311X terminal. 322X terminal.
312 323
313 You can think of the @key{DEL} character as @kbd{Control-?}: 324 For historical reasons, Emacs treats the @key{DEL} character as
325the control equivalent of @kbd{?}:
314 326
315@example 327@example
316?\^? @result{} 127 ?\C-? @result{} 127 328?\^? @result{} 127 ?\C-? @result{} 127
317@end example 329@end example
318 330
331@noindent
332As a result, it is currently not possible to represent the character
333@kbd{Control-?}, which is a meaningful input character under X. It is
334not easy to change this as various Lisp files refer to @key{DEL} in this
335way.
336
319 For representing control characters to be found in files or strings, 337 For representing control characters to be found in files or strings,
320we recommend the @samp{^} syntax; for control characters in keyboard 338we recommend the @samp{^} syntax; for control characters in keyboard
321input, we prefer the @samp{C-} syntax. This does not affect the meaning 339input, we prefer the @samp{C-} syntax. This does not affect the meaning
@@ -324,11 +342,24 @@ of the program, but may guide the understanding of people who read it.
324@cindex meta characters 342@cindex meta characters
325 A @dfn{meta character} is a character typed with the @key{META} 343 A @dfn{meta character} is a character typed with the @key{META}
326modifier key. The integer that represents such a character has the 344modifier key. The integer that represents such a character has the
3272**23 bit set (which on most machines makes it a negative number). We 345@iftex
346$2^{27}$
347@end iftex
348@ifinfo
3492**27
350@end ifinfo
351bit set (which on most machines makes it a negative number). We
328use high bits for this and other modifiers to make possible a wide range 352use high bits for this and other modifiers to make possible a wide range
329of basic character codes. 353of basic character codes.
330 354
331 In a string, the 2**7 bit indicates a meta character, so the meta 355 In a string, the
356@iftex
357$2^{7}$
358@end iftex
359@ifinfo
3602**7
361@end ifinfo
362bit indicates a meta character, so the meta
332characters that can fit in a string have codes in the range from 128 to 363characters that can fit in a string have codes in the range from 128 to
333255, and are the meta versions of the ordinary @sc{ASCII} characters. 364255, and are the meta versions of the ordinary @sc{ASCII} characters.
334(In Emacs versions 18 and older, this convention was used for characters 365(In Emacs versions 18 and older, this convention was used for characters
@@ -343,11 +374,17 @@ or as @samp{?\M-\101}. Likewise, you can write @kbd{C-M-b} as
343 374
344 The case of an ordinary letter is indicated by its character code as 375 The case of an ordinary letter is indicated by its character code as
345part of @sc{ASCII}, but @sc{ASCII} has no way to represent whether a 376part of @sc{ASCII}, but @sc{ASCII} has no way to represent whether a
346control character is upper case or lower case. Emacs uses the 2**21 bit 377control character is upper case or lower case. Emacs uses the
347to indicate that the shift key was used for typing a control character. 378@iftex
348This distinction is possible only when you use X terminals or other 379$2^{25}$
349special terminals; ordinary terminals do not indicate the distinction to 380@end iftex
350the computer in any way. 381@ifinfo
3822**25
383@end ifinfo
384bit to indicate that the shift key was used for typing a control
385character. This distinction is possible only when you use X terminals
386or other special terminals; ordinary terminals do not indicate the
387distinction to the computer in any way.
351 388
352@cindex hyper characters 389@cindex hyper characters
353@cindex super characters 390@cindex super characters
@@ -355,8 +392,15 @@ the computer in any way.
355 The X Window System defines three other modifier bits that can be set 392 The X Window System defines three other modifier bits that can be set
356in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes 393in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes
357for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. Thus, 394for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. Thus,
358@samp{?\H-\M-\A-x} represents @kbd{Alt-Hyper-Meta-x}. Numerically, the 395@samp{?\H-\M-\A-x} represents @kbd{Alt-Hyper-Meta-x}.
359bit values are 2**18 for alt, 2**19 for super and 2**20 for hyper. 396@iftex
397Numerically, the
398bit values are $2^{22}$ for alt, $2^{23}$ for super and $2^{24}$ for hyper.
399@end iftex
400@ifinfo
401Numerically, the
402bit values are 2**22 for alt, 2**23 for super and 2**24 for hyper.
403@end ifinfo
360 404
361@cindex @samp{?} in character constant 405@cindex @samp{?} in character constant
362@cindex question mark in character constant 406@cindex question mark in character constant
@@ -423,14 +467,13 @@ do such a thing.
423@cindex CL note---case of letters 467@cindex CL note---case of letters
424@quotation 468@quotation
425@b{Common Lisp note:} In Common Lisp, lower case letters are always 469@b{Common Lisp note:} In Common Lisp, lower case letters are always
426``folded'' to upper case, unless they are explicitly escaped. This is 470``folded'' to upper case, unless they are explicitly escaped. In Emacs
427in contrast to Emacs Lisp, in which upper case and lower case letters 471Lisp, upper case and lower case letters are distinct.
428are distinct.
429@end quotation 472@end quotation
430 473
431 Here are several examples of symbol names. Note that the @samp{+} in 474 Here are several examples of symbol names. Note that the @samp{+} in
432the fifth example is escaped to prevent it from being read as a number. 475the fifth example is escaped to prevent it from being read as a number.
433This is not necessary in the last example because the rest of the name 476This is not necessary in the sixth example because the rest of the name
434makes it invalid as a number. 477makes it invalid as a number.
435 478
436@example 479@example
@@ -762,7 +805,14 @@ string containing just a single double-quote character.
762characters.) 805characters.)
763 806
764 If you use the @samp{\M-} syntax to indicate a meta character in a 807 If you use the @samp{\M-} syntax to indicate a meta character in a
765string constant, this sets the 2**7 bit of the character in the string. 808string constant, this sets the
809@iftex
810$2^{7}$
811@end iftex
812@ifinfo
8132**7
814@end ifinfo
815bit of the character in the string.
766This is not the same representation that the meta modifier has in a 816This is not the same representation that the meta modifier has in a
767character on its own (not inside a string). @xref{Character Type}. 817character on its own (not inside a string). @xref{Character Type}.
768 818
@@ -917,8 +967,9 @@ the evaluator handles this data type specially when it appears as a
917function to be called. @xref{Byte Compilation}, for information about 967function to be called. @xref{Byte Compilation}, for information about
918the byte compiler. 968the byte compiler.
919 969
920The printed representation for a byte-code function object is like that 970The printed representation and read syntax for a byte-code function
921for a vector, with an additional @samp{#} before the opening @samp{[}. 971object is like that for a vector, with an additional @samp{#} before the
972opening @samp{[}.
922 973
923@node Autoload Type 974@node Autoload Type
924@subsection Autoload Type 975@subsection Autoload Type
@@ -998,6 +1049,12 @@ a local keymap (@pxref{Keymaps}); and,
998 1049
999@item 1050@item
1000a local variable binding list (@pxref{Buffer-Local Variables}). 1051a local variable binding list (@pxref{Buffer-Local Variables}).
1052
1053@item
1054a list of overlays (@pxref{Overlays}).
1055
1056@item
1057text properties for the text in the buffer (@pxref{Text Properties}).
1001@end itemize 1058@end itemize
1002 1059
1003@noindent 1060@noindent
@@ -1006,7 +1063,10 @@ override global bindings or values. These are used to customize the
1006behavior of programs in different buffers, without actually changing the 1063behavior of programs in different buffers, without actually changing the
1007programs. 1064programs.
1008 1065
1009 Buffers have no read syntax. They print in hash notation with the 1066 A buffer may be @dfn{indirect}, which means it shares the text
1067of another buffer. @xref{Indirect Buffers}.
1068
1069 Buffers have no read syntax. They print in hash notation, showing the
1010buffer name. 1070buffer name.
1011 1071
1012@example 1072@example
@@ -1187,7 +1247,7 @@ and modify syntax tables.
1187 1247
1188 A @dfn{display table} specifies how to display each character code. 1248 A @dfn{display table} specifies how to display each character code.
1189Each buffer and each window can have its own display table. A display 1249Each buffer and each window can have its own display table. A display
1190table is actually a vector of length 261. @xref{Display Tables}. 1250table is actually a vector of length 262. @xref{Display Tables}.
1191 1251
1192@node Overlay Type 1252@node Overlay Type
1193@subsection Overlay Type 1253@subsection Overlay Type
@@ -1196,12 +1256,12 @@ table is actually a vector of length 261. @xref{Display Tables}.
1196appearance of a part of a buffer. It contains markers delimiting a 1256appearance of a part of a buffer. It contains markers delimiting a
1197range of the buffer, plus a property list (a list whose elements are 1257range of the buffer, plus a property list (a list whose elements are
1198alternating property names and values). Overlays are used to present 1258alternating property names and values). Overlays are used to present
1199parts of the buffer temporarily in a different display style. 1259parts of the buffer temporarily in a different display style. They have
1200 1260no read syntax, and print in hash notation, giving the buffer name and
1201 @xref{Overlays}, for how to create and use overlays. They have no
1202read syntax, and print in hash notation, giving the buffer name and
1203range of positions. 1261range of positions.
1204 1262
1263 @xref{Overlays}, for how to create and use overlays.
1264
1205@node Type Predicates 1265@node Type Predicates
1206@section Type Predicates 1266@section Type Predicates
1207@cindex predicates 1267@cindex predicates
@@ -1521,6 +1581,9 @@ use @code{string=} (@pxref{Text Comparison}).
1521 @result{} nil 1581 @result{} nil
1522@end group 1582@end group
1523@end example 1583@end example
1584
1585Two distinct buffers are never @code{equal}, even if their contents
1586are the same.
1524@end defun 1587@end defun
1525 1588
1526 The test for equality is implemented recursively, and circular lists may 1589 The test for equality is implemented recursively, and circular lists may
diff --git a/lispref/os.texi b/lispref/os.texi
index e39c6ca752c..a21107bf4fe 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -60,6 +60,10 @@ using a window system. This library's name is
60@file{term/@var{windowsystem}-win.el}. 60@file{term/@var{windowsystem}-win.el}.
61 61
62@item 62@item
63It processes the initial options. (Some of them are handled
64even earlier than this.)
65
66@item
63It initializes the X window frame and faces, if appropriate. 67It initializes the X window frame and faces, if appropriate.
64 68
65@item 69@item
@@ -101,7 +105,7 @@ It displays the initial echo area message, unless you have suppressed
101that with @code{inhibit-startup-echo-area-message}. 105that with @code{inhibit-startup-echo-area-message}.
102 106
103@item 107@item
104It processes any remaining command line arguments. 108It processes the action arguments from the command line.
105 109
106@item 110@item
107It runs @code{term-setup-hook}. 111It runs @code{term-setup-hook}.
@@ -179,6 +183,11 @@ Emacs does not subsequently load the @file{default.el} file.
179loads this @emph{before} the user's init file. You can inhibit the 183loads this @emph{before} the user's init file. You can inhibit the
180loading of this file with the option @samp{-no-site-file}. 184loading of this file with the option @samp{-no-site-file}.
181 185
186@defvar site-run-file
187This variable specifies the site-customization file to load
188before the user's init file. Its normal value is @code{"site-start"}.
189@end defvar
190
182 If there is a great deal of code in your @file{.emacs} file, you 191 If there is a great deal of code in your @file{.emacs} file, you
183should move it into another file named @file{@var{something}.el}, 192should move it into another file named @file{@var{something}.el},
184byte-compile it (@pxref{Byte Compilation}), and make your @file{.emacs} 193byte-compile it (@pxref{Byte Compilation}), and make your @file{.emacs}
@@ -543,9 +552,8 @@ through various functions. These variables include the name of the
543system, the user's @sc{uid}, and so on. 552system, the user's @sc{uid}, and so on.
544 553
545@defvar system-type 554@defvar system-type
546The value of this variable is a symbol indicating the type of 555The value of this variable is a symbol indicating the type of operating
547operating system Emacs is operating on. Here is a table of the symbols 556system Emacs is operating on. Here is a table of the possible values:
548for the operating systems that Emacs can run on up to version 19.1.
549 557
550@table @code 558@table @code
551@item aix-v3 559@item aix-v3
@@ -554,14 +562,26 @@ AIX.
554@item berkeley-unix 562@item berkeley-unix
555Berkeley BSD. 563Berkeley BSD.
556 564
565@item dgux
566Data General DGUX operating system.
567
568@item gnu
569A GNU system using the GNU HURD and Mach.
570
557@item hpux 571@item hpux
558Hewlett-Packard operating system. 572Hewlett-Packard HPUX operating system.
559 573
560@item irix 574@item irix
561Silicon Graphics Irix system. 575Silicon Graphics Irix system.
562 576
563@item linux 577@item linux
564The free Linux operating system. 578A GNU system using the Linux kernel.
579
580@item ms-dos
581Microsoft MS-DOS ``operating system.''
582
583@item next-mach
584NeXT Mach-based system.
565 585
566@item rtu 586@item rtu
567Masscomp RTU, UCB universe. 587Masscomp RTU, UCB universe.
@@ -575,6 +595,9 @@ AT&T System V.
575@item vax-vms 595@item vax-vms
576VAX VMS. 596VAX VMS.
577 597
598@item windows-nt
599Microsoft windows NT.
600
578@item xenix 601@item xenix
579SCO Xenix 386. 602SCO Xenix 386.
580@end table 603@end table
@@ -650,13 +673,6 @@ function works by modifying @code{process-environment}; binding that
650variable with @code{let} is also reasonable practice. 673variable with @code{let} is also reasonable practice.
651@end deffn 674@end deffn
652 675
653@defvar path-separator
654This variable holds a string which says which character separates
655directories in a search path (as found in an environment variable). Its
656value is @code{":"} for Unix and GNU systems, and @code{";"} for MS-DOS
657and Windows NT.
658@end defvar
659
660@defvar process-environment 676@defvar process-environment
661This variable is a list of strings, each describing one environment 677This variable is a list of strings, each describing one environment
662variable. The functions @code{getenv} and @code{setenv} work by means 678variable. The functions @code{getenv} and @code{setenv} work by means
@@ -677,6 +693,13 @@ process-environment
677@end smallexample 693@end smallexample
678@end defvar 694@end defvar
679 695
696@defvar path-separator
697This variable holds a string which says which character separates
698directories in a search path (as found in an environment variable). Its
699value is @code{":"} for Unix and GNU systems, and @code{";"} for MS-DOS
700and Windows NT.
701@end defvar
702
680@defvar invocation-name 703@defvar invocation-name
681This variable holds the program name under which Emacs was invoked. The 704This variable holds the program name under which Emacs was invoked. The
682value is a string, and does not include a directory name. 705value is a string, and does not include a directory name.
@@ -785,18 +808,6 @@ you to ``fake out'' Emacs by telling the functions what to return. The
785variables are also useful for constructing frame titles (@pxref{Frame 808variables are also useful for constructing frame titles (@pxref{Frame
786Titles}). 809Titles}).
787 810
788@defvar user-real-login-name
789This variable holds the same value that the function
790@code{user-real-login-name} returns. The variable lets you alter the value;
791also, you can use variables for constructing frame titles.
792@end defvar
793
794@defvar user-full-name
795This variable holds the same value that the function
796@code{user-full-name} returns. The variable lets you alter the value;
797also, you can use variables for constructing frame titles.
798@end defvar
799
800@defun user-real-uid 811@defun user-real-uid
801This function returns the real @sc{uid} of the user. 812This function returns the real @sc{uid} of the user.
802 813
@@ -822,16 +833,16 @@ zone.
822This function returns the current time and date as a humanly-readable 833This function returns the current time and date as a humanly-readable
823string. The format of the string is unvarying; the number of characters 834string. The format of the string is unvarying; the number of characters
824used for each part is always the same, so you can reliably use 835used for each part is always the same, so you can reliably use
825@code{substring} to extract pieces of it. However, it would be wise to 836@code{substring} to extract pieces of it. It is wise to count the
826count the characters from the beginning of the string rather than from 837characters from the beginning of the string rather than from the end, as
827the end, as additional information may be added at the end. 838additional information may be added at the end.
828 839
829@c Emacs 19 feature 840@c Emacs 19 feature
830The argument @var{time-value}, if given, specifies a time to format 841The argument @var{time-value}, if given, specifies a time to format
831instead of the current time. The argument should be a cons cell 842instead of the current time. The argument should be a list whose first
832containing two integers, or a list whose first two elements are 843two elements are integers. Thus, you can use times obtained from
833integers. Thus, you can use times obtained from @code{current-time} 844@code{current-time} (see below) and from @code{file-attributes}
834(see below) and from @code{file-attributes} (@pxref{File Attributes}). 845(@pxref{File Attributes}).
835 846
836@example 847@example
837@group 848@group
@@ -912,8 +923,8 @@ This stands for the full name of the month.
912@item %c 923@item %c
913This is a synonym for @samp{%x %X}. 924This is a synonym for @samp{%x %X}.
914@item %C 925@item %C
915This has a locale-specific meaning. In the C locale, it is equivalent 926This has a locale-specific meaning. In the default locale (named C), it
916to @samp{%A, %B %e, %Y}. 927is equivalent to @samp{%A, %B %e, %Y}.
917@item %d 928@item %d
918This stands for the day of month, zero-padded. 929This stands for the day of month, zero-padded.
919@item %D 930@item %D
@@ -959,11 +970,11 @@ This stands for the numeric day of week (0-6). Sunday is day 0.
959This stands for the week of the year (01-52), assuming that weeks 970This stands for the week of the year (01-52), assuming that weeks
960start on Monday. 971start on Monday.
961@item %x 972@item %x
962This has a locale-specific meaning. In the C locale, it is equivalent 973This has a locale-specific meaning. In the default locale (named C), it
963to @samp{%D}. 974is equivalent to @samp{%D}.
964@item %X 975@item %X
965This has a locale-specific meaning. In the C locale, it is equivalent 976This has a locale-specific meaning. In the default locale (named C), it
966to @samp{%T}. 977is equivalent to @samp{%T}.
967@item %y 978@item %y
968This stands for the year without century (00-99). 979This stands for the year without century (00-99).
969@item %Y 980@item %Y
@@ -974,8 +985,8 @@ This stands for the time zone abbreviation.
974@end defun 985@end defun
975 986
976@defun decode-time time 987@defun decode-time time
977This function converts a time value into calendrical form. The return 988This function converts a time value into calendrical information. The
978value is a list of nine elements, as follows: 989return value is a list of nine elements, as follows:
979 990
980@example 991@example
981(@var{seconds} @var{minutes} @var{hour} @var{day} @var{month} @var{year} @var{dow} @var{dst} @var{zone}) 992(@var{seconds} @var{minutes} @var{hour} @var{day} @var{month} @var{year} @var{dow} @var{dst} @var{zone})
@@ -1002,7 +1013,8 @@ Sunday.
1002@item dst 1013@item dst
1003@code{t} if daylight savings time is effect, otherwise @code{nil}. 1014@code{t} if daylight savings time is effect, otherwise @code{nil}.
1004@item zone 1015@item zone
1005An integer indicating the number of seconds east of Greenwich. 1016An integer indicating the time zone, as the number of seconds east of
1017Greenwich.
1006@end table 1018@end table
1007 1019
1008Note that Common Lisp has different meanings for @var{dow} and 1020Note that Common Lisp has different meanings for @var{dow} and
@@ -1011,10 +1023,8 @@ Note that Common Lisp has different meanings for @var{dow} and
1011 1023
1012@defun encode-time seconds minutes hour day month year &optional zone 1024@defun encode-time seconds minutes hour day month year &optional zone
1013This function is the inverse of @code{decode-time}. It converts seven 1025This function is the inverse of @code{decode-time}. It converts seven
1014items of calendrical data into a time value. 1026items of calendrical data into a time value. For the meanings of the
1015 1027arguments, see the table above under @code{decode-time}.
1016For the meanings of the arguments, see the table above under
1017@code{decode-time}.
1018 1028
1019Year numbers less than 100 are treated just like other year numbers. If 1029Year numbers less than 100 are treated just like other year numbers. If
1020you them to stand for years above 1900, you must alter them yourself 1030you them to stand for years above 1900, you must alter them yourself
@@ -1028,7 +1038,7 @@ any further alteration for daylight savings time.
1028@end defun 1038@end defun
1029 1039
1030@node Timers 1040@node Timers
1031@section Timers 1041@section Timers for Delayed Execution
1032 1042
1033You can set up a timer to call a function at a specified future time. 1043You can set up a timer to call a function at a specified future time.
1034 1044
@@ -1100,7 +1110,9 @@ functions.
1100@defun set-input-mode interrupt flow meta quit-char 1110@defun set-input-mode interrupt flow meta quit-char
1101This function sets the mode for reading keyboard input. If 1111This function sets the mode for reading keyboard input. If
1102@var{interrupt} is non-null, then Emacs uses input interrupts. If it is 1112@var{interrupt} is non-null, then Emacs uses input interrupts. If it is
1103@code{nil}, then it uses @sc{cbreak} mode. 1113@code{nil}, then it uses @sc{cbreak} mode. When Emacs communicates
1114directly with X, it ignores this argument and uses interrupts if that is
1115the way it knows how to communicate.
1104 1116
1105If @var{flow} is non-@code{nil}, then Emacs uses @sc{xon/xoff} (@kbd{C-q}, 1117If @var{flow} is non-@code{nil}, then Emacs uses @sc{xon/xoff} (@kbd{C-q},
1106@kbd{C-s}) flow control for output to the terminal. This has no effect except 1118@kbd{C-s}) flow control for output to the terminal. This has no effect except
@@ -1142,7 +1154,7 @@ is non-@code{nil} if Emacs uses @sc{xon/xoff} (@kbd{C-q}, @kbd{C-s})
1142flow control for output to the terminal. This value has no effect 1154flow control for output to the terminal. This value has no effect
1143unless @var{interrupt} is non-@code{nil}. 1155unless @var{interrupt} is non-@code{nil}.
1144@item meta 1156@item meta
1145is non-@code{t} if Emacs treats the eighth bit of input characters as 1157is @code{t} if Emacs treats the eighth bit of input characters as
1146the meta bit; @code{nil} means Emacs clears the eighth bit of every 1158the meta bit; @code{nil} means Emacs clears the eighth bit of every
1147input character; any other value means Emacs uses all eight bits as the 1159input character; any other value means Emacs uses all eight bits as the
1148basic character code. 1160basic character code.
@@ -1151,14 +1163,6 @@ is the character Emacs currently uses for quitting, usually @kbd{C-g}.
1151@end table 1163@end table
1152@end defun 1164@end defun
1153 1165
1154@defvar meta-flag
1155This variable used to control whether to treat the eight bit in keyboard
1156input characters as the @key{Meta} bit. @code{nil} meant no, and
1157anything else meant yes. This variable existed in Emacs versions 18 and
1158earlier but no longer exists in Emacs 19; use @code{set-input-mode}
1159instead.
1160@end defvar
1161
1162@node Translating Input 1166@node Translating Input
1163@subsection Translating Input Events 1167@subsection Translating Input Events
1164@cindex translating input events 1168@cindex translating input events
@@ -1185,7 +1189,7 @@ The @key{META} key.
1185Each time the user types a keyboard key, it is altered as if the 1189Each time the user types a keyboard key, it is altered as if the
1186modifier keys specified in the bit mask were held down. 1190modifier keys specified in the bit mask were held down.
1187 1191
1188When you use X windows, the program can ``press'' any of the modifier 1192When using X windows, the program can ``press'' any of the modifier
1189keys in this way. Otherwise, only the @key{CTL} and @key{META} keys can 1193keys in this way. Otherwise, only the @key{CTL} and @key{META} keys can
1190be virtually pressed. 1194be virtually pressed.
1191@end defvar 1195@end defvar
@@ -1513,8 +1517,10 @@ for flow control is not an official standard. Interestingly, on the
1513model 33 teletype with a paper tape punch (which is very old), @kbd{C-s} 1517model 33 teletype with a paper tape punch (which is very old), @kbd{C-s}
1514and @kbd{C-q} were sent by the computer to turn the punch on and off! 1518and @kbd{C-q} were sent by the computer to turn the punch on and off!
1515 1519
1516 GNU Emacs version 19 provides a convenient way of enabling flow 1520 As X servers and other window systems replace character-only
1517control if you want it: call the function @code{enable-flow-control}. 1521terminals, this problem is gradually being cured. For the mean time,
1522Emacs provides a convenient way of enabling flow control if you want it:
1523call the function @code{enable-flow-control}.
1518 1524
1519@defun enable-flow-control 1525@defun enable-flow-control
1520This function enables use of @kbd{C-s} and @kbd{C-q} for output flow 1526This function enables use of @kbd{C-s} and @kbd{C-q} for output flow
@@ -1575,7 +1581,7 @@ calls @var{function} with no arguments.
1575 1581
1576 Any Lisp program output that would normally go to the echo area, 1582 Any Lisp program output that would normally go to the echo area,
1577either using @code{message} or using @code{prin1}, etc., with @code{t} 1583either using @code{message} or using @code{prin1}, etc., with @code{t}
1578as the stream, goes instead to Emacs's standard output descriptor when 1584as the stream, goes instead to Emacs's standard error descriptor when
1579in batch mode. Thus, Emacs behaves much like a noninteractive 1585in batch mode. Thus, Emacs behaves much like a noninteractive
1580application program. (The echo area output that Emacs itself normally 1586application program. (The echo area output that Emacs itself normally
1581generates, such as command echoing, is suppressed entirely.) 1587generates, such as command echoing, is suppressed entirely.)
diff --git a/lispref/positions.texi b/lispref/positions.texi
index 6691a63c827..1032c85453b 100644
--- a/lispref/positions.texi
+++ b/lispref/positions.texi
@@ -37,9 +37,9 @@ to allow editing and insertion at different places.
37 37
38 Like other positions, point designates a place between two characters 38 Like other positions, point designates a place between two characters
39(or before the first character, or after the last character), rather 39(or before the first character, or after the last character), rather
40than a particular character. Many terminals display the cursor over the 40than a particular character. Usually terminals display the cursor over
41character that immediately follows point; on such terminals, point is 41the character that immediately follows point; point is actually before
42actually before the character on which the cursor sits. 42the character on which the cursor sits.
43 43
44@cindex point with narrowing 44@cindex point with narrowing
45 The value of point is a number between 1 and the buffer size plus 1. 45 The value of point is a number between 1 and the buffer size plus 1.
@@ -119,8 +119,6 @@ or relative to the edges of the selected window. @xref{Point}.
119* Buffer End Motion:: Moving to the beginning or end of the buffer. 119* Buffer End Motion:: Moving to the beginning or end of the buffer.
120* Text Lines:: Moving in terms of lines of text. 120* Text Lines:: Moving in terms of lines of text.
121* Screen Lines:: Moving in terms of lines as displayed. 121* Screen Lines:: Moving in terms of lines as displayed.
122* Vertical Motion:: Implementation of @code{next-line} and
123 @code{previous-line}.
124* List Motion:: Moving by parsing lists and sexps. 122* List Motion:: Moving by parsing lists and sexps.
125* Skipping Characters:: Skipping characters belonging to a certain set. 123* Skipping Characters:: Skipping characters belonging to a certain set.
126@end menu 124@end menu
@@ -422,36 +420,6 @@ to use and more reliable (no dependence on goal column, etc.).
422@c ================ 420@c ================
423@end ignore 421@end ignore
424 422
425@defvar cache-long-line-scans
426This variable determines whether Emacs should use caches to handle long
427lines more quickly. This variable is buffer-local, in all buffers.
428
429 Normally, the line-motion functions work by scanning the buffer for
430newlines. Columnar operations (like @code{move-to-column} and
431@code{compute-motion}) also work by scanning the buffer, summing
432character widths as they go. This works well for ordinary text, but if
433the buffer's lines are very long (say, more than 500 characters), these
434motion functions will take longer to execute. Emacs may also take
435longer to update the display.
436
437 If @code{cache-long-line-scans} is non-@code{nil}, these motion
438functions cache the results of their scans, and consult the cache to
439avoid rescanning regions of the buffer until the text is modified. The
440caches are most beneficial when they prevent the most searching---that
441is, when the buffer contains long lines and large regions of characters
442with the same, fixed screen width.
443
444 When @code{cache-long-line-scans} is non-@code{nil}, processing short
445lines will become slightly slower (because of the overhead of consulting
446the cache), and the caches will use memory roughly proportional to the
447number of newlines and characters whose screen width varies.
448
449 The caches require no explicit maintenance; their accuracy is
450maintained internally by the Emacs primitives. Enabling or disabling
451the cache should not affect the behavior of any of the motion functions;
452it should only affect their performance.
453@end defvar
454
455 Also see the functions @code{bolp} and @code{eolp} in @ref{Near Point}. 423 Also see the functions @code{bolp} and @code{eolp} in @ref{Near Point}.
456These functions do not move point, but test whether it is already at the 424These functions do not move point, but test whether it is already at the
457beginning or end of a line. 425beginning or end of a line.
@@ -532,7 +500,8 @@ the form @code{(@var{hpos} . @var{vpos})}.
532 500
533The argument @var{width} is the number of columns available to display 501The argument @var{width} is the number of columns available to display
534text; this affects handling of continuation lines. Use the value 502text; this affects handling of continuation lines. Use the value
535returned by @code{window-width} for the window of your choice. 503returned by @code{window-width} for the window of your choice;
504normally, use @code{(window-width @var{window})}.
536 505
537The argument @var{offsets} is either @code{nil} or a cons cell of the 506The argument @var{offsets} is either @code{nil} or a cons cell of the
538form @code{(@var{hscroll} . @var{tab-offset})}. Here @var{hscroll} is 507form @code{(@var{hscroll} . @var{tab-offset})}. Here @var{hscroll} is
@@ -585,49 +554,6 @@ When you use @code{compute-motion} for the minibuffer, you need to use
585beginning of the first screen line. @xref{Minibuffer Misc}. 554beginning of the first screen line. @xref{Minibuffer Misc}.
586@end defun 555@end defun
587 556
588@node Vertical Motion
589@comment node-name, next, previous, up
590@subsection The User-Level Vertical Motion Commands
591@cindex goal column
592@cindex vertical text line motion
593@findex next-line
594@findex previous-line
595
596 A goal column is useful if you want to edit text such as a table in
597which you want to move point to a certain column on each line. The goal
598column affects the vertical text line motion commands, @code{next-line}
599and @code{previous-line}. @xref{Basic,, Basic Editing Commands, emacs,
600The GNU Emacs Manual}.
601
602@defopt goal-column
603This variable holds an explicitly specified goal column for vertical
604line motion commands. If it is an integer, it specifies a column, and
605these commands try to move to that column on each line. If it is
606@code{nil}, then the commands set their own goal columns. Any other
607value is invalid.
608@end defopt
609
610@defvar temporary-goal-column
611This variable holds the temporary goal column during a sequence of
612consecutive vertical line motion commands. It is overridden by
613@code{goal-column} if that is non-@code{nil}. It is set each time a
614vertical motion command is invoked, unless the previous command was also
615a vertical motion command.
616@end defvar
617
618@defopt track-eol
619This variable controls how the vertical line motion commands operate
620when starting at the end of a line. If @code{track-eol} is
621non-@code{nil}, then vertical motion starting at the end of a line will
622keep to the ends of lines (instead of keeping to a particular column).
623This means moving to the end of each line moved onto. The value of
624@code{track-eol} has no effect if point is not at the end of a line when
625the first vertical motion command is given.
626
627@code{track-eol} has its effect by telling line motion commands to set
628@code{temporary-goal-column} to 9999 instead of to the current column.
629@end defopt
630
631@node List Motion 557@node List Motion
632@comment node-name, next, previous, up 558@comment node-name, next, previous, up
633@subsection Moving over Balanced Expressions 559@subsection Moving over Balanced Expressions
diff --git a/lispref/processes.texi b/lispref/processes.texi
index a089ba0994d..a5d83c868cb 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -46,7 +46,7 @@ This function returns @code{t} if @var{object} is a process,
46* Output from Processes:: Collecting output from an asynchronous subprocess. 46* Output from Processes:: Collecting output from an asynchronous subprocess.
47* Sentinels:: Sentinels run when process run-status changes. 47* Sentinels:: Sentinels run when process run-status changes.
48* Transaction Queues:: Transaction-based communication with subprocesses. 48* Transaction Queues:: Transaction-based communication with subprocesses.
49* TCP:: Opening network connections. 49* Network:: Opening network connections.
50@end menu 50@end menu
51 51
52@node Subprocess Creation 52@node Subprocess Creation
@@ -313,7 +313,7 @@ inputinput@point{}
313a synchronous subprocess are text or binary. Text data requires 313a synchronous subprocess are text or binary. Text data requires
314translation between the end-of-line convention used within Emacs 314translation between the end-of-line convention used within Emacs
315(a single newline character) and the convention used outside Emacs 315(a single newline character) and the convention used outside Emacs
316(the two-character sequence, CRLF). 316(the two-character sequence, @sc{crlf}).
317 317
318 The variable @code{binary-process-input} applies to input sent to the 318 The variable @code{binary-process-input} applies to input sent to the
319subprocess, and @code{binary-process-output} applies to output received 319subprocess, and @code{binary-process-output} applies to output received
@@ -321,12 +321,12 @@ from it. A non-@code{nil} value means the data is non-text; @code{nil}
321means the data is text, and calls for conversion. 321means the data is text, and calls for conversion.
322 322
323@defvar binary-process-input 323@defvar binary-process-input
324If this variable is @code{nil}, convert newlines to CRLF sequences in 324If this variable is @code{nil}, convert newlines to @sc{crlf} sequences in
325the input to a synchronous subprocess. 325the input to a synchronous subprocess.
326@end defvar 326@end defvar
327 327
328@defvar binary-process-output 328@defvar binary-process-output
329If this variable is @code{nil}, convert CRLF sequences to newlines in 329If this variable is @code{nil}, convert @sc{crlf} sequences to newlines in
330the output from a synchronous subprocess. 330the output from a synchronous subprocess.
331@end defvar 331@end defvar
332 332
@@ -396,9 +396,8 @@ command.
396@cindex pipes 396@cindex pipes
397@cindex @sc{pty}s 397@cindex @sc{pty}s
398This variable controls the type of device used to communicate with 398This variable controls the type of device used to communicate with
399asynchronous subprocesses. If it is @code{nil}, then pipes are used. 399asynchronous subprocesses. If it is non-@code{nil}, then @sc{pty}s are
400If it is @code{t}, then @sc{pty}s are used (or pipes if @sc{pty}s are 400used, when available. Otherwise, pipes are used.
401not supported).
402 401
403@sc{pty}s are usually preferable for processes visible to the user, as 402@sc{pty}s are usually preferable for processes visible to the user, as
404in Shell mode, because they allow job control (@kbd{C-c}, @kbd{C-z}, 403in Shell mode, because they allow job control (@kbd{C-c}, @kbd{C-z},
@@ -945,7 +944,7 @@ Now Emacs does this automatically; filter functions never need to do it
945explicitly. @xref{Match Data}. 944explicitly. @xref{Match Data}.
946 945
947 A filter function that writes the output into the buffer of the 946 A filter function that writes the output into the buffer of the
948process should check whether the process is still alive. If it tries to 947process should check whether the buffer is still alive. If it tries to
949insert into a dead buffer, it will get an error. If the buffer is dead, 948insert into a dead buffer, it will get an error. If the buffer is dead,
950@code{(buffer-name (process-buffer @var{process}))} returns @code{nil}. 949@code{(buffer-name (process-buffer @var{process}))} returns @code{nil}.
951 950
@@ -1043,6 +1042,13 @@ thus specified are added together, and @code{accept-process-output}
1043returns after that much time whether or not there has been any 1042returns after that much time whether or not there has been any
1044subprocess output. 1043subprocess output.
1045 1044
1045The argument @var{seconds} need not be an integer. If it is a floating
1046point number, this function waits for a fractional number of seconds.
1047Some systems support only a whole number of seconds; on these systems,
1048@var{seconds} is rounded down. If the system doesn't support waiting
1049fractions of a second, you get an error if you specify nonzero
1050@var{millisec}.
1051
1046Not all operating systems support waiting periods other than multiples 1052Not all operating systems support waiting periods other than multiples
1047of a second; on those that do not, you get an error if you specify 1053of a second; on those that do not, you get an error if you specify
1048nonzero @var{millisec}. 1054nonzero @var{millisec}.
@@ -1095,15 +1101,10 @@ would be unpredictable. If you want to permit quitting inside a
1095sentinel, bind @code{inhibit-quit} to @code{nil}. @xref{Quitting}. 1101sentinel, bind @code{inhibit-quit} to @code{nil}. @xref{Quitting}.
1096 1102
1097 A sentinel that writes the output into the buffer of the process 1103 A sentinel that writes the output into the buffer of the process
1098should check whether the process is still alive. If it tries to insert 1104should check whether the buffer is still alive. If it tries to insert
1099into a dead buffer, it will get an error. If the buffer is dead, 1105into a dead buffer, it will get an error. If the buffer is dead,
1100@code{(buffer-name (process-buffer @var{process}))} returns @code{nil}. 1106@code{(buffer-name (process-buffer @var{process}))} returns @code{nil}.
1101 1107
1102 In earlier Emacs versions, every sentinel that did regexp searching or
1103matching had to explicitly save and restore the match data. Now Emacs
1104does this automatically; sentinels never need to do it explicitly.
1105@xref{Match Data}.
1106
1107 If an error happens during execution of a sentinel, it is caught 1108 If an error happens during execution of a sentinel, it is caught
1108automatically, so that it doesn't stop the execution of whatever 1109automatically, so that it doesn't stop the execution of whatever
1109programs was running when the sentinel was started. However, if 1110programs was running when the sentinel was started. However, if
@@ -1111,6 +1112,11 @@ programs was running when the sentinel was started. However, if
1111off. This makes it possible to use the Lisp debugger to debug the 1112off. This makes it possible to use the Lisp debugger to debug the
1112sentinel. @xref{Debugger}. 1113sentinel. @xref{Debugger}.
1113 1114
1115 In earlier Emacs versions, every sentinel that did regexp searching or
1116matching had to explicitly save and restore the match data. Now Emacs
1117does this automatically; sentinels never need to do it explicitly.
1118@xref{Match Data}.
1119
1114@defun set-process-sentinel process sentinel 1120@defun set-process-sentinel process sentinel
1115This function associates @var{sentinel} with @var{process}. If 1121This function associates @var{sentinel} with @var{process}. If
1116@var{sentinel} is @code{nil}, then the process will have no sentinel. 1122@var{sentinel} is @code{nil}, then the process will have no sentinel.
@@ -1186,12 +1192,13 @@ to complete, and then terminate the connection or child process.
1186Transaction queues are implemented by means of a filter function. 1192Transaction queues are implemented by means of a filter function.
1187@xref{Filter Functions}. 1193@xref{Filter Functions}.
1188 1194
1189@node TCP 1195@node Network
1190@section TCP 1196@section Network Connections
1197@cindex network connection
1191@cindex TCP 1198@cindex TCP
1192 1199
1193 Emacs Lisp programs can open TCP connections to other processes on the 1200 Emacs Lisp programs can open TCP network connections to other processes on
1194same machine or other machines. A network connection is handled by Lisp 1201the same machine or other machines. A network connection is handled by Lisp
1195much like a subprocess, and is represented by a process object. 1202much like a subprocess, and is represented by a process object.
1196However, the process you are communicating with is not a child of the 1203However, the process you are communicating with is not a child of the
1197Emacs process, so you can't kill it or send it signals. All you can do 1204Emacs process, so you can't kill it or send it signals. All you can do
@@ -1201,7 +1208,9 @@ what to do about closure of the connection.
1201 1208
1202 You can distinguish process objects representing network connections 1209 You can distinguish process objects representing network connections
1203from those representing subprocesses with the @code{process-status} 1210from those representing subprocesses with the @code{process-status}
1204function. @xref{Process Information}. 1211function. It always returns either @code{open} or @code{closed} for a
1212network connection, and it never returns either of those values for a
1213real subprocess. @xref{Process Information}.
1205 1214
1206@defun open-network-stream name buffer-or-name host service 1215@defun open-network-stream name buffer-or-name host service
1207This function opens a TCP connection for a service to a host. It 1216This function opens a TCP connection for a service to a host. It
diff --git a/lispref/searching.texi b/lispref/searching.texi
index 7919804d35c..29852a3624f 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -974,7 +974,8 @@ This function returns, as a string, the text matched in the last search
974or match operation. It returns the entire text if @var{count} is zero, 974or match operation. It returns the entire text if @var{count} is zero,
975or just the portion corresponding to the @var{count}th parenthetical 975or just the portion corresponding to the @var{count}th parenthetical
976subexpression, if @var{count} is positive. If @var{count} is out of 976subexpression, if @var{count} is positive. If @var{count} is out of
977range, the value is @code{nil}. 977range, or if that subexpression didn't match anything, the value is
978@code{nil}.
978 979
979If the last such operation was done against a string with 980If the last such operation was done against a string with
980@code{string-match}, then you should pass the same string as the 981@code{string-match}, then you should pass the same string as the
@@ -1083,10 +1084,14 @@ This function replaces the text in the buffer (or in @var{string}) that
1083was matched by the last search. It replaces that text with 1084was matched by the last search. It replaces that text with
1084@var{replacement}. 1085@var{replacement}.
1085 1086
1086If @var{string} is @code{nil}, @code{replace-match} does the replacement 1087If you did the last search in a buffer, you should specify @code{nil}
1087by editing the buffer; it leaves point at the end of the replacement 1088for @var{string}. Then @code{replace-match} does the replacement by
1088text, and returns @code{t}. If @var{string} is a string, it does the 1089editing the buffer; it leaves point at the end of the replacement text,
1089replacement by constructing and returning a new string. 1090and returns @code{t}.
1091
1092If you did the search in a string, pass the same string as @var{string}.
1093Then @code{replace-match} does the replacement by constructing and
1094returning a new string.
1090 1095
1091If @var{fixedcase} is non-@code{nil}, then the case of the replacement 1096If @var{fixedcase} is non-@code{nil}, then the case of the replacement
1092text is not changed; otherwise, the replacement text is converted to a 1097text is not changed; otherwise, the replacement text is converted to a
@@ -1207,10 +1212,10 @@ that shows the problem that arises if you fail to save the match data:
1207 1212
1208 You can save and restore the match data with @code{save-match-data}: 1213 You can save and restore the match data with @code{save-match-data}:
1209 1214
1210@defspec save-match-data body@dots{} 1215@defmac save-match-data body@dots{}
1211This special form executes @var{body}, saving and restoring the match 1216This special form executes @var{body}, saving and restoring the match
1212data around it. 1217data around it.
1213@end defspec 1218@end defmac
1214 1219
1215 You can use @code{set-match-data} together with @code{match-data} to 1220 You can use @code{set-match-data} together with @code{match-data} to
1216imitate the effect of the special form @code{save-match-data}. This is 1221imitate the effect of the special form @code{save-match-data}. This is
@@ -1318,9 +1323,10 @@ this matches a line that starts with a formfeed character.
1318match always starts at the beginning of a line; they should not use 1323match always starts at the beginning of a line; they should not use
1319@samp{^} to anchor the match. Most often, the paragraph commands do 1324@samp{^} to anchor the match. Most often, the paragraph commands do
1320check for a match only at the beginning of a line, which means that 1325check for a match only at the beginning of a line, which means that
1321@samp{^} would be superfluous. When there is a left margin, they accept 1326@samp{^} would be superfluous. When there is a nonzero left margin,
1322matches that start after the left margin. In that case, a @samp{^} 1327they accept matches that start after the left margin. In that case, a
1323would be incorrect. 1328@samp{^} would be incorrect. However, a @samp{^} is harmless in modes
1329where a left margin is never used.
1324 1330
1325@defvar paragraph-separate 1331@defvar paragraph-separate
1326This is the regular expression for recognizing the beginning of a line 1332This is the regular expression for recognizing the beginning of a line
diff --git a/lispref/sequences.texi b/lispref/sequences.texi
index 0982b19c743..c6de3f1c94d 100644
--- a/lispref/sequences.texi
+++ b/lispref/sequences.texi
@@ -15,8 +15,8 @@ collection of elements.
15 15
16 An @dfn{array} is a single primitive object that has a slot for each 16 An @dfn{array} is a single primitive object that has a slot for each
17elements. All the elements are accessible in constant time, but the 17elements. All the elements are accessible in constant time, but the
18length of an existing array cannot be changed. Both strings and vectors 18length of an existing array cannot be changed. Strings and vectors are
19are arrays. 19the two types of arrays.
20 20
21 A list is a sequence of elements, but it is not a single primitive 21 A list is a sequence of elements, but it is not a single primitive
22object; it is made of cons cells, one cell per element. Finding the 22object; it is made of cons cells, one cell per element. Finding the
@@ -36,7 +36,7 @@ But it is possible to add elements to the list, or remove elements.
36 | | List | | Array | | 36 | | List | | Array | |
37 | | | | ________ _______ | | 37 | | | | ________ _______ | |
38 | |______| | | | | | | | 38 | |______| | | | | | | |
39 | | | String | | Vector| | | 39 | | | Vector | | String| | |
40 | | |________| |_______| | | 40 | | |________| |_______| | |
41 | |______________________| | 41 | |______________________| |
42 |___________________________________| 42 |___________________________________|
@@ -191,9 +191,8 @@ otherwise, they trigger an @code{args-out-of-range} error.
191@end group 191@end group
192@end example 192@end example
193 193
194This function duplicates @code{aref} (@pxref{Array Functions}) and 194This function generalizes @code{aref} (@pxref{Array Functions}) and
195@code{nth} (@pxref{List Elements}), except that it works for any kind of 195@code{nth} (@pxref{List Elements}).
196sequence.
197@end defun 196@end defun
198 197
199@node Arrays 198@node Arrays
@@ -232,9 +231,9 @@ The elements of an array may be referenced or changed with the functions
232@code{aref} and @code{aset}, respectively (@pxref{Array Functions}). 231@code{aref} and @code{aset}, respectively (@pxref{Array Functions}).
233@end itemize 232@end itemize
234 233
235 In principle, if you wish to have an array of characters, you could use 234 In principle, if you wish to have an array of text characters, you
236either a string or a vector. In practice, we always choose strings for 235could use either a string or a vector. In practice, we always choose
237such applications, for four reasons: 236strings for such applications, for four reasons:
238 237
239@itemize @bullet 238@itemize @bullet
240@item 239@item
@@ -253,6 +252,11 @@ strings. For example, you cannot insert a vector of characters into a
253buffer the way you can insert a string. @xref{Strings and Characters}. 252buffer the way you can insert a string. @xref{Strings and Characters}.
254@end itemize 253@end itemize
255 254
255 By contrast, for an array of keyboard input characters (such as a key
256sequence), a vector may be necessary, because many keyboard input
257characters are outside the range that will fit in a string. @xref{Key
258Sequence Input}.
259
256@node Array Functions 260@node Array Functions
257@section Functions that Operate on Arrays 261@section Functions that Operate on Arrays
258 262
diff --git a/lispref/streams.texi b/lispref/streams.texi
index 6efa571ff9c..db7e9aa38ea 100644
--- a/lispref/streams.texi
+++ b/lispref/streams.texi
@@ -52,7 +52,7 @@ text produces a list (but not the same list) with elements @code{a}
52and @code{b}. 52and @code{b}.
53 53
54 However, these two operations are not precisely inverses. There are 54 However, these two operations are not precisely inverses. There are
55two kinds of exceptions: 55three kinds of exceptions:
56 56
57@itemize @bullet 57@itemize @bullet
58@item 58@item
@@ -66,6 +66,10 @@ One object can have multiple textual representations. For example,
66@samp{1} and @samp{01} represent the same integer, and @samp{(a b)} and 66@samp{1} and @samp{01} represent the same integer, and @samp{(a b)} and
67@samp{(a .@: (b))} represent the same list. Reading will accept any of 67@samp{(a .@: (b))} represent the same list. Reading will accept any of
68the alternatives, but printing must choose one of them. 68the alternatives, but printing must choose one of them.
69
70@item
71Comments can appear at certain points in the middle of an object's
72read sequence without affecting the result of reading it.
69@end itemize 73@end itemize
70 74
71@node Input Streams 75@node Input Streams
@@ -160,8 +164,9 @@ whitespace preceding the significant text.
160 In Emacs 18, reading a symbol discarded the delimiter terminating the 164 In Emacs 18, reading a symbol discarded the delimiter terminating the
161symbol. Thus, point would end up at the beginning of @samp{contents} 165symbol. Thus, point would end up at the beginning of @samp{contents}
162rather than after @samp{the}. The Emacs 19 behavior is superior because 166rather than after @samp{the}. The Emacs 19 behavior is superior because
163it correctly handles input such as @samp{bar(foo)}, where the delimiter 167it correctly handles input such as @samp{bar(foo)}, where the
164that ends one object is needed as the beginning of another object. 168open-parenthesis that ends one object is needed as the beginning of
169another object.
165 170
166 Here is an example of reading from a stream that is a marker, 171 Here is an example of reading from a stream that is a marker,
167initially positioned at the beginning of the buffer shown. The value 172initially positioned at the beginning of the buffer shown. The value
diff --git a/lispref/strings.texi b/lispref/strings.texi
index a0321476dc0..d923d0407cd 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -70,8 +70,16 @@ characters. @xref{Character Type}, for more information about
70representation of meta and other modifiers for keyboard input 70representation of meta and other modifiers for keyboard input
71characters. 71characters.
72 72
73 Strings are useful for holding regular expressions. You can also
74match regular expressions against strings (@pxref{Regexp Search}). The
75functions @code{match-string} (@pxref{Simple Match Data}) and
76@code{replace-match} (@pxref{Replacing Match}) are useful for
77decomposing and modifying strings based on regular expression matching.
78
73 Like a buffer, a string can contain text properties for the characters 79 Like a buffer, a string can contain text properties for the characters
74in it, as well as the characters themselves. @xref{Text Properties}. 80in it, as well as the characters themselves. @xref{Text Properties}.
81All the Lisp primitives that copy text from strings to buffers or other
82strings also copy the properties of the characters being copied.
75 83
76 @xref{Text}, for information about functions that display strings or 84 @xref{Text}, for information about functions that display strings or
77copy them into buffers. @xref{Character Type}, and @ref{String Type}, 85copy them into buffers. @xref{Character Type}, and @ref{String Type},
@@ -116,7 +124,7 @@ putting strings together, or by taking them apart.
116@end defun 124@end defun
117 125
118@defun substring string start &optional end 126@defun substring string start &optional end
119 This function returns a new string which consists of those characters 127This function returns a new string which consists of those characters
120from @var{string} in the range from (and including) the character at the 128from @var{string} in the range from (and including) the character at the
121index @var{start} up to (but excluding) the character at the index 129index @var{start} up to (but excluding) the character at the index
122@var{end}. The first character is at index zero. 130@var{end}. The first character is at index zero.
@@ -175,6 +183,9 @@ of @var{string}.
175But we recommend @code{copy-sequence} for this purpose (@pxref{Sequence 183But we recommend @code{copy-sequence} for this purpose (@pxref{Sequence
176Functions}). 184Functions}).
177 185
186If the characters copied from @var{string} have text properties, the
187properties are copied into the new string also. @xref{Text Properties}.
188
178A @code{wrong-type-argument} error is signaled if either @var{start} or 189A @code{wrong-type-argument} error is signaled if either @var{start} or
179@var{end} is not an integer or @code{nil}. An @code{args-out-of-range} 190@var{end} is not an integer or @code{nil}. An @code{args-out-of-range}
180error is signaled if @var{start} indicates a character following 191error is signaled if @var{start} indicates a character following
@@ -190,9 +201,10 @@ beginning of a buffer is at index 1.
190@cindex copying strings 201@cindex copying strings
191@cindex concatenating strings 202@cindex concatenating strings
192This function returns a new string consisting of the characters in the 203This function returns a new string consisting of the characters in the
193arguments passed to it. The arguments may be strings, lists of numbers, 204arguments passed to it (along with their text properties, if any). The
194or vectors of numbers; they are not themselves changed. If 205arguments may be strings, lists of numbers, or vectors of numbers; they
195@code{concat} receives no arguments, it returns an empty string. 206are not themselves changed. If @code{concat} receives no arguments, it
207returns an empty string.
196 208
197@example 209@example
198(concat "abc" "-def") 210(concat "abc" "-def")
diff --git a/lispref/symbols.texi b/lispref/symbols.texi
index caba9a9bd7e..1921dec922c 100644
--- a/lispref/symbols.texi
+++ b/lispref/symbols.texi
@@ -151,7 +151,8 @@ expression and storing it in the function cell of the symbol. This
151lambda expression thus becomes the function definition of the symbol. 151lambda expression thus becomes the function definition of the symbol.
152(The term ``function definition'', meaning the contents of the function 152(The term ``function definition'', meaning the contents of the function
153cell, is derived from the idea that @code{defun} gives the symbol its 153cell, is derived from the idea that @code{defun} gives the symbol its
154definition as a function.) @xref{Functions}. 154definition as a function.) @code{defsubst} and @code{defalias} are two
155other ways of defining a function. @xref{Functions}.
155 156
156 @code{defmacro} defines a symbol as a macro. It creates a macro 157 @code{defmacro} defines a symbol as a macro. It creates a macro
157object and stores it in the function cell of the symbol. Note that a 158object and stores it in the function cell of the symbol. Note that a
@@ -160,8 +161,8 @@ both macro and function definitions are kept in the function cell, and
160that cell can hold only one Lisp object at any given time. 161that cell can hold only one Lisp object at any given time.
161@xref{Macros}. 162@xref{Macros}.
162 163
163 In GNU Emacs Lisp, a definition is not required in order to use a 164 In Emacs Lisp, a definition is not required in order to use a symbol
164symbol as a variable or function. Thus, you can make a symbol a global 165as a variable or function. Thus, you can make a symbol a global
165variable with @code{setq}, whether you define it first or not. The real 166variable with @code{setq}, whether you define it first or not. The real
166purpose of definitions is to guide programmers and programming tools. 167purpose of definitions is to guide programmers and programming tools.
167They inform programmers who read the code that certain symbols are 168They inform programmers who read the code that certain symbols are
@@ -503,11 +504,11 @@ stored in the property list @var{plist}. For example,
503@end defun 504@end defun
504 505
505@defun plist-put plist property value 506@defun plist-put plist property value
506This stores @var{value} as the value of the @var{property} property 507This stores @var{value} as the value of the @var{property} property in
507stored in the property list @var{plist}. It may modify @var{plist} 508the property list @var{plist}. It may modify @var{plist} destructively,
508destructively, or it may construct new list structure without altering 509or it may construct new list structure without altering the old. The
509the old. The function returns the modified property list, so you can 510function returns the modified property list, so you can store that back
510store that back in the place where you got @var{plist}. For example, 511in the place where you got @var{plist}. For example,
511 512
512@example 513@example
513(setq my-plist '(bar t foo 4)) 514(setq my-plist '(bar t foo 4))
diff --git a/lispref/syntax.texi b/lispref/syntax.texi
index f621e0c0ddf..585df47580a 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -43,7 +43,7 @@ this chapter.
43@end ifinfo 43@end ifinfo
44 44
45 A syntax table is a vector of 256 elements; it contains one entry for 45 A syntax table is a vector of 256 elements; it contains one entry for
46each of the 256 @sc{ASCII} characters of an 8-bit byte. Each element is 46each of the 256 possible characters in an 8-bit byte. Each element is
47an integer that encodes the syntax of the character in question. 47an integer that encodes the syntax of the character in question.
48 48
49 Syntax tables are used only for moving across text, not for the Emacs 49 Syntax tables are used only for moving across text, not for the Emacs
@@ -650,8 +650,8 @@ exceed that many.
650@node Standard Syntax Tables 650@node Standard Syntax Tables
651@section Some Standard Syntax Tables 651@section Some Standard Syntax Tables
652 652
653 Each of the major modes in Emacs has its own syntax table. Here are 653 Most of the major modes in Emacs have their own syntax tables. Here
654several of them: 654are several of them:
655 655
656@defun standard-syntax-table 656@defun standard-syntax-table
657This function returns the standard syntax table, which is the syntax 657This function returns the standard syntax table, which is the syntax
diff --git a/lispref/text.texi b/lispref/text.texi
index eefd2c30259..b4547224308 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -26,7 +26,7 @@ interactive call, point and the mark are used for these arguments.
26 26
27@cindex buffer contents 27@cindex buffer contents
28 Throughout this chapter, ``text'' refers to the characters in the 28 Throughout this chapter, ``text'' refers to the characters in the
29buffer. 29buffer, together with their properties (when relevant).
30 30
31@menu 31@menu
32* Near Point:: Examining text in the vicinity of point. 32* Near Point:: Examining text in the vicinity of point.
@@ -41,6 +41,7 @@ buffer.
41* Maintaining Undo:: How to enable and disable undo information. 41* Maintaining Undo:: How to enable and disable undo information.
42 How to control how much information is kept. 42 How to control how much information is kept.
43* Filling:: Functions for explicit filling. 43* Filling:: Functions for explicit filling.
44* Margins:: How to specify margins for filling commands.
44* Auto Filling:: How auto-fill mode is implemented to break lines. 45* Auto Filling:: How auto-fill mode is implemented to break lines.
45* Sorting:: Functions for sorting parts of the buffer. 46* Sorting:: Functions for sorting parts of the buffer.
46* Columns:: Computing horizontal positions, and using them. 47* Columns:: Computing horizontal positions, and using them.
@@ -239,7 +240,8 @@ the result is one plus the index of the first differing characters
239within the substrings. 240within the substrings.
240 241
241This function ignores case when comparing characters 242This function ignores case when comparing characters
242if @code{case-fold-search} is non-@code{nil}. 243if @code{case-fold-search} is non-@code{nil}. It always ignores
244text properties.
243 245
244Suppose the current buffer contains the text @samp{foobarbar 246Suppose the current buffer contains the text @samp{foobarbar
245haha!rara!}; then in this example the two substrings are @samp{rbar } 247haha!rara!}; then in this example the two substrings are @samp{rbar }
@@ -250,12 +252,10 @@ at the second character.
250(compare-buffer-substring nil 6 11 nil 16 21) 252(compare-buffer-substring nil 6 11 nil 16 21)
251 @result{} 2 253 @result{} 2
252@end example 254@end example
253
254This function does not exist in Emacs version 18 and earlier.
255@end defun 255@end defun
256 256
257@node Insertion 257@node Insertion
258@section Insertion 258@section Inserting Text
259@cindex insertion of text 259@cindex insertion of text
260@cindex text insertion 260@cindex text insertion
261 261
@@ -280,6 +280,12 @@ point} and the latter insertion @dfn{before point}.
280 Insertion functions signal an error if the current buffer is 280 Insertion functions signal an error if the current buffer is
281read-only. 281read-only.
282 282
283 These functions copy text characters from strings and buffers along
284with their properties. The inserted characters have exactly the same
285properties as the characters they were copied from. By contrast,
286characters specified as separate arguments, not part of a string or
287buffer, inherit their text properties from the neighboring text.
288
283@defun insert &rest args 289@defun insert &rest args
284This function inserts the strings and/or characters @var{args} into the 290This function inserts the strings and/or characters @var{args} into the
285current buffer, at point, moving point forward. In other words, it 291current buffer, at point, moving point forward. In other words, it
@@ -393,6 +399,9 @@ result in this case is to insert two newlines at different places: one
393at point, and another earlier in the line. @code{newline} does not 399at point, and another earlier in the line. @code{newline} does not
394auto-fill if @var{number-of-newlines} is non-@code{nil}. 400auto-fill if @var{number-of-newlines} is non-@code{nil}.
395 401
402This command indents to the left margin if that is not zero.
403@xref{Margins}.
404
396The value returned is @code{nil}. In an interactive call, @var{count} 405The value returned is @code{nil}. In an interactive call, @var{count}
397is the numeric prefix argument. 406is the numeric prefix argument.
398@end deffn 407@end deffn
@@ -414,7 +423,7 @@ buffer-local when set in any fashion.
414@end defvar 423@end defvar
415 424
416@node Deletion 425@node Deletion
417@section Deletion of Text 426@section Deleting Text
418 427
419@cindex deletion vs killing 428@cindex deletion vs killing
420 Deletion means removing part of the text in a buffer, without saving 429 Deletion means removing part of the text in a buffer, without saving
@@ -544,7 +553,7 @@ instead. The value is @code{nil}.
544 553
545If there is a fill prefix, and the second of the lines being joined 554If there is a fill prefix, and the second of the lines being joined
546starts with the prefix, then @code{delete-indentation} deletes the 555starts with the prefix, then @code{delete-indentation} deletes the
547fill prefix before joining the lines. @xref{Filling}. 556fill prefix before joining the lines. @xref{Margins}.
548 557
549In the example below, point is located on the line starting 558In the example below, point is located on the line starting
550@samp{events}, and it makes no difference if there are trailing spaces 559@samp{events}, and it makes no difference if there are trailing spaces
@@ -713,8 +722,8 @@ and if so appends the killed text to the most recent entry.
713 722
714@deffn Command kill-region start end 723@deffn Command kill-region start end
715This function kills the text in the region defined by @var{start} and 724This function kills the text in the region defined by @var{start} and
716@var{end}. The text is deleted but saved in the kill ring. The value 725@var{end}. The text is deleted but saved in the kill ring, along with
717is always @code{nil}. 726its text properties. The value is always @code{nil}.
718 727
719In an interactive call, @var{start} and @var{end} are point and 728In an interactive call, @var{start} and @var{end} are point and
720the mark. 729the mark.
@@ -728,9 +737,10 @@ text into the kill ring from a read-only buffer.
728 737
729@deffn Command copy-region-as-kill start end 738@deffn Command copy-region-as-kill start end
730This command saves the region defined by @var{start} and @var{end} on 739This command saves the region defined by @var{start} and @var{end} on
731the kill ring, but does not delete the text from the buffer. It returns 740the kill ring (including text properties), but does not delete the text
732@code{nil}. It also indicates the extent of the text copied by moving 741from the buffer. It returns @code{nil}. It also indicates the extent
733the cursor momentarily, or by displaying a message in the echo area. 742of the text copied by moving the cursor momentarily, or by displaying a
743message in the echo area.
734 744
735The command does not set @code{this-command} to @code{kill-region}, so a 745The command does not set @code{this-command} to @code{kill-region}, so a
736subsequent kill command does not append to the same kill ring entry. 746subsequent kill command does not append to the same kill ring entry.
@@ -745,7 +755,7 @@ support Emacs 18. For Emacs 19, it is better to use @code{kill-new} or
745@subsection Functions for Yanking 755@subsection Functions for Yanking
746 756
747 @dfn{Yanking} means reinserting an entry of previously killed text 757 @dfn{Yanking} means reinserting an entry of previously killed text
748from the kill ring. 758from the kill ring. The text properties are copied too.
749 759
750@deffn Command yank &optional arg 760@deffn Command yank &optional arg
751@cindex inserting killed text 761@cindex inserting killed text
@@ -975,8 +985,9 @@ Here's how you might undo the change:
975@end example 985@end example
976 986
977@item @var{position} 987@item @var{position}
978This element indicates where point was at an earlier time. 988This element indicates where point was at an earlier time. Undoing this
979Undoing this element sets point to @var{position}. 989element sets point to @var{position}. Deletion normally creates an
990element of this kind as well as a reinsertion element.
980 991
981@item nil 992@item nil
982This element is a boundary. The elements between two boundaries are 993This element is a boundary. The elements between two boundaries are
@@ -1018,7 +1029,7 @@ but it is convenient to have it in C.
1018changes the buffer. Undo commands avoid confusion by saving the undo 1029changes the buffer. Undo commands avoid confusion by saving the undo
1019list value at the beginning of a sequence of undo operations. Then the 1030list value at the beginning of a sequence of undo operations. Then the
1020undo operations use and update the saved value. The new elements added 1031undo operations use and update the saved value. The new elements added
1021by undoing are not part of the saved value, so they don't interfere with 1032by undoing are not part of this saved value, so they don't interfere with
1022continuing to undo. 1033continuing to undo.
1023@end defun 1034@end defun
1024 1035
@@ -1089,10 +1100,9 @@ change group is never discarded separate no matter how big it is.
1089 @dfn{Filling} means adjusting the lengths of lines (by moving the line 1100 @dfn{Filling} means adjusting the lengths of lines (by moving the line
1090breaks) so that they are nearly (but no greater than) a specified 1101breaks) so that they are nearly (but no greater than) a specified
1091maximum width. Additionally, lines can be @dfn{justified}, which means 1102maximum width. Additionally, lines can be @dfn{justified}, which means
1092that spaces are inserted between words to make the line exactly the 1103inserting spaces to make the left and/or right margins line up
1093specified width. The width is controlled by the variable 1104precisely. The width is controlled by the variable @code{fill-column}.
1094@code{fill-column}. For ease of reading, lines should be no longer than 1105For ease of reading, lines should be no longer than 70 or so columns.
109570 or so columns.
1096 1106
1097 You can use Auto Fill mode (@pxref{Auto Filling}) to fill text 1107 You can use Auto Fill mode (@pxref{Auto Filling}) to fill text
1098automatically as you insert it, but changes to existing text may leave 1108automatically as you insert it, but changes to existing text may leave
@@ -1100,28 +1110,38 @@ it improperly filled. Then you must fill the text explicitly.
1100 1110
1101 Most of the commands in this section return values that are not 1111 Most of the commands in this section return values that are not
1102meaningful. All the functions that do filling take note of the current 1112meaningful. All the functions that do filling take note of the current
1103left margin, current right margin, and current justification style. If 1113left margin, current right margin, and current justification style
1104the current justification style is @code{none}, the filling functions 1114(@pxref{Margins}). If the current justification style is
1105don't actually do anything. 1115@code{none}, the filling functions don't actually do anything.
1116
1117 Several of the filling functions have an argument @var{justify}.
1118If it is non-@code{nil}, that requests some kind of justification. It
1119can be @code{left}, @code{right}, @code{full}, or @code{center}, to
1120request a specific style of justification. If it is @code{t}, that
1121means to use the current justification style for this part of the text
1122(see @code{current-justification}, below).
1123
1124 When you call the filling functions interactively, using a prefix
1125argument implies the value @code{full} for @var{justify}.
1106 1126
1107@deffn Command fill-paragraph justify-flag 1127@deffn Command fill-paragraph justify
1108@cindex filling a paragraph 1128@cindex filling a paragraph
1109This command fills the paragraph at or after point. If 1129This command fills the paragraph at or after point. If
1110@var{justify-flag} is non-@code{nil}, each line is justified as well. 1130@var{justify} is non-@code{nil}, each line is justified as well.
1111It uses the ordinary paragraph motion commands to find paragraph 1131It uses the ordinary paragraph motion commands to find paragraph
1112boundaries. @xref{Paragraphs,,, emacs, The Emacs Manual}. 1132boundaries. @xref{Paragraphs,,, emacs, The Emacs Manual}.
1113@end deffn 1133@end deffn
1114 1134
1115@deffn Command fill-region start end &optional justify-flag 1135@deffn Command fill-region start end &optional justify
1116This command fills each of the paragraphs in the region from @var{start} 1136This command fills each of the paragraphs in the region from @var{start}
1117to @var{end}. It justifies as well if @var{justify-flag} is 1137to @var{end}. It justifies as well if @var{justify} is
1118non-@code{nil}. 1138non-@code{nil}.
1119 1139
1120The variable @code{paragraph-separate} controls how to distinguish 1140The variable @code{paragraph-separate} controls how to distinguish
1121paragraphs. @xref{Standard Regexps}. 1141paragraphs. @xref{Standard Regexps}.
1122@end deffn 1142@end deffn
1123 1143
1124@deffn Command fill-individual-paragraphs start end &optional justify-flag mail-flag 1144@deffn Command fill-individual-paragraphs start end &optional justify mail-flag
1125This command fills each paragraph in the region according to its 1145This command fills each paragraph in the region according to its
1126individual fill prefix. Thus, if the lines of a paragraph were indented 1146individual fill prefix. Thus, if the lines of a paragraph were indented
1127with spaces, the filled paragraph will remain indented in the same 1147with spaces, the filled paragraph will remain indented in the same
@@ -1129,8 +1149,8 @@ fashion.
1129 1149
1130The first two arguments, @var{start} and @var{end}, are the beginning 1150The first two arguments, @var{start} and @var{end}, are the beginning
1131and end of the region to be filled. The third and fourth arguments, 1151and end of the region to be filled. The third and fourth arguments,
1132@var{justify-flag} and @var{mail-flag}, are optional. If 1152@var{justify} and @var{mail-flag}, are optional. If
1133@var{justify-flag} is non-@code{nil}, the paragraphs are justified as 1153@var{justify} is non-@code{nil}, the paragraphs are justified as
1134well as filled. If @var{mail-flag} is non-@code{nil}, it means the 1154well as filled. If @var{mail-flag} is non-@code{nil}, it means the
1135function is operating on a mail message and therefore should not fill 1155function is operating on a mail message and therefore should not fill
1136the header lines. 1156the header lines.
@@ -1147,13 +1167,11 @@ This variable alters the action of @code{fill-individual-paragraphs} as
1147described above. 1167described above.
1148@end defopt 1168@end defopt
1149 1169
1150@deffn Command fill-region-as-paragraph start end &optional justify-flag 1170@deffn Command fill-region-as-paragraph start end &optional justify
1151This command considers a region of text as a paragraph and fills it. If 1171This command considers a region of text as a paragraph and fills it. If
1152the region was made up of many paragraphs, the blank lines between 1172the region was made up of many paragraphs, the blank lines between
1153paragraphs are removed. This function justifies as well as filling when 1173paragraphs are removed. This function justifies as well as filling when
1154@var{justify-flag} is non-@code{nil}. The precise value of 1174@var{justify} is non-@code{nil}.
1155@var{justify-flag} specifies a style of justification, as in
1156@code{justify-current-line}, below.
1157 1175
1158In an interactive call, any prefix argument requests justification. 1176In an interactive call, any prefix argument requests justification.
1159 1177
@@ -1187,7 +1205,7 @@ whitespace.
1187This variable's value specifies the style of justification to use for 1205This variable's value specifies the style of justification to use for
1188text that doesn't specify a style with a text property. The possible 1206text that doesn't specify a style with a text property. The possible
1189values are @code{left}, @code{right}, @code{full}, @code{center}, or 1207values are @code{left}, @code{right}, @code{full}, @code{center}, or
1190@code{none}. 1208@code{none}. The default value is @code{left}.
1191@end defopt 1209@end defopt
1192 1210
1193@defun current-justification 1211@defun current-justification
@@ -1195,6 +1213,32 @@ This function returns the proper justification style to use for filling
1195the text around point. 1213the text around point.
1196@end defun 1214@end defun
1197 1215
1216@defvar fill-paragraph-function
1217This variable provides a way for major modes to override the filling of
1218paragraphs. If the value is non-@code{nil}, @code{fill-paragraph} calls
1219this function to do the work. If the function returns a non-@code{nil}
1220value, @code{fill-paragraph} assumes the job is done, and immediately
1221returns that value.
1222
1223The usual use of this feature is to fill comments in programming
1224language modes. If the function needs to fill a paragraph in the usual
1225way, it can do so as follows:
1226
1227@example
1228(let ((fill-paragraph-function nil))
1229 (fill-paragraph arg))
1230@end example
1231@end defvar
1232
1233@defvar use-hard-newlines
1234If this variable is non-@code{nil}, the filling functions do not delete
1235newlines that have the @code{hard} text property. These ``hard
1236newlines'' act as paragraph separators.
1237@end defvar
1238
1239@node Margins
1240@section Margins for Filling
1241
1198@defopt fill-prefix 1242@defopt fill-prefix
1199This variable specifies a string of text that appears at the beginning 1243This variable specifies a string of text that appears at the beginning
1200of normal text lines and should be disregarded when filling them. Any 1244of normal text lines and should be disregarded when filling them. Any
@@ -1203,6 +1247,8 @@ a paragraph; so is any line that starts with the fill prefix followed by
1203additional whitespace. Lines that start with the fill prefix but no 1247additional whitespace. Lines that start with the fill prefix but no
1204additional whitespace are ordinary text lines that can be filled 1248additional whitespace are ordinary text lines that can be filled
1205together. The resulting filled lines also start with the fill prefix. 1249together. The resulting filled lines also start with the fill prefix.
1250
1251The fill prefix follows the left margin whitespace, if any.
1206@end defopt 1252@end defopt
1207 1253
1208@defopt fill-column 1254@defopt fill-column
@@ -1225,23 +1271,6 @@ buffers that do not override it. This is the same as
1225The default value for @code{default-fill-column} is 70. 1271The default value for @code{default-fill-column} is 70.
1226@end defvar 1272@end defvar
1227 1273
1228@defvar fill-paragraph-function
1229This variable provides a way for major modes to override the filling of
1230paragraphs. If the value is non-@code{nil}, @code{fill-paragraph} calls
1231this function to do the work. If the function returns a non-@code{nil}
1232value, @code{fill-paragraph} assumes the job is done, and immediately
1233returns that value.
1234
1235The usual use of this feature is to fill comments in programming
1236language modes. If the function needs to fill a paragraph in the usual
1237way, it can do so as follows:
1238
1239@example
1240(let ((fill-paragraph-function nil))
1241 (fill-paragraph arg))
1242@end example
1243@end defvar
1244
1245@deffn Command set-left-margin from to margin 1274@deffn Command set-left-margin from to margin
1246This sets the @code{left-margin} property on the text from @var{from} to 1275This sets the @code{left-margin} property on the text from @var{from} to
1247@var{to} to the value @var{margin}. If Auto Fill mode is enabled, this 1276@var{to} to the value @var{margin}. If Auto Fill mode is enabled, this
@@ -1249,17 +1278,16 @@ command also refills the region to fit the new margin.
1249@end deffn 1278@end deffn
1250 1279
1251@deffn Command set-right-margin from to margin 1280@deffn Command set-right-margin from to margin
1252This sets the @code{fill-colmn} property on the text from @var{from} to 1281This sets the @code{right-margin} property on the text from @var{from}
1253@var{to} so as to yield a right margin of width @var{margin}. If Auto 1282to @var{to} to the value @var{margin}. If Auto Fill mode is enabled,
1254Fill mode is enabled, this command also refills the region to fit the 1283this command also refills the region to fit the new margin.
1255new margin.
1256@end deffn 1284@end deffn
1257 1285
1258@defun current-left-margin 1286@defun current-left-margin
1259This function returns the proper left margin value to use for filling 1287This function returns the proper left margin value to use for filling
1260the text around point. The value is the sum of the @code{left-margin} 1288the text around point. The value is the sum of the @code{left-margin}
1261property of the character at the start of the current line (or zero if 1289property of the character at the start of the current line (or zero if
1262none), plus the value of the variable @code{left-margin}. 1290none), and the value of the variable @code{left-margin}.
1263@end defun 1291@end defun
1264 1292
1265@defun current-fill-column 1293@defun current-fill-column
@@ -1272,7 +1300,7 @@ character after point.
1272@deffn Command move-to-left-margin &optional n force 1300@deffn Command move-to-left-margin &optional n force
1273This function moves point to the left margin of the current line. The 1301This function moves point to the left margin of the current line. The
1274column moved to is determined by calling the function 1302column moved to is determined by calling the function
1275@code{current-left-margin}. If the argument @var{n} is specified, 1303@code{current-left-margin}. If the argument @var{n} is non-@code{nil},
1276@code{move-to-left-margin} moves forward @var{n}@minus{}1 lines first. 1304@code{move-to-left-margin} moves forward @var{n}@minus{}1 lines first.
1277 1305
1278If @var{force} is non-@code{nil}, that says to fix the line's 1306If @var{force} is non-@code{nil}, that says to fix the line's
@@ -1286,6 +1314,20 @@ to delete is determined by calling @code{current-left-margin}.
1286In no case does this function delete non-whitespace. 1314In no case does this function delete non-whitespace.
1287@end defun 1315@end defun
1288 1316
1317@defun indent-to-left-margin
1318This is the default @code{indent-line-function}, used in Fundamental
1319mode, Text mode, etc. Its effect is to adjust the indentation at the
1320beginning of the current line to the value specified by the variable
1321@code{left-margin}. This may involve either inserting or deleting
1322whitespace.
1323@end defun
1324
1325@defvar left-margin
1326This variable specifies the base left margin column. In Fundamental
1327mode, @key{LFD} indents to this column. This variable automatically
1328becomes buffer-local when set in any fashion.
1329@end defvar
1330
1289@node Auto Filling 1331@node Auto Filling
1290@comment node-name, next, previous, up 1332@comment node-name, next, previous, up
1291@section Auto Filling 1333@section Auto Filling
@@ -1297,6 +1339,9 @@ as inserted. This section describes the hook used by Auto Fill mode.
1297For a description of functions that you can call explicitly to fill and 1339For a description of functions that you can call explicitly to fill and
1298justify existing text, see @ref{Filling}. 1340justify existing text, see @ref{Filling}.
1299 1341
1342 Auto Fill mode also enables the functions that change the margins and
1343justification style to refill portions of the text. @xref{Margins}.
1344
1300@defvar auto-fill-function 1345@defvar auto-fill-function
1301The value of this variable should be a function (of no arguments) to be 1346The value of this variable should be a function (of no arguments) to be
1302called after self-inserting a space or a newline. It may be @code{nil}, 1347called after self-inserting a space or a newline. It may be @code{nil},
@@ -1539,8 +1584,6 @@ containing position @var{beg}, and the entire line containing position
1539Note that @code{sort-columns} uses the @code{sort} utility program, 1584Note that @code{sort-columns} uses the @code{sort} utility program,
1540and so cannot work properly on text containing tab characters. Use 1585and so cannot work properly on text containing tab characters. Use
1541@kbd{M-x @code{untabify}} to convert tabs to spaces before sorting. 1586@kbd{M-x @code{untabify}} to convert tabs to spaces before sorting.
1542
1543The @code{sort-columns} function did not work on VMS prior to Emacs 19.
1544@end deffn 1587@end deffn
1545 1588
1546@node Columns 1589@node Columns
@@ -1689,20 +1732,6 @@ the current line; except that if that function is
1689is a trivial command that inserts a tab character.) 1732is a trivial command that inserts a tab character.)
1690@end deffn 1733@end deffn
1691 1734
1692@defun indent-to-left-margin
1693This is the default @code{indent-line-function}, used in Fundamental
1694mode, Text mode, etc. Its effect is to adjust the indentation at the
1695beginning of the current line to the value specified by the variable
1696@code{left-margin}. This may involve either inserting or deleting
1697whitespace.
1698@end defun
1699
1700@defvar left-margin
1701This variable specifies the column for @code{indent-to-left-margin} to
1702indent to. In Fundamental mode, @key{LFD} indents to this column. This
1703variable automatically becomes buffer-local when set in any fashion.
1704@end defvar
1705
1706@deffn Command newline-and-indent 1735@deffn Command newline-and-indent
1707@comment !!SourceFile simple.el 1736@comment !!SourceFile simple.el
1708This function inserts a newline, then indents the new line (the one 1737This function inserts a newline, then indents the new line (the one
@@ -2107,8 +2136,8 @@ This function returns the entire property list of the character at
2107@defvar default-text-properties 2136@defvar default-text-properties
2108This variable holds a property list giving default values for text 2137This variable holds a property list giving default values for text
2109properties. Whenever a character does not specify a value for a 2138properties. Whenever a character does not specify a value for a
2110property, the value stored in this list is used instead. Here is an 2139property, neither directly nor through a category symbol, the value
2111example: 2140stored in this list is used instead. Here is an example:
2112 2141
2113@example 2142@example
2114(setq default-text-properties '(foo 69)) 2143(setq default-text-properties '(foo 69))
@@ -2134,6 +2163,12 @@ can affect how the buffer looks on the screen, any change in the text
2134properties is considered a buffer modification. Buffer text property 2163properties is considered a buffer modification. Buffer text property
2135changes are undoable (@pxref{Undo}). 2164changes are undoable (@pxref{Undo}).
2136 2165
2166@defun put-text-property start end prop value &optional object
2167This function sets the @var{prop} property to @var{value} for the text
2168between @var{start} and @var{end} in the string or buffer @var{object}.
2169If @var{object} is @code{nil}, it defaults to the current buffer.
2170@end defun
2171
2137@defun add-text-properties start end props &optional object 2172@defun add-text-properties start end props &optional object
2138This function modifies the text properties for the text between 2173This function modifies the text properties for the text between
2139@var{start} and @var{end} in the string or buffer @var{object}. If 2174@var{start} and @var{end} in the string or buffer @var{object}. If
@@ -2157,12 +2192,6 @@ properties of a range of text:
2157@end example 2192@end example
2158@end defun 2193@end defun
2159 2194
2160@defun put-text-property start end prop value &optional object
2161This function sets the @var{prop} property to @var{value} for the text
2162between @var{start} and @var{end} in the string or buffer @var{object}.
2163If @var{object} is @code{nil}, it defaults to the current buffer.
2164@end defun
2165
2166@defun remove-text-properties start end props &optional object 2195@defun remove-text-properties start end props &optional object
2167This function deletes specified text properties from the text between 2196This function deletes specified text properties from the text between
2168@var{start} and @var{end} in the string or buffer @var{object}. If 2197@var{start} and @var{end} in the string or buffer @var{object}. If
@@ -2214,13 +2243,14 @@ consecutive characters have the same value for a property. Rather than
2214writing your programs to examine characters one by one, it is much 2243writing your programs to examine characters one by one, it is much
2215faster to process chunks of text that have the same property value. 2244faster to process chunks of text that have the same property value.
2216 2245
2217Here are functions you can use to do this. In all cases, @var{object} 2246Here are functions you can use to do this. They use @code{eq} for
2218defaults to the current buffer. 2247comparing property values. In all cases, @var{object} defaults to the
2248current buffer.
2219 2249
2220For high performance, it's very important to use the @var{limit} 2250For high performance, it's very important to use the @var{limit}
2221argument to these functions, especially the ones that search for a 2251argument to these functions, especially the ones that search for a
2222single property---otherwise, they may spend a long time considering 2252single property---otherwise, they may spend a long time scanning to the
2223changes in other properties while scanning to the end of the buffer. 2253end of the buffer, if the property you are interested in does not change.
2224 2254
2225Remember that a position is always between two characters; the position 2255Remember that a position is always between two characters; the position
2226returned by these functions is between two characters with different 2256returned by these functions is between two characters with different
@@ -2314,6 +2344,11 @@ for @var{object} is the current buffer.
2314@node Special Properties 2344@node Special Properties
2315@subsection Properties with Special Meanings 2345@subsection Properties with Special Meanings
2316 2346
2347 Here is a table of text property names that have special built-in
2348meanings. The following section lists a few more special property names
2349that are used to control filling. All other names have no standard
2350meaning, and you can use them as you like.
2351
2317@table @code 2352@table @code
2318@cindex category of text character 2353@cindex category of text character
2319@kindex category @r{(text property)} 2354@kindex category @r{(text property)}
@@ -2370,8 +2405,8 @@ on the screen. @xref{Invisible Text}, for details.
2370@kindex intangible @r{(text property)} 2405@kindex intangible @r{(text property)}
2371If a group of consecutive characters have equal and non-@code{nil} 2406If a group of consecutive characters have equal and non-@code{nil}
2372@code{intangible} properties, then you cannot place point between them. 2407@code{intangible} properties, then you cannot place point between them.
2373If you move point forward into the group, point actually moves to the 2408If you try to move point forward into the group, point actually moves to
2374end of the group. If you try to move point backward into the group, 2409the end of the group. If you try to move point backward into the group,
2375point actually moves to the start of the group. 2410point actually moves to the start of the group.
2376 2411
2377When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}, 2412When the variable @code{inhibit-point-motion-hooks} is non-@code{nil},
@@ -2444,12 +2479,13 @@ property has no effect.
2444@end defvar 2479@end defvar
2445 2480
2446@node Format Properties 2481@node Format Properties
2447@section Formatted Text Properties 2482@subsection Formatted Text Properties
2448 2483
2449 These text properties affect the behavior of the fill commands. They 2484 These text properties affect the behavior of the fill commands. They
2450are used for representing formatted text. @xref{Filling}. 2485are used for representing formatted text. @xref{Filling}, and
2486@ref{Margins}.
2451 2487
2452@table code 2488@table @code
2453@item hard 2489@item hard
2454If a newline character has this property, it is a ``hard'' newline. 2490If a newline character has this property, it is a ``hard'' newline.
2455The fill commands do not alter hard newlines and do not move words 2491The fill commands do not alter hard newlines and do not move words
@@ -2457,11 +2493,11 @@ across them. However, this property takes effect only if the variable
2457@code{use-hard-newlines} is non-@code{nil}. 2493@code{use-hard-newlines} is non-@code{nil}.
2458 2494
2459@item right-margin 2495@item right-margin
2460This property specifies the right margin for filling this part of the 2496This property specifies an extra right margin for filling this part of the
2461text. 2497text.
2462 2498
2463@item left-margin 2499@item left-margin
2464This property specifies the left margin for filling this part of the 2500This property specifies an extra left margin for filling this part of the
2465text. 2501text.
2466 2502
2467@item justification 2503@item justification
@@ -2541,7 +2577,7 @@ adjoining text.
2541 You can save text properties in files, and restore text properties 2577 You can save text properties in files, and restore text properties
2542when inserting the files, using these two hooks: 2578when inserting the files, using these two hooks:
2543 2579
2544@defvar write-region-annotation-functions 2580@defvar write-region-annotate-functions
2545This variable's value is a list of functions for @code{write-region} to 2581This variable's value is a list of functions for @code{write-region} to
2546run to encode text properties in some fashion as annotations to the text 2582run to encode text properties in some fashion as annotations to the text
2547being written in the file. @xref{Writing to Files}. 2583being written in the file. @xref{Writing to Files}.
@@ -2597,6 +2633,10 @@ names or property values---because a program that general is probably
2597difficult to write, and slow. Instead, choose a set of possible data 2633difficult to write, and slow. Instead, choose a set of possible data
2598types that are reasonably flexible, and not too hard to encode. 2634types that are reasonably flexible, and not too hard to encode.
2599 2635
2636@xref{Format Conversion}, for a related feature.
2637
2638@c ??? In next edition, merge this info Format Conversion.
2639
2600@node Not Intervals 2640@node Not Intervals
2601@subsection Why Text Properties are not Intervals 2641@subsection Why Text Properties are not Intervals
2602@cindex intervals 2642@cindex intervals
@@ -2659,11 +2699,10 @@ defined by @var{start} and @var{end}.
2659 2699
2660@cindex Outline mode 2700@cindex Outline mode
2661@cindex undo avoidance 2701@cindex undo avoidance
2662If @var{noundo} is non-@code{nil}, then @code{subst-char-in-region} 2702If @var{noundo} is non-@code{nil}, then @code{subst-char-in-region} does
2663does not record the change for undo and does not mark the buffer as 2703not record the change for undo and does not mark the buffer as modified.
2664modified. This feature is useful for changes that are not considered 2704This feature is used for controlling selective display (@pxref{Selective
2665significant, such as when Outline mode changes visible lines to 2705Display}).
2666invisible lines and vice versa.
2667 2706
2668@code{subst-char-in-region} does not move point and returns 2707@code{subst-char-in-region} does not move point and returns
2669@code{nil}. 2708@code{nil}.
@@ -2700,8 +2739,6 @@ The return value of @code{translate-region} is the number of
2700characters that were actually changed by the translation. This does 2739characters that were actually changed by the translation. This does
2701not count characters that were mapped into themselves in the 2740not count characters that were mapped into themselves in the
2702translation table. 2741translation table.
2703
2704This function is available in Emacs versions 19 and later.
2705@end defun 2742@end defun
2706 2743
2707@node Registers 2744@node Registers
@@ -2875,13 +2912,13 @@ buffer that's about to change is always the current buffer.
2875@end defvar 2912@end defvar
2876 2913
2877@defvar before-change-function 2914@defvar before-change-function
2878This variable holds one function to call before any buffer modification 2915This obsolete variable holds one function to call before any buffer
2879(or @code{nil} for no function). It is called just like the functions 2916modification (or @code{nil} for no function). It is called just like
2880in @code{before-change-functions}. 2917the functions in @code{before-change-functions}.
2881@end defvar 2918@end defvar
2882 2919
2883@defvar after-change-function 2920@defvar after-change-function
2884This variable holds one function to call after any buffer modification 2921This obsolete variable holds one function to call after any buffer modification
2885(or @code{nil} for no function). It is called just like the functions in 2922(or @code{nil} for no function). It is called just like the functions in
2886@code{after-change-functions}. 2923@code{after-change-functions}.
2887@end defvar 2924@end defvar
@@ -2916,6 +2953,3 @@ to call. Here is an example:
2916This variable is a normal hook that is run whenever a buffer is changed 2953This variable is a normal hook that is run whenever a buffer is changed
2917that was previously in the unmodified state. 2954that was previously in the unmodified state.
2918@end defvar 2955@end defvar
2919
2920 The variables described in this section are meaningful only starting
2921with Emacs version 19.
diff --git a/lispref/tips.texi b/lispref/tips.texi
index 9c252748230..76cd3427eef 100644
--- a/lispref/tips.texi
+++ b/lispref/tips.texi
@@ -60,14 +60,28 @@ library program, at least if there is more than one entry point to the
60program. 60program.
61 61
62@item 62@item
63If a file requires certain other library programs to be loaded
64beforehand, then the comments at the beginning of the file should say
65so. Also, use @code{require} to make sure they are loaded.
66
67@item
63If one file @var{foo} uses a macro defined in another file @var{bar}, 68If one file @var{foo} uses a macro defined in another file @var{bar},
64@var{foo} should contain @code{(require '@var{bar})} before the first 69@var{foo} should contain this expression before the first use of the
65use of the macro. (And @var{bar} should contain @code{(provide 70macro:
66'@var{bar})}, to make the @code{require} work.) This will cause 71
67@var{bar} to be loaded when you byte-compile @var{foo}. Otherwise, you 72@example
68risk compiling @var{foo} without the necessary macro loaded, and that 73(eval-when-compile (require '@var{bar}))
69would produce compiled code that won't work right. @xref{Compiling 74@end example
70Macros}. 75
76@noindent
77(And @var{bar} should contain @code{(provide '@var{bar})}, to make the
78@code{require} work.) This will cause @var{bar} to be loaded when you
79byte-compile @var{foo}. Otherwise, you risk compiling @var{foo} without
80the necessary macro loaded, and that would produce compiled code that
81won't work right. @xref{Compiling Macros}.
82
83Using @code{eval-when-compile} avoids loading @var{bar} when
84the compiled version of @var{foo} is @emph{used}.
71 85
72@item 86@item
73If you define a major mode, make sure to run a hook variable using 87If you define a major mode, make sure to run a hook variable using
@@ -156,11 +170,6 @@ say which functions are replaced, and how the behavior of the
156replacements differs from that of the originals. 170replacements differs from that of the originals.
157 171
158@item 172@item
159If a file requires certain standard library programs to be loaded
160beforehand, then the comments at the beginning of the file should say
161so.
162
163@item
164Please keep the names of your Emacs Lisp source files to 13 characters 173Please keep the names of your Emacs Lisp source files to 13 characters
165or less. This way, if the files are compiled, the compiled files' names 174or less. This way, if the files are compiled, the compiled files' names
166will be 14 characters or less, which is short enough to fit on all kinds 175will be 14 characters or less, which is short enough to fit on all kinds
@@ -212,6 +221,10 @@ Do not use @code{message}, @code{throw}, @code{sleep-for},
212or @code{beep} to report errors. 221or @code{beep} to report errors.
213 222
214@item 223@item
224An error message should start with a capital letter but should not end
225with a period.
226
227@item
215Try to avoid using recursive edits. Instead, do what the Rmail @kbd{e} 228Try to avoid using recursive edits. Instead, do what the Rmail @kbd{e}
216command does: use a new local keymap that contains one command defined 229command does: use a new local keymap that contains one command defined
217to switch back to the old local keymap. Or do what the 230to switch back to the old local keymap. Or do what the
@@ -265,10 +278,10 @@ Function calls are slow in Emacs Lisp even when a compiled function
265is calling another compiled function. 278is calling another compiled function.
266 279
267@item 280@item
268Using the primitive list-searching functions @code{memq}, @code{assq}, or 281Using the primitive list-searching functions @code{memq}, @code{member},
269@code{assoc} is even faster than explicit iteration. It may be worth 282@code{assq}, or @code{assoc} is even faster than explicit iteration. It
270rearranging a data structure so that one of these primitive search 283may be worth rearranging a data structure so that one of these primitive
271functions can be used. 284search functions can be used.
272 285
273@item 286@item
274Certain built-in functions are handled specially in byte-compiled code, 287Certain built-in functions are handled specially in byte-compiled code,
@@ -431,10 +444,6 @@ It is not practical to use @samp{\\[@dots{}]} very many times, because
431display of the documentation string will become slow. So use this to 444display of the documentation string will become slow. So use this to
432describe the most important commands in your major mode, and then use 445describe the most important commands in your major mode, and then use
433@samp{\\@{@dots{}@}} to display the rest of the mode's keymap. 446@samp{\\@{@dots{}@}} to display the rest of the mode's keymap.
434
435@item
436Don't use the term ``Elisp'', since that is or was a trademark.
437Use the term ``Emacs Lisp''.
438@end itemize 447@end itemize
439 448
440@node Comment Tips 449@node Comment Tips
diff --git a/lispref/variables.texi b/lispref/variables.texi
index fb08a390c6d..34cd07b6769 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -231,6 +231,12 @@ Macro calls (@pxref{Macros}).
231@code{condition-case} (@pxref{Errors}). 231@code{condition-case} (@pxref{Errors}).
232@end itemize 232@end itemize
233 233
234 Variables can also have buffer-local bindings (@pxref{Buffer-Local
235Variables}); a few variables have terminal-local bindings
236(@pxref{Multiple Displays}). These kinds of bindings work somewhat like
237ordinary local bindings, but they are localized depending on ``where''
238you are in Emacs, rather than localized in time.
239
234@defvar max-specpdl-size 240@defvar max-specpdl-size
235@cindex variable limit error 241@cindex variable limit error
236@cindex evaluation error 242@cindex evaluation error
@@ -409,6 +415,12 @@ is not even evaluated, and @var{symbol}'s value remains unchanged. If
409evaluates it and sets @var{symbol} to the result. (If @var{value} is 415evaluates it and sets @var{symbol} to the result. (If @var{value} is
410omitted, the value of @var{symbol} is not changed in any case.) 416omitted, the value of @var{symbol} is not changed in any case.)
411 417
418When you evaluate a top-level @code{defvar} form with @kbd{C-M-x} in
419Emacs Lisp mode (@code{eval-defun}), a special feature of
420@code{eval-defun} evaluates it as a @code{defconst}. The purpose of
421this is to make sure the variable's value is reinitialized, when you ask
422for it specifically.
423
412If @var{symbol} has a buffer-local binding in the current buffer, 424If @var{symbol} has a buffer-local binding in the current buffer,
413@code{defvar} sets the default value, not the local value. 425@code{defvar} sets the default value, not the local value.
414@xref{Buffer-Local Variables}. 426@xref{Buffer-Local Variables}.
@@ -532,9 +544,9 @@ then the variable is a user option.
532@end defun 544@end defun
533 545
534 If a user option variable has a @code{variable-interactive} property, 546 If a user option variable has a @code{variable-interactive} property,
535@code{set-variable} uses that value to control reading the new value for 547the @code{set-variable} command uses that value to control reading the
536the variable. The property's value is used as if it were the argument 548new value for the variable. The property's value is used as if it were
537to @code{interactive}. 549the argument to @code{interactive}.
538 550
539 @strong{Warning:} If the @code{defconst} and @code{defvar} special 551 @strong{Warning:} If the @code{defconst} and @code{defvar} special
540forms are used while the variable has a local binding, they set the 552forms are used while the variable has a local binding, they set the
@@ -714,7 +726,12 @@ an element to a list if it is not already present in the list.
714@defun add-to-list symbol element 726@defun add-to-list symbol element
715This function sets the variable @var{symbol} by consing @var{element} 727This function sets the variable @var{symbol} by consing @var{element}
716onto the old value, if @var{element} is not already a member of that 728onto the old value, if @var{element} is not already a member of that
717value. The value of @var{symbol} had better be a list already. 729value. It returns the resulting list, whether updated or not. The
730value of @var{symbol} had better be a list already before the call.
731
732The argument @var{symbol} is not implicitly quoted; @code{add-to-list}
733is an ordinary function, like @code{set} and unlike @code{setq}. Quote
734the argument yourself if that is what you want.
718 735
719Here's a scenario showing how to use @code{add-to-list}: 736Here's a scenario showing how to use @code{add-to-list}:
720 737
@@ -944,6 +961,12 @@ Then you can bind the variable in other programs, knowing reliably what
944the effect will be. 961the effect will be.
945@end itemize 962@end itemize
946 963
964 In either case, you should define the variable with @code{defvar}.
965This helps other people understand your program by telling them to look
966for inter-function usage. It also avoids a warning from the byte
967compiler. Choose the variable's name to avoid name conflicts---don't
968use short names like @code{x}.
969
947@node Buffer-Local Variables 970@node Buffer-Local Variables
948@section Buffer-Local Variables 971@section Buffer-Local Variables
949@cindex variables, buffer-local 972@cindex variables, buffer-local
@@ -1027,7 +1050,7 @@ example of what to avoid:
1027(setq foo 'a) 1050(setq foo 'a)
1028(let ((foo 'temp)) 1051(let ((foo 'temp))
1029 (set-buffer "b") 1052 (set-buffer "b")
1030 @dots{}) 1053 @var{body}@dots{})
1031@group 1054@group
1032foo @result{} 'a ; @r{The old buffer-local value from buffer @samp{a}} 1055foo @result{} 'a ; @r{The old buffer-local value from buffer @samp{a}}
1033 ; @r{is now the default value.} 1056 ; @r{is now the default value.}
@@ -1107,6 +1130,10 @@ variable does not work. This is because @code{let} does not distinguish
1107between different kinds of bindings; it knows only which variable the 1130between different kinds of bindings; it knows only which variable the
1108binding was made for. 1131binding was made for.
1109 1132
1133If the variable is terminal-local, this function signals an error. Such
1134variables cannot have buffer-local bindings as well. @xref{Multiple
1135Displays}.
1136
1110@strong{Note:} do not use @code{make-local-variable} for a hook 1137@strong{Note:} do not use @code{make-local-variable} for a hook
1111variable. Instead, use @code{make-local-hook}. @xref{Hooks}. 1138variable. Instead, use @code{make-local-hook}. @xref{Hooks}.
1112@end deffn 1139@end deffn
@@ -1119,6 +1146,12 @@ local to the current buffer at the time.
1119The value returned is @var{variable}. 1146The value returned is @var{variable}.
1120@end deffn 1147@end deffn
1121 1148
1149@defun local-variable-p variable &optional buffer
1150This returns @code{t} if @var{variable} is buffer-local in buffer
1151@var{buffer} (which defaults to the current buffer); otherwise,
1152@code{nil}.
1153@end defun
1154
1122@defun buffer-local-variables &optional buffer 1155@defun buffer-local-variables &optional buffer
1123This function returns a list describing the buffer-local variables in 1156This function returns a list describing the buffer-local variables in
1124buffer @var{buffer}. It returns an association list (@pxref{Association 1157buffer @var{buffer}. It returns an association list (@pxref{Association
@@ -1153,12 +1186,6 @@ Note that storing new values into the @sc{cdr}s of cons cells in this
1153list does @emph{not} change the local values of the variables. 1186list does @emph{not} change the local values of the variables.
1154@end defun 1187@end defun
1155 1188
1156@defun local-variable-p variable
1157This returns @code{t} if @var{variable} is buffer-local in the current
1158buffer. It is much faster to get the answer this way than to examine
1159the value of @code{buffer-local-variables}.
1160@end defun
1161
1162@deffn Command kill-local-variable variable 1189@deffn Command kill-local-variable variable
1163This function deletes the buffer-local binding (if any) for 1190This function deletes the buffer-local binding (if any) for
1164@var{variable} (a symbol) in the current buffer. As a result, the 1191@var{variable} (a symbol) in the current buffer. As a result, the
diff --git a/lispref/windows.texi b/lispref/windows.texi
index b1dcd2d6e0e..35202827e18 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -36,25 +36,29 @@ displayed in windows.
36@cindex window 36@cindex window
37@cindex selected window 37@cindex selected window
38 38
39 A @dfn{window} is the physical area of the screen in which a buffer is 39 A @dfn{window} in Emacs is the physical area of the screen in which a
40displayed. The term is also used to refer to a Lisp object that 40buffer is displayed. The term is also used to refer to a Lisp object that
41represents that screen area in Emacs Lisp. It should be 41represents that screen area in Emacs Lisp. It should be
42clear from the context which is meant. 42clear from the context which is meant.
43 43
44 There is always at least one window in any frame. In each frame, at 44 Emacs groups windows into frames. A frame represents an area of
45any time, one and only one window is designated as @dfn{selected within 45screen available for Emacs to use. Each frame always contains at least
46the frame}. The frame's cursor appears in that window. There is also 46one window, but you can subdivide it vertically or horizontally into
47one selected frame; and the window selected within that frame is 47multiple nonoverlapping Emacs windows.
48@dfn{the selected window}. The selected window's buffer is usually the 48
49current buffer (except when @code{set-buffer} has been used). 49 In each frame, at any time, one and only one window is designated as
50@xref{Current Buffer}. 50@dfn{selected within the frame}. The frame's cursor appears in that
51 51window. At ant time, one frame is the selected frame; and the window
52 For practical purposes, a window exists only while it is displayed on the 52selected within that frame is @dfn{the selected window}. The selected
53terminal. Once removed from the display, the window is effectively 53window's buffer is usually the current buffer (except when
54deleted and should not be used, @emph{even though there may still be 54@code{set-buffer} has been used). @xref{Current Buffer}.
55references to it} from other Lisp objects. Restoring a saved window 55
56configuration is the only way for a window no longer on the screen to 56 For practical purposes, a window exists only while it is displayed in
57come back to life. (@xref{Deleting Windows}.) 57a frame. Once removed from the frame, the window is effectively deleted
58and should not be used, @emph{even though there may still be references
59to it} from other Lisp objects. Restoring a saved window configuration
60is the only way for a window no longer on the screen to come back to
61life. (@xref{Deleting Windows}.)
58 62
59 Each window has the following attributes: 63 Each window has the following attributes:
60 64
@@ -93,17 +97,16 @@ how recently the window was selected
93@cindex multiple windows 97@cindex multiple windows
94 Users create multiple windows so they can look at several buffers at 98 Users create multiple windows so they can look at several buffers at
95once. Lisp libraries use multiple windows for a variety of reasons, but 99once. Lisp libraries use multiple windows for a variety of reasons, but
96most often to give different views of the same information. In Rmail, 100most often to display related information. In Rmail, for example, you
97for example, you can move through a summary buffer in one window while 101can move through a summary buffer in one window while the other window
98the other window shows messages one at a time as they are reached. 102shows messages one at a time as they are reached.
99 103
100 The meaning of ``window'' in Emacs is similar to what it means in the 104 The meaning of ``window'' in Emacs is similar to what it means in the
101context of general-purpose window systems such as X, but not identical. 105context of general-purpose window systems such as X, but not identical.
102The X Window System subdivides the screen into X windows; Emacs uses one 106The X Window System places X windows on the screen; Emacs uses one or
103or more X windows, called @dfn{frames} in Emacs terminology, and 107more X windows as frames, and subdivides them into
104subdivides each of them into (nonoverlapping) Emacs windows. When you 108Emacs windows. When you use Emacs on a character-only terminal, Emacs
105use Emacs on an ordinary display terminal, Emacs subdivides the terminal 109treats the whole terminal screen as one frame.
106screen into Emacs windows.
107 110
108@cindex terminal screen 111@cindex terminal screen
109@cindex screen of terminal 112@cindex screen of terminal
@@ -300,6 +303,9 @@ Count all windows in all existing frames.
300@item @code{visible} 303@item @code{visible}
301Count all windows in all visible frames. 304Count all windows in all visible frames.
302 305
306@item 0
307Count all windows in all visible or iconified frames.
308
303@item anything else 309@item anything else
304Count precisely the windows in the selected frame, and no others. 310Count precisely the windows in the selected frame, and no others.
305@end table 311@end table
@@ -370,6 +376,8 @@ If it is @code{nil}, operate on the selected frame.
370If it is @code{t}, operate on all frames. 376If it is @code{t}, operate on all frames.
371@item 377@item
372If it is @code{visible}, operate on all visible frames. 378If it is @code{visible}, operate on all visible frames.
379@item 0
380If it is 0, operate on all visible or iconified frames.
373@item 381@item
374If it is a frame, operate on that frame. 382If it is a frame, operate on that frame.
375@end itemize 383@end itemize
@@ -405,6 +413,14 @@ The return value is @var{window}.
405@end example 413@end example
406@end defun 414@end defun
407 415
416@defmac save-selected-window forms@dots{}
417This macro records the selected window, executes @var{forms}
418in sequence, then restores the earlier selected window.
419It does not save or restore anything about the sizes, arrangement
420or contents of windows; therefore, if the @var{forms} change them,
421the changes are permanent.
422@end defmac
423
408@cindex finding windows 424@cindex finding windows
409 The following functions choose one of the windows on the screen, 425 The following functions choose one of the windows on the screen,
410offering various criteria for the choice. 426offering various criteria for the choice.
@@ -427,6 +443,8 @@ If it is @code{t}, consider windows on all frames.
427@item 443@item
428If it is @code{visible}, consider windows on all visible frames. 444If it is @code{visible}, consider windows on all visible frames.
429@item 445@item
446If it is 0, consider windows on all visible or iconified frames.
447@item
430If it is a frame, consider windows on that frame. 448If it is a frame, consider windows on that frame.
431@end itemize 449@end itemize
432@end defun 450@end defun
@@ -503,6 +521,9 @@ Consider all windows in all existing frames.
503Consider all windows in all visible frames. (To get useful results, you 521Consider all windows in all visible frames. (To get useful results, you
504must ensure @var{window} is in a visible frame.) 522must ensure @var{window} is in a visible frame.)
505 523
524@item @code{t}
525Consider all windows in all visible or iconified frames.
526
506@item anything else 527@item anything else
507Consider precisely the windows in @var{window}'s frame, and no others. 528Consider precisely the windows in @var{window}'s frame, and no others.
508@end table 529@end table
@@ -611,20 +632,12 @@ If it is @code{t}, consider windows on all frames.
611@item 632@item
612If it is @code{visible}, consider windows on all visible frames. 633If it is @code{visible}, consider windows on all visible frames.
613@item 634@item
635If it is 0, consider windows on all visible or iconified frames.
636@item
614If it is a frame, consider windows on that frame. 637If it is a frame, consider windows on that frame.
615@end itemize 638@end itemize
616@end defun 639@end defun
617 640
618@deffn Command replace-buffer-in-windows buffer
619This function replaces @var{buffer} with some other buffer in all
620windows displaying it. The other buffer used is chosen with
621@code{other-buffer}. In the usual applications of this function, you
622don't care which other buffer is used; you just want to make sure that
623@var{buffer} is no longer displayed.
624
625This function returns @code{nil}.
626@end deffn
627
628@node Displaying Buffers 641@node Displaying Buffers
629@section Displaying Buffers in Windows 642@section Displaying Buffers in Windows
630@cindex switching to a buffer 643@cindex switching to a buffer
@@ -716,12 +729,25 @@ already displayed in the selected window and @var{other-window} is
716@code{nil}, then the selected window is considered sufficient display 729@code{nil}, then the selected window is considered sufficient display
717for @var{buffer-or-name}, so that nothing needs to be done. 730for @var{buffer-or-name}, so that nothing needs to be done.
718 731
732All the variables that affect @code{display-buffer} affect
733@code{pop-to-buffer} as well. @xref{Choosing Window}.
734
719If @var{buffer-or-name} is a string that does not name an existing 735If @var{buffer-or-name} is a string that does not name an existing
720buffer, a buffer by that name is created. The major mode for the new 736buffer, a buffer by that name is created. The major mode for the new
721buffer is set according to the variable @code{default-major-mode}. 737buffer is set according to the variable @code{default-major-mode}.
722@xref{Auto Major Mode}. 738@xref{Auto Major Mode}.
723@end defun 739@end defun
724 740
741@deffn Command replace-buffer-in-windows buffer
742This function replaces @var{buffer} with some other buffer in all
743windows displaying it. The other buffer used is chosen with
744@code{other-buffer}. In the usual applications of this function, you
745don't care which other buffer is used; you just want to make sure that
746@var{buffer} is no longer displayed.
747
748This function returns @code{nil}.
749@end deffn
750
725@node Choosing Window 751@node Choosing Window
726@section Choosing a Window for Display 752@section Choosing a Window for Display
727 753
@@ -804,6 +830,13 @@ If the buffer's name is in this list, @code{display-buffer} handles the
804buffer specially. 830buffer specially.
805 831
806By default, special display means to give the buffer a dedicated frame. 832By default, special display means to give the buffer a dedicated frame.
833
834If an element is a list, instead of a string, then the @sc{car} of the
835list is the buffer name, and the rest of the list says how to create the
836frame. There are two possibilities for the rest of the list. It can be
837an alist, specifying frame parameters, or it can contain a function and
838arguments to give to it. (The function's first argument is always the
839buffer to be displayed; the arguments from the list come after that.)
807@end defvar 840@end defvar
808 841
809@defvar special-display-regexps 842@defvar special-display-regexps
@@ -813,6 +846,10 @@ expressions in this list, @code{display-buffer} handles the buffer
813specially. 846specially.
814 847
815By default, special display means to give the buffer a dedicated frame. 848By default, special display means to give the buffer a dedicated frame.
849
850If an element is a list, instead of a string, then the @sc{car} of the
851list is the regular expression, and the rest of the list says how to
852create the frame. See above, under @code{special-display-buffer-names}.
816@end defvar 853@end defvar
817 854
818@defvar special-display-function 855@defvar special-display-function
@@ -841,6 +878,20 @@ This variable holds frame parameters for
841@code{special-display-popup-frame} to use when it creates a frame. 878@code{special-display-popup-frame} to use when it creates a frame.
842@end defopt 879@end defopt
843 880
881@defvar same-window-buffer-names
882A list of buffer names for buffers that should be displayed in the
883selected window. If the buffer's name is in this list,
884@code{display-buffer} handles the buffer by switching to it in the
885selected window.
886@end defvar
887
888@defvar same-window-regexps
889A list of regular expressions that specify buffers that should be
890displayed in the selected window. If the buffer's name matches any of
891the regular expressions in this list, @code{display-buffer} handles the
892buffer by switching to it in the selected window.
893@end defvar
894
844@c Emacs 19 feature 895@c Emacs 19 feature
845@defvar display-buffer-function 896@defvar display-buffer-function
846This variable is the most flexible way to customize the behavior of 897This variable is the most flexible way to customize the behavior of
@@ -1125,10 +1176,6 @@ This function scrolls the text in another window upward @var{count}
1125lines. Negative values of @var{count}, or @code{nil}, are handled 1176lines. Negative values of @var{count}, or @code{nil}, are handled
1126as in @code{scroll-up}. 1177as in @code{scroll-up}.
1127 1178
1128The window that is scrolled is normally the one following the selected
1129window in the cyclic ordering of windows---the window that
1130@code{next-window} would return. @xref{Cyclic Window Ordering}.
1131
1132You can specify a buffer to scroll with the variable 1179You can specify a buffer to scroll with the variable
1133@code{other-window-scroll-buffer}. When the selected window is the 1180@code{other-window-scroll-buffer}. When the selected window is the
1134minibuffer, the next window is normally the one at the top left corner. 1181minibuffer, the next window is normally the one at the top left corner.
@@ -1539,6 +1586,11 @@ comparing the old size data with the new.
1539Creating or deleting windows counts as a size change, and therefore 1586Creating or deleting windows counts as a size change, and therefore
1540causes these functions to be called. Changing the frame size also 1587causes these functions to be called. Changing the frame size also
1541counts, because it changes the sizes of the existing windows. 1588counts, because it changes the sizes of the existing windows.
1589
1590It is not a good idea to use @code{save-window-excursion} in these
1591functions, because that always counts as a size change, and it would
1592cause these functions to be called over and over. In most cases,
1593@code{save-selected-window} is what you need here.
1542@end defvar 1594@end defvar
1543 1595
1544@node Coordinates and Windows 1596@node Coordinates and Windows
@@ -1627,6 +1679,11 @@ buffers to the state specified by @var{configuration}. The argument
1627@var{configuration} must be a value that was previously returned by 1679@var{configuration} must be a value that was previously returned by
1628@code{current-window-configuration}. 1680@code{current-window-configuration}.
1629 1681
1682This function always counts as a window size change and triggers
1683execution of the @code{window-size-change-functions}. (It doesn't know
1684how to tell whether the new configuration actually differs from the old
1685one.)
1686
1630Here is a way of using this function to get the same effect 1687Here is a way of using this function to get the same effect
1631as @code{save-window-excursion}: 1688as @code{save-window-excursion}:
1632 1689
@@ -1649,6 +1706,13 @@ that is visible. It also includes the choice of selected window.
1649However, it does not include the value of point in the current buffer; 1706However, it does not include the value of point in the current buffer;
1650use @code{save-excursion} if you wish to preserve that. 1707use @code{save-excursion} if you wish to preserve that.
1651 1708
1709Don't use this construct when @code{save-selected-window} is all you need.
1710
1711Exit from @code{save-window-excursion} always triggers execution of the
1712@code{window-size-change-functions}. (It doesn't know how to tell
1713whether the restored configuration actually differs from the one in
1714effect at the end of the @var{forms}.)
1715
1652The return value is the value of the final form in @var{forms}. 1716The return value is the value of the final form in @var{forms}.
1653For example: 1717For example:
1654 1718