diff options
Diffstat (limited to 'lispref/variables.texi')
| -rw-r--r-- | lispref/variables.texi | 25 |
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 | |||
| 569 | declared equivalently in @file{cus-start.el}.} or by the first character | 569 | declared equivalently in @file{cus-start.el}.} or by the first character |
| 570 | of their @code{variable-documentation} property. If the property exists | 570 | of their @code{variable-documentation} property. If the property exists |
| 571 | and is a string, and its first character is @samp{*}, then the variable | 571 | and is a string, and its first character is @samp{*}, then the variable |
| 572 | is a user option. | 572 | is 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 | |||
| 909 | position specified by @var{order}. If @var{element} is already a | 909 | position specified by @var{order}. If @var{element} is already a |
| 910 | member of the list, its position in the list is adjusted according | 910 | member of the list, its position in the list is adjusted according |
| 911 | to @var{order}. Membership is tested using @code{eq}. | 911 | to @var{order}. Membership is tested using @code{eq}. |
| 912 | The valued returned is the resulting list, whether updated or not. | 912 | This function returns the resulting list, whether updated or not. |
| 913 | 913 | ||
| 914 | The @var{order} is a number, and the elements on list are sorted in | 914 | The @var{order} is typically a number (integer or float), and the |
| 915 | increasing numerical order. Elements without a numeric list order are | 915 | elements of the list are sorted in non-decreasing numerical order. |
| 916 | placed at the end of @var{symbol}. | 916 | |
| 917 | @var{order} may also be omitted or @code{nil}. Then the numeric order | ||
| 918 | of @var{element} stays unchanged if it already has one; otherwise, | ||
| 919 | @var{element} has no numeric order. Elements without a numeric list | ||
| 920 | order are placed at the end of the list, in no particular order. | ||
| 921 | |||
| 922 | Any other value for @var{order} removes the numeric order of @var{element} | ||
| 923 | if it already has one; otherwise, it is equivalent to @code{nil}. | ||
| 917 | 924 | ||
| 918 | The argument @var{symbol} is not implicitly quoted; | 925 | The 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} |
| 920 | and unlike @code{setq}. Quote the argument yourself if that is what | 927 | and unlike @code{setq}. Quote the argument yourself if that is what |
| 921 | you want. | 928 | you want. |
| 922 | 929 | ||
| 923 | The ordering information is stored in an alist on @var{symbol}'s | 930 | The 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 | ||
| 951 | foo ;; @r{@code{foo} was changed.} | 958 | foo ;; @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 |