diff options
| author | Glenn Morris | 2020-05-03 07:50:20 -0700 |
|---|---|---|
| committer | Glenn Morris | 2020-05-03 07:50:20 -0700 |
| commit | c6d70f890cee2f5a561dcea0a5ef2de0cbbf1baf (patch) | |
| tree | 478b320e8040ec73d218611c24e7832c10b0b54d /src | |
| parent | 5f516dc94419d8ccfad6bf31a752d33f797f837c (diff) | |
| parent | 1f17193e00692b1bb9739415b0b56ed8f16f049f (diff) | |
| download | emacs-c6d70f890cee2f5a561dcea0a5ef2de0cbbf1baf.tar.gz emacs-c6d70f890cee2f5a561dcea0a5ef2de0cbbf1baf.zip | |
Merge from origin/emacs-27
1f17193e00 Expand file name for remote dirs as well
7a12ab5ea2 Fix project.el commands in "transient" projects
274ec97e3c Make sure alist-related functions say so in their doc
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 56 |
1 files changed, 28 insertions, 28 deletions
| @@ -1593,16 +1593,16 @@ The value is actually the tail of LIST whose car is ELT. */) | |||
| 1593 | } | 1593 | } |
| 1594 | 1594 | ||
| 1595 | DEFUN ("assq", Fassq, Sassq, 2, 2, 0, | 1595 | DEFUN ("assq", Fassq, Sassq, 2, 2, 0, |
| 1596 | doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. | 1596 | doc: /* Return non-nil if KEY is `eq' to the car of an element of ALIST. |
| 1597 | The value is actually the first element of LIST whose car is KEY. | 1597 | The value is actually the first element of ALIST whose car is KEY. |
| 1598 | Elements of LIST that are not conses are ignored. */) | 1598 | Elements of ALIST that are not conses are ignored. */) |
| 1599 | (Lisp_Object key, Lisp_Object list) | 1599 | (Lisp_Object key, Lisp_Object alist) |
| 1600 | { | 1600 | { |
| 1601 | Lisp_Object tail = list; | 1601 | Lisp_Object tail = alist; |
| 1602 | FOR_EACH_TAIL (tail) | 1602 | FOR_EACH_TAIL (tail) |
| 1603 | if (CONSP (XCAR (tail)) && EQ (XCAR (XCAR (tail)), key)) | 1603 | if (CONSP (XCAR (tail)) && EQ (XCAR (XCAR (tail)), key)) |
| 1604 | return XCAR (tail); | 1604 | return XCAR (tail); |
| 1605 | CHECK_LIST_END (tail, list); | 1605 | CHECK_LIST_END (tail, alist); |
| 1606 | return Qnil; | 1606 | return Qnil; |
| 1607 | } | 1607 | } |
| 1608 | 1608 | ||
| @@ -1610,22 +1610,22 @@ Elements of LIST that are not conses are ignored. */) | |||
| 1610 | Use only on objects known to be non-circular lists. */ | 1610 | Use only on objects known to be non-circular lists. */ |
| 1611 | 1611 | ||
| 1612 | Lisp_Object | 1612 | Lisp_Object |
| 1613 | assq_no_quit (Lisp_Object key, Lisp_Object list) | 1613 | assq_no_quit (Lisp_Object key, Lisp_Object alist) |
| 1614 | { | 1614 | { |
| 1615 | for (; ! NILP (list); list = XCDR (list)) | 1615 | for (; ! NILP (alist); alist = XCDR (alist)) |
| 1616 | if (CONSP (XCAR (list)) && EQ (XCAR (XCAR (list)), key)) | 1616 | if (CONSP (XCAR (alist)) && EQ (XCAR (XCAR (alist)), key)) |
| 1617 | return XCAR (list); | 1617 | return XCAR (alist); |
| 1618 | return Qnil; | 1618 | return Qnil; |
| 1619 | } | 1619 | } |
| 1620 | 1620 | ||
| 1621 | DEFUN ("assoc", Fassoc, Sassoc, 2, 3, 0, | 1621 | DEFUN ("assoc", Fassoc, Sassoc, 2, 3, 0, |
| 1622 | doc: /* Return non-nil if KEY is equal to the car of an element of LIST. | 1622 | doc: /* Return non-nil if KEY is equal to the car of an element of ALIST. |
| 1623 | The value is actually the first element of LIST whose car equals KEY. | 1623 | The value is actually the first element of ALIST whose car equals KEY. |
| 1624 | 1624 | ||
| 1625 | Equality is defined by TESTFN if non-nil or by `equal' if nil. */) | 1625 | Equality is defined by TESTFN if non-nil or by `equal' if nil. */) |
| 1626 | (Lisp_Object key, Lisp_Object list, Lisp_Object testfn) | 1626 | (Lisp_Object key, Lisp_Object alist, Lisp_Object testfn) |
| 1627 | { | 1627 | { |
| 1628 | Lisp_Object tail = list; | 1628 | Lisp_Object tail = alist; |
| 1629 | FOR_EACH_TAIL (tail) | 1629 | FOR_EACH_TAIL (tail) |
| 1630 | { | 1630 | { |
| 1631 | Lisp_Object car = XCAR (tail); | 1631 | Lisp_Object car = XCAR (tail); |
| @@ -1636,7 +1636,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil. */) | |||
| 1636 | : !NILP (call2 (testfn, XCAR (car), key)))) | 1636 | : !NILP (call2 (testfn, XCAR (car), key)))) |
| 1637 | return car; | 1637 | return car; |
| 1638 | } | 1638 | } |
| 1639 | CHECK_LIST_END (tail, list); | 1639 | CHECK_LIST_END (tail, alist); |
| 1640 | return Qnil; | 1640 | return Qnil; |
| 1641 | } | 1641 | } |
| 1642 | 1642 | ||
| @@ -1645,11 +1645,11 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil. */) | |||
| 1645 | that are not too deep and are not window configurations. */ | 1645 | that are not too deep and are not window configurations. */ |
| 1646 | 1646 | ||
| 1647 | Lisp_Object | 1647 | Lisp_Object |
| 1648 | assoc_no_quit (Lisp_Object key, Lisp_Object list) | 1648 | assoc_no_quit (Lisp_Object key, Lisp_Object alist) |
| 1649 | { | 1649 | { |
| 1650 | for (; ! NILP (list); list = XCDR (list)) | 1650 | for (; ! NILP (alist); alist = XCDR (alist)) |
| 1651 | { | 1651 | { |
| 1652 | Lisp_Object car = XCAR (list); | 1652 | Lisp_Object car = XCAR (alist); |
| 1653 | if (CONSP (car) | 1653 | if (CONSP (car) |
| 1654 | && (EQ (XCAR (car), key) || equal_no_quit (XCAR (car), key))) | 1654 | && (EQ (XCAR (car), key) || equal_no_quit (XCAR (car), key))) |
| 1655 | return car; | 1655 | return car; |
| @@ -1658,24 +1658,24 @@ assoc_no_quit (Lisp_Object key, Lisp_Object list) | |||
| 1658 | } | 1658 | } |
| 1659 | 1659 | ||
| 1660 | DEFUN ("rassq", Frassq, Srassq, 2, 2, 0, | 1660 | DEFUN ("rassq", Frassq, Srassq, 2, 2, 0, |
| 1661 | doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST. | 1661 | doc: /* Return non-nil if KEY is `eq' to the cdr of an element of ALIST. |
| 1662 | The value is actually the first element of LIST whose cdr is KEY. */) | 1662 | The value is actually the first element of ALIST whose cdr is KEY. */) |
| 1663 | (Lisp_Object key, Lisp_Object list) | 1663 | (Lisp_Object key, Lisp_Object alist) |
| 1664 | { | 1664 | { |
| 1665 | Lisp_Object tail = list; | 1665 | Lisp_Object tail = alist; |
| 1666 | FOR_EACH_TAIL (tail) | 1666 | FOR_EACH_TAIL (tail) |
| 1667 | if (CONSP (XCAR (tail)) && EQ (XCDR (XCAR (tail)), key)) | 1667 | if (CONSP (XCAR (tail)) && EQ (XCDR (XCAR (tail)), key)) |
| 1668 | return XCAR (tail); | 1668 | return XCAR (tail); |
| 1669 | CHECK_LIST_END (tail, list); | 1669 | CHECK_LIST_END (tail, alist); |
| 1670 | return Qnil; | 1670 | return Qnil; |
| 1671 | } | 1671 | } |
| 1672 | 1672 | ||
| 1673 | DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0, | 1673 | DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0, |
| 1674 | doc: /* Return non-nil if KEY is `equal' to the cdr of an element of LIST. | 1674 | doc: /* Return non-nil if KEY is `equal' to the cdr of an element of ALIST. |
| 1675 | The value is actually the first element of LIST whose cdr equals KEY. */) | 1675 | The value is actually the first element of ALIST whose cdr equals KEY. */) |
| 1676 | (Lisp_Object key, Lisp_Object list) | 1676 | (Lisp_Object key, Lisp_Object alist) |
| 1677 | { | 1677 | { |
| 1678 | Lisp_Object tail = list; | 1678 | Lisp_Object tail = alist; |
| 1679 | FOR_EACH_TAIL (tail) | 1679 | FOR_EACH_TAIL (tail) |
| 1680 | { | 1680 | { |
| 1681 | Lisp_Object car = XCAR (tail); | 1681 | Lisp_Object car = XCAR (tail); |
| @@ -1683,7 +1683,7 @@ The value is actually the first element of LIST whose cdr equals KEY. */) | |||
| 1683 | && (EQ (XCDR (car), key) || !NILP (Fequal (XCDR (car), key)))) | 1683 | && (EQ (XCDR (car), key) || !NILP (Fequal (XCDR (car), key)))) |
| 1684 | return car; | 1684 | return car; |
| 1685 | } | 1685 | } |
| 1686 | CHECK_LIST_END (tail, list); | 1686 | CHECK_LIST_END (tail, alist); |
| 1687 | return Qnil; | 1687 | return Qnil; |
| 1688 | } | 1688 | } |
| 1689 | 1689 | ||