aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2012-09-10 11:25:10 +0800
committerChong Yidong2012-09-10 11:25:10 +0800
commitd105a573fced502081e0dd5b00a86dd3b7bdd89a (patch)
tree36f5b714920ee92ba31fef54f434f0dcbdae4b33 /src
parentff55dfe8323e7d261f12007bf7ff6fef9396be09 (diff)
downloademacs-d105a573fced502081e0dd5b00a86dd3b7bdd89a.tar.gz
emacs-d105a573fced502081e0dd5b00a86dd3b7bdd89a.zip
* fns.c (Fdelq, Fdelete): Doc fix.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/fns.c33
2 files changed, 25 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bde130fe29a..548c80b3b85 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12012-09-10 Chong Yidong <cyd@gnu.org>
2
3 * fns.c (Fdelq, Fdelete): Doc fix.
4
12012-09-10 Paul Eggert <eggert@cs.ucla.edu> 52012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL) 7 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
diff --git a/src/fns.c b/src/fns.c
index 20770af67d4..95450c5e911 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1527,11 +1527,14 @@ The value is actually the first element of LIST whose cdr equals KEY. */)
1527} 1527}
1528 1528
1529DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0, 1529DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0,
1530 doc: /* Delete by side effect any occurrences of ELT as a member of LIST. 1530 doc: /* Delete members of LIST which are `eq' to ELT, and return the result.
1531The modified LIST is returned. Comparison is done with `eq'. 1531More precisely, this function skips any members `eq' to ELT at the
1532If the first member of LIST is ELT, there is no way to remove it by side effect; 1532front of LIST, then removes members `eq' to ELT from the remaining
1533therefore, write `(setq foo (delq element foo))' 1533sublist by modifying its list structure, then returns the resulting
1534to be sure of changing the value of `foo'. */) 1534list.
1535
1536Write `(setq foo (delq element foo))' to be sure of correctly changing
1537the value of a list `foo'. */)
1535 (register Lisp_Object elt, Lisp_Object list) 1538 (register Lisp_Object elt, Lisp_Object list)
1536{ 1539{
1537 register Lisp_Object tail, prev; 1540 register Lisp_Object tail, prev;
@@ -1559,13 +1562,19 @@ to be sure of changing the value of `foo'. */)
1559} 1562}
1560 1563
1561DEFUN ("delete", Fdelete, Sdelete, 2, 2, 0, 1564DEFUN ("delete", Fdelete, Sdelete, 2, 2, 0,
1562 doc: /* Delete by side effect any occurrences of ELT as a member of SEQ. 1565 doc: /* Delete members of SEQ which are `equal' to ELT, and return the result.
1563SEQ must be a list, a vector, or a string. 1566SEQ must be a sequence (i.e. a list, a vector, or a string).
1564The modified SEQ is returned. Comparison is done with `equal'. 1567The return value is a sequence of the same type.
1565If SEQ is not a list, or the first member of SEQ is ELT, deleting it 1568
1566is not a side effect; it is simply using a different sequence. 1569If SEQ is a list, this behaves like `delq', except that it compares
1567Therefore, write `(setq foo (delete element foo))' 1570with `equal' instead of `eq'. In particular, it may remove elements
1568to be sure of changing the value of `foo'. */) 1571by altering the list structure.
1572
1573If SEQ is not a list, deletion is never performed destructively;
1574instead this function creates and returns a new vector or string.
1575
1576Write `(setq foo (delete element foo))' to be sure of correctly
1577changing the value of a sequence `foo'. */)
1569 (Lisp_Object elt, Lisp_Object seq) 1578 (Lisp_Object elt, Lisp_Object seq)
1570{ 1579{
1571 if (VECTORP (seq)) 1580 if (VECTORP (seq))