aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/variables.texi
diff options
context:
space:
mode:
Diffstat (limited to 'lispref/variables.texi')
-rw-r--r--lispref/variables.texi25
1 files changed, 16 insertions, 9 deletions
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 31e42b59c79..38fb929c16d 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -569,7 +569,7 @@ though being declared using @code{defcustom}@footnote{They may also be
569declared equivalently in @file{cus-start.el}.} or by the first character 569declared equivalently in @file{cus-start.el}.} or by the first character
570of their @code{variable-documentation} property. If the property exists 570of their @code{variable-documentation} property. If the property exists
571and is a string, and its first character is @samp{*}, then the variable 571and is a string, and its first character is @samp{*}, then the variable
572is a user option. 572is a user option. Aliases of user options are also user options.
573@end defun 573@end defun
574 574
575@kindex variable-interactive 575@kindex variable-interactive
@@ -909,18 +909,25 @@ This function sets the variable @var{symbol} by inserting
909position specified by @var{order}. If @var{element} is already a 909position specified by @var{order}. If @var{element} is already a
910member of the list, its position in the list is adjusted according 910member of the list, its position in the list is adjusted according
911to @var{order}. Membership is tested using @code{eq}. 911to @var{order}. Membership is tested using @code{eq}.
912The valued returned is the resulting list, whether updated or not. 912This function returns the resulting list, whether updated or not.
913 913
914The @var{order} is a number, and the elements on list are sorted in 914The @var{order} is typically a number (integer or float), and the
915increasing numerical order. Elements without a numeric list order are 915elements of the list are sorted in non-decreasing numerical order.
916placed at the end of @var{symbol}. 916
917@var{order} may also be omitted or @code{nil}. Then the numeric order
918of @var{element} stays unchanged if it already has one; otherwise,
919@var{element} has no numeric order. Elements without a numeric list
920order are placed at the end of the list, in no particular order.
921
922Any other value for @var{order} removes the numeric order of @var{element}
923if it already has one; otherwise, it is equivalent to @code{nil}.
917 924
918The argument @var{symbol} is not implicitly quoted; 925The argument @var{symbol} is not implicitly quoted;
919@code{add-to-ordered-list} is an ordinary function, like @code{set} 926@code{add-to-ordered-list} is an ordinary function, like @code{set}
920and unlike @code{setq}. Quote the argument yourself if that is what 927and unlike @code{setq}. Quote the argument yourself if that is what
921you want. 928you want.
922 929
923The ordering information is stored in an alist on @var{symbol}'s 930The ordering information is stored in a hash table on @var{symbol}'s
924@code{list-order} property. 931@code{list-order} property.
925@end defun 932@end defun
926 933
@@ -945,11 +952,11 @@ Here's a scenario showing how to use @code{add-to-ordered-list}:
945(add-to-ordered-list 'foo 'd) ;; @r{Append @code{d}.} 952(add-to-ordered-list 'foo 'd) ;; @r{Append @code{d}.}
946 @result{} (a c b d) 953 @result{} (a c b d)
947 954
948(add-to-ordered-list 'foo 'b 2) ;; @r{Move @code{b}.} 955(add-to-ordered-list 'foo 'e) ;; @r{Add @code{e}}.
949 @result{} (a b c d) 956 @result{} (a c b e d)
950 957
951foo ;; @r{@code{foo} was changed.} 958foo ;; @r{@code{foo} was changed.}
952 @result{} (a b c d) 959 @result{} (a c b e d)
953@end example 960@end example
954 961
955@node Variable Scoping 962@node Variable Scoping