diff options
| author | Chong Yidong | 2012-09-10 11:25:10 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-09-10 11:25:10 +0800 |
| commit | d105a573fced502081e0dd5b00a86dd3b7bdd89a (patch) | |
| tree | 36f5b714920ee92ba31fef54f434f0dcbdae4b33 /src | |
| parent | ff55dfe8323e7d261f12007bf7ff6fef9396be09 (diff) | |
| download | emacs-d105a573fced502081e0dd5b00a86dd3b7bdd89a.tar.gz emacs-d105a573fced502081e0dd5b00a86dd3b7bdd89a.zip | |
* fns.c (Fdelq, Fdelete): Doc fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/fns.c | 33 |
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 @@ | |||
| 1 | 2012-09-10 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * fns.c (Fdelq, Fdelete): Doc fix. | ||
| 4 | |||
| 1 | 2012-09-10 Paul Eggert <eggert@cs.ucla.edu> | 5 | 2012-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) |
| @@ -1527,11 +1527,14 @@ The value is actually the first element of LIST whose cdr equals KEY. */) | |||
| 1527 | } | 1527 | } |
| 1528 | 1528 | ||
| 1529 | DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0, | 1529 | DEFUN ("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. |
| 1531 | The modified LIST is returned. Comparison is done with `eq'. | 1531 | More precisely, this function skips any members `eq' to ELT at the |
| 1532 | If the first member of LIST is ELT, there is no way to remove it by side effect; | 1532 | front of LIST, then removes members `eq' to ELT from the remaining |
| 1533 | therefore, write `(setq foo (delq element foo))' | 1533 | sublist by modifying its list structure, then returns the resulting |
| 1534 | to be sure of changing the value of `foo'. */) | 1534 | list. |
| 1535 | |||
| 1536 | Write `(setq foo (delq element foo))' to be sure of correctly changing | ||
| 1537 | the 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 | ||
| 1561 | DEFUN ("delete", Fdelete, Sdelete, 2, 2, 0, | 1564 | DEFUN ("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. |
| 1563 | SEQ must be a list, a vector, or a string. | 1566 | SEQ must be a sequence (i.e. a list, a vector, or a string). |
| 1564 | The modified SEQ is returned. Comparison is done with `equal'. | 1567 | The return value is a sequence of the same type. |
| 1565 | If SEQ is not a list, or the first member of SEQ is ELT, deleting it | 1568 | |
| 1566 | is not a side effect; it is simply using a different sequence. | 1569 | If SEQ is a list, this behaves like `delq', except that it compares |
| 1567 | Therefore, write `(setq foo (delete element foo))' | 1570 | with `equal' instead of `eq'. In particular, it may remove elements |
| 1568 | to be sure of changing the value of `foo'. */) | 1571 | by altering the list structure. |
| 1572 | |||
| 1573 | If SEQ is not a list, deletion is never performed destructively; | ||
| 1574 | instead this function creates and returns a new vector or string. | ||
| 1575 | |||
| 1576 | Write `(setq foo (delete element foo))' to be sure of correctly | ||
| 1577 | changing 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)) |