aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-09-09 15:50:45 +0800
committerChong Yidong2012-09-09 15:50:45 +0800
commitbb6b0efc3490a1e47e69e3afbc115576025f3606 (patch)
tree66be2649d18edba64b853204777666d73da44091
parente4e55af11e05361f7573a5c7fc16189affe5b08b (diff)
downloademacs-bb6b0efc3490a1e47e69e3afbc115576025f3606.tar.gz
emacs-bb6b0efc3490a1e47e69e3afbc115576025f3606.zip
Clarify descriptions of delq and delete in Lisp manual.
* doc/lispref/lists.texi (Sets And Lists): Explain that the return value for delete should be used, like for delq.
-rw-r--r--doc/lispref/ChangeLog3
-rw-r--r--doc/lispref/lists.texi33
2 files changed, 24 insertions, 12 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 79691bfb181..ceb199dae88 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,8 @@
12012-09-09 Chong Yidong <cyd@gnu.org> 12012-09-09 Chong Yidong <cyd@gnu.org>
2 2
3 * lists.texi (Sets And Lists): Explain that the return value for
4 delete should be used, like for delq.
5
3 * minibuf.texi (Yes-or-No Queries): Document recentering and 6 * minibuf.texi (Yes-or-No Queries): Document recentering and
4 scrolling in y-or-n-p. Remove gratuitous example. 7 scrolling in y-or-n-p. Remove gratuitous example.
5 8
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index 023f8ba18dd..d685ce0aa74 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1293,14 +1293,19 @@ compare @var{object} against the elements of the list. For example:
1293@defun delq object list 1293@defun delq object list
1294@cindex deleting list elements 1294@cindex deleting list elements
1295This function destructively removes all elements @code{eq} to 1295This function destructively removes all elements @code{eq} to
1296@var{object} from @var{list}. The letter @samp{q} in @code{delq} says 1296@var{object} from @var{list}, and returns the resulting list. The
1297that it uses @code{eq} to compare @var{object} against the elements of 1297letter @samp{q} in @code{delq} says that it uses @code{eq} to compare
1298the list, like @code{memq} and @code{remq}. 1298@var{object} against the elements of the list, like @code{memq} and
1299@code{remq}.
1300
1301Typically, when you invoke @code{delq}, you should use the return
1302value by assigning it to the variable which held the original list.
1303The reason for this is explained below.
1299@end defun 1304@end defun
1300 1305
1301When @code{delq} deletes elements from the front of the list, it does so 1306The @code{delq} function deletes elements from the front of the list
1302simply by advancing down the list and returning a sublist that starts 1307by simply advancing down the list, and returning a sublist that starts
1303after those elements: 1308after those elements. For example:
1304 1309
1305@example 1310@example
1306@group 1311@group
@@ -1308,6 +1313,7 @@ after those elements:
1308@end group 1313@end group
1309@end example 1314@end example
1310 1315
1316@noindent
1311When an element to be deleted appears in the middle of the list, 1317When an element to be deleted appears in the middle of the list,
1312removing it involves changing the @sc{cdr}s (@pxref{Setcdr}). 1318removing it involves changing the @sc{cdr}s (@pxref{Setcdr}).
1313 1319
@@ -1432,12 +1438,15 @@ Compare this with @code{memq}:
1432@end defun 1438@end defun
1433 1439
1434@defun delete object sequence 1440@defun delete object sequence
1435If @code{sequence} is a list, this function destructively removes all 1441This function removes all elements @code{equal} to @var{object} from
1436elements @code{equal} to @var{object} from @var{sequence}. For lists, 1442@var{sequence}, and returns the resulting sequence.
1437@code{delete} is to @code{delq} as @code{member} is to @code{memq}: it 1443
1438uses @code{equal} to compare elements with @var{object}, like 1444If @var{sequence} is a list, @code{delete} is to @code{delq} as
1439@code{member}; when it finds an element that matches, it cuts the 1445@code{member} is to @code{memq}: it uses @code{equal} to compare
1440element out just as @code{delq} would. 1446elements with @var{object}, like @code{member}; when it finds an
1447element that matches, it cuts the element out just as @code{delq}
1448would. As with @code{delq}, you should typically use the return value
1449by assigning it to the variable which held the original list.
1441 1450
1442If @code{sequence} is a vector or string, @code{delete} returns a copy 1451If @code{sequence} is a vector or string, @code{delete} returns a copy
1443of @code{sequence} with all elements @code{equal} to @code{object} 1452of @code{sequence} with all elements @code{equal} to @code{object}