diff options
Diffstat (limited to 'doc/lispref')
-rw-r--r-- | doc/lispref/ChangeLog | 113 | ||||
-rw-r--r-- | doc/lispref/Makefile.in | 5 | ||||
-rw-r--r-- | doc/lispref/commands.texi | 22 | ||||
-rw-r--r-- | doc/lispref/errors.texi | 5 | ||||
-rw-r--r-- | doc/lispref/files.texi | 16 | ||||
-rw-r--r-- | doc/lispref/frames.texi | 12 | ||||
-rw-r--r-- | doc/lispref/functions.texi | 6 | ||||
-rw-r--r-- | doc/lispref/internals.texi | 13 | ||||
-rw-r--r-- | doc/lispref/lists.texi | 71 | ||||
-rw-r--r-- | doc/lispref/minibuf.texi | 33 | ||||
-rw-r--r-- | doc/lispref/os.texi | 22 | ||||
-rw-r--r-- | doc/lispref/positions.texi | 16 | ||||
-rw-r--r-- | doc/lispref/sequences.texi | 143 | ||||
-rw-r--r-- | doc/lispref/windows.texi | 6 |
14 files changed, 351 insertions, 132 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 2b00d9743b7..93128962c33 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -6,7 +6,7 @@ * numbers.texi (Comparison of Numbers): Copyedits. -2014-06-06 Glenn Morris <rgm@gnu.org> +2014-06-08 Glenn Morris <rgm@gnu.org> * display.texi (Window Systems): Remove window-setup-hook. * os.texi (Startup Summary, Init File): @@ -16,11 +16,14 @@ * display.texi (Overlay Properties): Update re priority. (Bug#17234) -2014-06-05 Glenn Morris <rgm@gnu.org> - * package.texi (Package Archives): Mention signing packages. -2014-05-27 Glenn Morris <rgm@gnu.org> +2014-06-07 Eli Zaretskii <eliz@gnu.org> + + * commands.texi (Click Events): Update contents of click event's + position list due to last changes in make_lispy_position. + +2014-06-02 Glenn Morris <rgm@gnu.org> * text.texi (Buffer Contents): Update for filter-buffer-substring changes. @@ -28,53 +31,117 @@ * abbrevs.texi (Abbrev Expansion): Update for expand-abbrev changes. * functions.texi (Advising Functions): Standardize menu case. -2014-05-17 Eli Zaretskii <eliz@gnu.org> +2014-05-26 Eli Zaretskii <eliz@gnu.org> * display.texi (Invisible Text): Clarify the description of line-move-ignore-invisible. (Bug#17511) -2014-05-07 Paul Eggert <eggert@cs.ucla.edu> +2014-05-22 Leo Liu <sdl.web@gmail.com> + + * sequences.texi (Sequence Functions): Don't mention when and how + SEQ to nreverse is mutated. + +2014-05-21 Leo Liu <sdl.web@gmail.com> + + * sequences.texi (Sequence Functions): Update nreverse. + +2014-05-19 Paul Eggert <eggert@cs.ucla.edu> + + Allow any non-nil value to count as true in bool-vector. + * sequences.texi (Bool-Vectors): Coalesce discussion of how to + print them. bool-vector's args need not be t or nil. + +2014-05-19 Dmitry Antipov <dmantipov@yandex.ru> + + * sequences.texi (Bool-vectors): Mention bool-vector. + +2014-05-17 Paul Eggert <eggert@cs.ucla.edu> + + Assume C99 or later (Bug#17487). + * internals.texi (C Dialect): Document this. + +2014-05-15 Dmitry Antipov <dmantipov@yandex.ru> + + * lists.texi (Building Cons Cells and Lists): Remove + description of `reverse' and `'nreverse' to generalize them... + * sequences.texi (Sequences): ...for sequences here. + +2014-05-14 Glenn Morris <rgm@gnu.org> + + * files.texi (Changing Files): Mention with-file-modes. + +2014-05-08 Paul Eggert <eggert@cs.ucla.edu> * internals.texi (C Dialect): New section. (C Integer Types): Mention bool_bf. -2014-04-29 Stefan Monnier <monnier@iro.umontreal.ca> +2014-04-30 Stefan Monnier <monnier@iro.umontreal.ca> * processes.texi (Filter Functions, Sentinels): Advertise add-function. -2014-04-24 Eli Zaretskii <eliz@gnu.org> +2014-04-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * windows.texi (Window Configurations, Window Configurations): + Window configs don't store marks any more. + +2014-04-25 Eli Zaretskii <eliz@gnu.org> * strings.texi (Text Comparison): Mention equal-including-properties for when text properties of the strings matter for comparison. -2014-04-21 Eli Zaretskii <eliz@gnu.org> +2014-04-22 Eli Zaretskii <eliz@gnu.org> * text.texi (Registers): Document register-read-with-preview. * internals.texi (Building Emacs): Improve indexing. -2014-04-15 Stefan Monnier <monnier@iro.umontreal.ca> +2014-04-17 Daniel Colascione <dancol@dancol.org> - * display.texi (Overlay Properties): Reword the doc of `priority'. - (Finding Overlays): Document new arg of `overlays-at'. + * frames.texi (Terminal Parameters): Document new + tty-mode-set-strings and tty-mode-reset-strings terminal + parameters. -2014-04-05 Glenn Morris <rgm@gnu.org> +2014-04-17 Paul Eggert <eggert@cs.ucla.edu> - * os.texi (Recording Input): Dribble files may contain passwords. + * Makefile.in (infoclean): Be consistent about reporting failures. + +2014-04-09 Daniel Colascione <dancol@dancol.org> -2014-04-04 Glenn Morris <rgm@gnu.org> + * errors.texi (Standard Errors): Document required error + parameters for `scan-error'. + + * positions.texi (List Motion): Explain new `up-list' arguments. + Mention `backward-up-list'. + +2014-04-08 Daniel Colascione <dancol@dancol.org> + + * minibuf.texi (Programmed Completion): Improve phrasing, remove + incorrect bullet count. + +2014-04-07 Glenn Morris <rgm@gnu.org> + + * os.texi (Recording Input): Dribble files may contain passwords. * backups.texi (Making Backups, Reverting): Update for default values of some -function vars no longer being nil. (Reverting): Update for buffer-stale-function also applying to file-buffers. -2014-03-25 Eli Zaretskii <eliz@gnu.org> +2014-03-31 Daniel Colascione <dancol@dancol.org> + + * minibuf.texi (Completion in Buffers): Discuss using lazy + completion tables for inline completion. + +2014-03-28 Glenn Morris <rgm@gnu.org> + + * os.texi (Terminal-Specific): Mention term-file-aliases. + +2014-03-26 Eli Zaretskii <eliz@gnu.org> * files.texi (Kinds of Files): Improve documentation of file-symlink-p. (Bug#17073) Add cross-references. -2014-03-24 Barry O'Reilly <gundaetiapo@gmail.com> +2014-03-26 Barry O'Reilly <gundaetiapo@gmail.com> * markers.texi (Moving Marker Positions): The 2014-03-02 doc change mentioning undo's inability to handle relocated markers no @@ -82,8 +149,18 @@ * text.texi (Undo): Expand documentation of (TEXT . POS) and (MARKER . ADJUSTMENT) undo elements. +2014-03-26 Glenn Morris <rgm@gnu.org> + + * files.texi (File Locks): All systems support locking. + 2014-03-22 Glenn Morris <rgm@gnu.org> + * commands.texi (Defining Commands): + Mention that interactive-only also affects describe-function. + + * functions.texi (Declare Form): Add interactive-only. + * commands.texi (Defining Commands) Mention declare. + * commands.texi (Defining Commands): List interactive-only values. 2014-03-22 Eli Zaretskii <eliz@gnu.org> @@ -91,7 +168,7 @@ * functions.texi (Core Advising Primitives): Fix cross-reference in last change. -2014-03-21 Stefan Monnier <monnier@iro.umontreal.ca> +2014-03-22 Stefan Monnier <monnier@iro.umontreal.ca> * functions.texi (Advising Functions): Explain a bit more how arguments work. diff --git a/doc/lispref/Makefile.in b/doc/lispref/Makefile.in index bb8d4f82884..e7bfedfa583 100644 --- a/doc/lispref/Makefile.in +++ b/doc/lispref/Makefile.in @@ -171,7 +171,10 @@ distclean: clean rm -f Makefile infoclean: - -cd $(buildinfodir) && rm -f elisp$(INFO_EXT) elisp$(INFO_EXT)-[1-9] elisp$(INFO_EXT)-[1-9][0-9] + rm -f \ + $(buildinfodir)/elisp$(INFO_EXT) \ + $(buildinfodir)/elisp$(INFO_EXT)-[1-9] \ + $(buildinfodir)/elisp$(INFO_EXT)-[1-9][0-9] maintainer-clean: distclean infoclean diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 38a6970e6f4..ad1bf80a85c 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -122,16 +122,19 @@ function symbol's @code{interactive-form} property. A non-@code{nil} value for this property takes precedence over any @code{interactive} form in the function body itself. This feature is seldom used. +@anchor{The interactive-only property} @cindex @code{interactive-only} property Sometimes, a function is only intended to be called interactively, never directly from Lisp. In that case, give the function a -non-@code{nil} @code{interactive-only} property. This causes the -byte compiler to warn if the command is called from Lisp. The value -of the property can be: a string, which the byte-compiler will -use directly in its warning (it should end with a period, -and not start with a capital, e.g. ``use @dots{} instead.''); @code{t}; -any other symbol, which should be an alternative function to use in -Lisp code. +non-@code{nil} @code{interactive-only} property, either directly +or via @code{declare} (@pxref{Declare Form}). This causes the +byte compiler to warn if the command is called from Lisp. The output +of @code{describe-function} will include similar information. +The value of the property can be: a string, which the byte-compiler +will use directly in its warning (it should end with a period, and not +start with a capital, e.g. ``use @dots{} instead.''); @code{t}; any +other symbol, which should be an alternative function to use in Lisp +code. @menu * Using Interactive:: General rules for @code{interactive}. @@ -1393,8 +1396,9 @@ The position in the string where the click occurred. @item @var{text-pos} For clicks on a marginal area or on a fringe, this is the buffer position of the first visible character in the corresponding line in -the window. For other events, it is the current buffer position in -the window. +the window. For clicks on the mode line or the header line, this is +@code{nil}. For other events, it is the buffer position closest to +the click. @item @var{col}, @var{row} These are the actual column and row coordinate numbers of the glyph diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index e00496e3478..dba8d219774 100644 --- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi @@ -157,7 +157,10 @@ The message is @samp{Attempt to modify a protected file}. @item scan-error The message is @samp{Scan error}. This happens when certain syntax-parsing functions find invalid syntax or mismatched -parentheses. @xref{List Motion}, and @xref{Parsing Expressions}. +parentheses. Conventionally raised with three argument: a +human-readable error message, the start of the obstacle that cannot be +moved over, and the end of the obstacle. @xref{List Motion}, and +@xref{Parsing Expressions}. @item search-failed The message is @samp{Search failed}. @xref{Searching and Matching}. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index b071c6a8f35..ac77b94d8f6 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -714,15 +714,15 @@ some other job. This function locks the file @var{filename}, if the current buffer is modified. The argument @var{filename} defaults to the current buffer's visited file. Nothing is done if the current buffer is not visiting a -file, or is not modified, or if the system does not support locking. +file, or is not modified, or if the option @code{create-lockfiles} is +@code{nil}. @end defun @defun unlock-buffer This function unlocks the file being visited in the current buffer, if the buffer is modified. If the buffer is not modified, then the file should not be locked, so this function does nothing. It also -does nothing if the current buffer is not visiting a file, or if the -system does not support locking. +does nothing if the current buffer is not visiting a file, or is not locked. @end defun @defopt create-lockfiles @@ -1693,6 +1693,16 @@ version of an existing file; saving a file preserves its existing permissions. @end defun +@defmac with-file-modes mode body@dots{} +This macro evaluates the @var{body} forms with the default +permissions for new files temporarily set to @var{modes} (whose value +is as for @code{set-file-modes} above). When finished, it restores +the original default file permissions, and returns the value of the +last form in @var{body}. + +This is useful for creating private files, for example. +@end defmac + @defun default-file-modes This function returns the default file permissions, as an integer. @end defun diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index b6513426909..b95a5ccdb92 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1334,6 +1334,18 @@ terminal. @xref{DEL Does Not Delete,,, emacs, The Emacs Manual}. @item terminal-initted After the terminal is initialized, this is set to the terminal-specific initialization function. +@item tty-mode-set-strings +When present, a list of strings containing escape sequences that Emacs +will output while configuring a tty for rendering. Emacs emits these +strings only when configuring a terminal: if you want to enable a mode +on a terminal that is already active (for example, while in +@code{tty-setup-hook}), explicitly output the necessary escape +sequence using @code{send-string-to-terminal} in addition to adding +the sequence to @code{tty-mode-set-strings}. +@item tty-mode-reset-strings +When present, a list of strings that undo the effects of the strings +in @code{tty-mode-set-strings}. Emacs emits these strings when +exiting, deleting a terminal, or suspending itself. @end table @node Frame Titles diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 019c75ba021..91fdcc63cbe 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -1209,7 +1209,7 @@ ways to do it. The added function is also called an @emph{advice}. @menu * Core Advising Primitives:: Primitives to manipulate advice. * Advising Named Functions:: Advising named functions. -* Advice combinators:: Ways to compose advices. +* Advice combinators:: Ways to compose advice. * Porting old advices:: Adapting code using the old defadvice. @end menu @@ -1743,6 +1743,10 @@ Indent calls to this function or macro according to @var{indent-spec}. This is typically used for macros, though it works for functions too. @xref{Indenting Macros}. +@item (interactive-only @var{value}) +Set the function's @code{interactive-only} property to @var{value}. +@xref{The interactive-only property}. + @item (obsolete @var{current-name} @var{when}) Mark the function or macro as obsolete, similar to a call to @code{make-obsolete} (@pxref{Obsolete Functions}). @var{current-name} diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index bfc9d491c5e..3a5bd4aea7e 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -580,15 +580,14 @@ Emacs session. @section C Dialect @cindex C programming language -The C part of Emacs is portable to C89: C99-specific features such as -@samp{<stdbool.h>} and @samp{inline} are not used without a check, +The C part of Emacs is portable to C99 or later: C11-specific features such +as @samp{<stdalign.h>} and @samp{_Noreturn} are not used without a check, typically at configuration time, and the Emacs build procedure -provides a substitute implementation if necessary. Some C99 features, -such as declarations after statements, are too difficult to provide -substitutes for, so they are avoided entirely. +provides a substitute implementation if necessary. Some C11 features, +such as anonymous structures and unions, are too difficult to emulate, +so they are avoided entirely. -At some point in the not-too-distant future the base C dialect will -change from C89 to C99, and eventually it will no doubt change to C11. +At some point in the future the base C dialect will no doubt change to C11. @node Writing Emacs Primitives @section Writing Emacs Primitives diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index cde7d9ce44c..f724d5bd902 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -601,25 +601,6 @@ not a list, the sequence's elements do not become elements of the resulting list. Instead, the sequence becomes the final @sc{cdr}, like any other non-list final argument. -@defun reverse list -This function creates a new list whose elements are the elements of -@var{list}, but in reverse order. The original argument @var{list} is -@emph{not} altered. - -@example -@group -(setq x '(1 2 3 4)) - @result{} (1 2 3 4) -@end group -@group -(reverse x) - @result{} (4 3 2 1) -x - @result{} (1 2 3 4) -@end group -@end example -@end defun - @defun copy-tree tree &optional vecp This function returns a copy of the tree @code{tree}. If @var{tree} is a cons cell, this makes a new cons cell with the same @sc{car} and @@ -1143,58 +1124,6 @@ each time you run it! Here is what happens: @end smallexample @end defun -@defun nreverse list -@cindex reversing a list - This function reverses the order of the elements of @var{list}. -Unlike @code{reverse}, @code{nreverse} alters its argument by reversing -the @sc{cdr}s in the cons cells forming the list. The cons cell that -used to be the last one in @var{list} becomes the first cons cell of the -value. - - For example: - -@example -@group -(setq x '(a b c)) - @result{} (a b c) -@end group -@group -x - @result{} (a b c) -(nreverse x) - @result{} (c b a) -@end group -@group -;; @r{The cons cell that was first is now last.} -x - @result{} (a) -@end group -@end example - - To avoid confusion, we usually store the result of @code{nreverse} -back in the same variable which held the original list: - -@example -(setq x (nreverse x)) -@end example - - Here is the @code{nreverse} of our favorite example, @code{(a b c)}, -presented graphically: - -@smallexample -@group -@r{Original list head:} @r{Reversed list:} - ------------- ------------- ------------ -| car | cdr | | car | cdr | | car | cdr | -| a | nil |<-- | b | o |<-- | c | o | -| | | | | | | | | | | | | - ------------- | --------- | - | -------- | - - | | | | - ------------- ------------ -@end group -@end smallexample -@end defun - @defun sort list predicate @cindex stable sort @cindex sorting lists diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 5b4e29c57a3..19f941ba68d 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1734,7 +1734,7 @@ possible match, and ignore the match if the predicate returns @item A flag specifying the type of completion operation to perform. This -is one of the following four values: +flag may be one of the following values. @table @code @item nil @@ -1873,11 +1873,34 @@ next function in @code{completion-at-point-functions} instead of reporting a completion failure. @end table +Supplying a function for @var{collection} is strongly recommended if +generating the list of completions is an expensive operation. Emacs +may internally call functions in @code{completion-at-point-functions} +many times, but care about the value of @var{collection} for only some +of these calls. By supplying a function for @var{collection}, Emacs +can defer generating completions until necessary. You can use +@var{completion-table-dynamic} to create a wrapper function: + +@smallexample +;; Avoid this pattern. +(let ((beg ...) (end ...) (my-completions (my-make-completions))) + (list beg end my-completions)) + +;; Use this instead. +(let ((beg ...) (end ...)) + (list beg + end + (completion-table-dynamic + (lambda (_) + (my-make-completions))))) +@end smallexample + A function in @code{completion-at-point-functions} may also return a -function. In that case, that returned function is called, with no -argument, and it is entirely responsible for performing the -completion. We discourage this usage; it is intended to help convert -old code to using @code{completion-at-point}. +function instead of a list as described above. In that case, that +returned function is called, with no argument, and it is entirely +responsible for performing the completion. We discourage this usage; +it is intended to help convert old code to using +@code{completion-at-point}. The first function in @code{completion-at-point-functions} to return a non-@code{nil} value is used by @code{completion-at-point}. The diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 3b63e08676c..5cfbb9ff2ef 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -443,10 +443,13 @@ This variable holds the name of the @file{.emacs.d} directory. It is run on that type of terminal. The library's name is constructed by concatenating the value of the variable @code{term-file-prefix} and the terminal type (specified by the environment variable @env{TERM}). -Normally, @code{term-file-prefix} has the value -@code{"term/"}; changing this is not recommended. Emacs finds the file -in the normal manner, by searching the @code{load-path} directories, and -trying the @samp{.elc} and @samp{.el} suffixes. +Normally, @code{term-file-prefix} has the value @code{"term/"}; +changing this is not recommended. If there is an entry matching +@env{TERM} in the @code{term-file-aliases} association list, +Emacs uses the associated value in place of @env{TERM}. +Emacs finds the file in the normal manner, by searching the +@code{load-path} directories, and trying the @samp{.elc} and +@samp{.el} suffixes. @cindex Termcap The usual role of a terminal-specific library is to enable special @@ -475,7 +478,7 @@ a normal hook that Emacs runs after initializing a new text terminal. You could use this hook to define initializations for terminals that do not have their own libraries. @xref{Hooks}. -@defvar term-file-prefix +@defopt term-file-prefix @cindex @env{TERM} environment variable If the value of this variable is non-@code{nil}, Emacs loads a terminal-specific initialization file as follows: @@ -490,7 +493,14 @@ init file if you do not wish to load the terminal-initialization file. On MS-DOS, Emacs sets the @env{TERM} environment variable to @samp{internal}. -@end defvar +@end defopt + +@defopt term-file-aliases +This variable is an an association list mapping terminal types to +their aliases. For example, an element of the form @code{("vt102" +. "vt100")} means to treat a terminal of type @samp{vt102} like one of +type @samp{vt100}. +@end defopt @defvar tty-setup-hook This variable is a normal hook that Emacs runs after initializing a diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index f83173e2038..5a77b37e7e1 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -647,9 +647,19 @@ parentheses. (Other syntactic entities such as words or paired string quotes are ignored.) @end deffn -@deffn Command up-list &optional arg -This function moves forward out of @var{arg} (default 1) levels of parentheses. -A negative argument means move backward but still to a less deep spot. +@deffn Command up-list &optional arg escape-strings no-syntax-crossing +This function moves forward out of @var{arg} (default 1) levels of +parentheses. A negative argument means move backward but still to a +less deep spot. If @var{escape-strings} is non-nil (as it is +interactively), move out of enclosing strings as well. If +@var{no-syntax-crossing} is non-nil (as it is interactively), prefer +to break out of any enclosing string instead of moving to the start of +a list broken across multiple strings. On error, location of point is +unspecified. +@end deffn + +@deffn Command backward-up-list &optional arg escape-strings no-syntax-crossing +This function is just like @code{up-list}, but with a negated argument. @end deffn @deffn Command down-list &optional arg diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index b518bfc6b73..8f17862d427 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -217,6 +217,116 @@ y @result{} [foo (69 2)] @end example @end defun +@defun reverse seq +@cindex string reverse +@cindex list reverse +@cindex vector reverse +@cindex sequence reverse +This function creates a new sequence whose elements are the elements +of @var{seq}, but in reverse order. The original argument @var{seq} +is @emph{not} altered. Note that char-table cannot be reversed. + +@example +@group +(setq x '(1 2 3 4)) + @result{} (1 2 3 4) +@end group +@group +(reverse x) + @result{} (4 3 2 1) +x + @result{} (1 2 3 4) +@end group +@group +(setq x [1 2 3 4]) + @result{} [1 2 3 4] +@end group +@group +(reverse x) + @result{} [4 3 2 1] +x + @result{} [1 2 3 4] +@end group +@group +(setq x "xyzzy") + @result{} "xyzzy" +@end group +@group +(reverse x) + @result{} "yzzyx" +x + @result{} "xyzzy" +@end group +@end example +@end defun + +@defun nreverse seq +@cindex reversing a string +@cindex reversing a list +@cindex reversing a vector + This function reverses the order of the elements of @var{seq}. +Unlike @code{reverse} the original @var{seq} may be modified. + + For example: + +@example +@group +(setq x '(a b c)) + @result{} (a b c) +@end group +@group +x + @result{} (a b c) +(nreverse x) + @result{} (c b a) +@end group +@group +;; @r{The cons cell that was first is now last.} +x + @result{} (a) +@end group +@end example + + To avoid confusion, we usually store the result of @code{nreverse} +back in the same variable which held the original list: + +@example +(setq x (nreverse x)) +@end example + + Here is the @code{nreverse} of our favorite example, @code{(a b c)}, +presented graphically: + +@smallexample +@group +@r{Original list head:} @r{Reversed list:} + ------------- ------------- ------------ +| car | cdr | | car | cdr | | car | cdr | +| a | nil |<-- | b | o |<-- | c | o | +| | | | | | | | | | | | | + ------------- | --------- | - | -------- | - + | | | | + ------------- ------------ +@end group +@end smallexample + + For the vector, it is even simpler because you don't need setq: + +@example +(setq x [1 2 3 4]) + @result{} [1 2 3 4] +(nreverse x) + @result{} [4 3 2 1] +x + @result{} [4 3 2 1] +@end example + +Note that unlike @code{reverse}, this function doesn't work with strings. +Although you can alter string data by using @code{aset}, it is strongly +encouraged to treat strings as immutable. + +@end defun + @node Arrays @section Arrays @cindex array @@ -699,7 +809,7 @@ value into an element of the bool-vector, the effect is to store and the length cannot be changed once the bool-vector is created. Bool-vectors are constants when evaluated. - There are two special functions for working with bool-vectors; aside + Several functions work specifically with bool-vectors; aside from that, you manipulate them with same functions used for other kinds of arrays. @@ -708,6 +818,11 @@ Return a new bool-vector of @var{length} elements, each one initialized to @var{initial}. @end defun +@defun bool-vector &rest objects +This function creates and returns a bool-vector whose elements are the +arguments, @var{objects}. +@end defun + @defun bool-vector-p object This returns @code{t} if @var{object} is a bool-vector, and @code{nil} otherwise. @@ -761,9 +876,29 @@ or @code{nil}, and @var{i} is an index into @code{a}. Return the number of elements that are @code{t} in bool vector @var{a}. @end defun - Here is an example of creating, examining, and updating a -bool-vector. Note that the printed form represents up to 8 boolean -values as a single character. + The printed form represents up to 8 boolean values as a single +character: + +@example +@group +(bool-vector t nil t nil) + @result{} #&4"^E" +(bool-vector) + @result{} #&0"" +@end group +@end example + +You can use @code{vconcat} to print a bool-vector like other vectors: + +@example +@group +(vconcat (bool-vector nil t nil t)) + @result{} [nil t nil t] +@end group +@end example + + Here is another example of creating, examining, and updating a +bool-vector: @example (setq bv (make-bool-vector 5 t)) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index e4177836fa8..f2fe5c85a93 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3655,7 +3655,7 @@ This function returns the top pixel edge of window @var{window}. A @dfn{window configuration} records the entire layout of one frame---all windows, their sizes, which buffers they contain, how those -buffers are scrolled, and their values of point and the mark; also their +buffers are scrolled, and their value of point; also their fringes, margins, and scroll bar settings. It also includes the value of @code{minibuffer-scroll-window}. As a special exception, the window configuration does not record the value of point in the selected window @@ -3731,13 +3731,13 @@ This function returns @code{t} if @var{object} is a window configuration. @defun compare-window-configurations config1 config2 This function compares two window configurations as regards the -structure of windows, but ignores the values of point and mark and the +structure of windows, but ignores the values of point and the saved scrolling positions---it can return @code{t} even if those aspects differ. The function @code{equal} can also compare two window configurations; it regards configurations as unequal if they differ in any respect, even a -saved point or mark. +saved point. @end defun @defun window-configuration-frame config |