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 | |
| 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
| -rw-r--r-- | lisp/progmodes/project.el | 36 | ||||
| -rw-r--r-- | src/fns.c | 56 |
2 files changed, 47 insertions, 45 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1f4cbe96ad8..f5f4092babf 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -185,23 +185,25 @@ to find the list of ignores for each directory." | |||
| 185 | (require 'find-dired) | 185 | (require 'find-dired) |
| 186 | (require 'xref) | 186 | (require 'xref) |
| 187 | (defvar find-name-arg) | 187 | (defvar find-name-arg) |
| 188 | (let ((default-directory dir) | 188 | (let* ((default-directory dir) |
| 189 | (command (format "%s %s %s -type f %s -print0" | 189 | ;; Make sure ~/ etc. in local directory name is |
| 190 | find-program | 190 | ;; expanded and not left for the shell command |
| 191 | (file-local-name dir) | 191 | ;; to interpret. |
| 192 | (xref--find-ignores-arguments | 192 | (localdir (file-local-name (expand-file-name dir))) |
| 193 | ignores | 193 | (command (format "%s %s %s -type f %s -print0" |
| 194 | (expand-file-name dir)) | 194 | find-program |
| 195 | (if files | 195 | localdir |
| 196 | (concat (shell-quote-argument "(") | 196 | (xref--find-ignores-arguments ignores localdir) |
| 197 | " " find-name-arg " " | 197 | (if files |
| 198 | (mapconcat | 198 | (concat (shell-quote-argument "(") |
| 199 | #'shell-quote-argument | 199 | " " find-name-arg " " |
| 200 | (split-string files) | 200 | (mapconcat |
| 201 | (concat " -o " find-name-arg " ")) | 201 | #'shell-quote-argument |
| 202 | " " | 202 | (split-string files) |
| 203 | (shell-quote-argument ")"))"") | 203 | (concat " -o " find-name-arg " ")) |
| 204 | ))) | 204 | " " |
| 205 | (shell-quote-argument ")"))"") | ||
| 206 | ))) | ||
| 205 | (project--remote-file-names | 207 | (project--remote-file-names |
| 206 | (sort (split-string (shell-command-to-string command) "\0" t) | 208 | (sort (split-string (shell-command-to-string command) "\0" t) |
| 207 | #'string<)))) | 209 | #'string<)))) |
| @@ -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 | ||