[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/async bd68cc1 58/60: Handle dotted lists as well
From: |
Stefan Monnier |
Subject: |
[elpa] externals/async bd68cc1 58/60: Handle dotted lists as well |
Date: |
Tue, 8 Oct 2019 10:11:37 -0400 (EDT) |
branch: externals/async
commit bd68cc1ab1ac6af890e250bdaa12ffb1cb9649be
Author: Thierry Volpiatto <address@hidden>
Commit: Thierry Volpiatto <address@hidden>
Handle dotted lists as well
This is limited though to dotted lists like (x . y)
and not (x . (x . y)).
* async.el (async--purecopy): Do it.
---
async.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/async.el b/async.el
index e20e373..d616b11 100644
--- a/async.el
+++ b/async.el
@@ -61,12 +61,28 @@ is returned unmodified."
(substring-no-properties object))
((consp object)
(cl-loop for elm in object
+ ;; A string.
if (stringp elm)
collect (substring-no-properties elm)
else
+ ;; Proper lists.
if (and (consp elm) (null (cdr (last elm))))
collect (async--purecopy elm)
else
+ ;; Dotted lists.
+ ;; We handle here only dotted list where car and cdr
+ ;; are atoms i.e. (x . y) and not (x . (x . y)) or
+ ;; (x . (x y)) which should fit most cases.
+ if (and (consp elm) (cdr (last elm)))
+ collect (let ((key (car elm))
+ (val (cdr elm)))
+ (cons (if (stringp key)
+ (substring-no-properties key)
+ key)
+ (if (stringp val)
+ (substring-no-properties val)
+ val)))
+ else
collect elm))
(t object)))
- [elpa] externals/async efe6bda 45/60: Check if dired buffer is alive before reverting (#99), (continued)
- [elpa] externals/async efe6bda 45/60: Check if dired buffer is alive before reverting (#99), Stefan Monnier, 2019/10/08
- [elpa] externals/async c9bd058 48/60: DRY in async-inject-variables, Stefan Monnier, 2019/10/08
- [elpa] externals/async 5863eef 28/60: Copy the autoload file when installing, Stefan Monnier, 2019/10/08
- [elpa] externals/async dea9627 31/60: Merge pull request #87 from darkfeline/async, Stefan Monnier, 2019/10/08
- [elpa] externals/async 8bb64e3 41/60: Require cl-lib., Stefan Monnier, 2019/10/08
- [elpa] externals/async 7279cc6 38/60: Remove autoload file as well when uninstalling, Stefan Monnier, 2019/10/08
- [elpa] externals/async afe10c4 30/60: Add one-shot dired-async commands, Stefan Monnier, 2019/10/08
- [elpa] externals/async 4d3b737 52/60: Fix error from reverting to nonexistent directories, Stefan Monnier, 2019/10/08
- [elpa] externals/async 04e1a2c 43/60: Add async-byte-compile-file, Stefan Monnier, 2019/10/08
- [elpa] externals/async 66e6856 34/60: Merge pull request #92 from arichiardi/add-gitignore, Stefan Monnier, 2019/10/08
- [elpa] externals/async bd68cc1 58/60: Handle dotted lists as well,
Stefan Monnier <=