[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 070b569 156/316: Add missing indent declaration f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 070b569 156/316: Add missing indent declaration for ‘-some->’ and siblings |
Date: |
Mon, 15 Feb 2021 15:57:48 -0500 (EST) |
branch: externals/dash
commit 070b569f61e08af6b207799e39232d1acae63630
Author: wouter bolsterlee <wouter@bolsterl.ee>
Commit: wouter bolsterlee <wouter@bolsterl.ee>
Add missing indent declaration for ‘-some->’ and siblings
The ->, ->>, and --> threading macros have short names, and they align
all arguments vertically, including the first one.
While the -some->, -some->>, and -some--> macros have similar
behaviour, they actually have quite long names, resulting in code that
looks like this:
(-some->> '(1 2 3)
(do-something)
(and-something-else))
Adding a (declare (indent 1)) declaration for those variants
results in this indentation instead:
(-some->> '(1 2 3)
(do-something)
(and-something-else))
This is arguably better since the ‘some’ version of these threading
macros actually treat their first argument a bit special: if the
expression evalutes to nil, the rest won't even run, and this
indentation makes the whole expression look more like a conditional
form.
Fixes #319.
---
dash.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dash.el b/dash.el
index 55285fa..c2b39ca 100644
--- a/dash.el
+++ b/dash.el
@@ -1536,7 +1536,8 @@ VARIABLE to the result of the first form, and so forth."
(defmacro -some-> (x &optional form &rest more)
"When expr is non-nil, thread it through the first form (via `->'),
and when that result is non-nil, through the next form, etc."
- (declare (debug ->))
+ (declare (debug ->)
+ (indent 1))
(if (null form) x
(let ((result (make-symbol "result")))
`(-some-> (-when-let (,result ,x)
@@ -1546,7 +1547,8 @@ and when that result is non-nil, through the next form,
etc."
(defmacro -some->> (x &optional form &rest more)
"When expr is non-nil, thread it through the first form (via `->>'),
and when that result is non-nil, through the next form, etc."
- (declare (debug ->))
+ (declare (debug ->)
+ (indent 1))
(if (null form) x
(let ((result (make-symbol "result")))
`(-some->> (-when-let (,result ,x)
@@ -1556,7 +1558,8 @@ and when that result is non-nil, through the next form,
etc."
(defmacro -some--> (x &optional form &rest more)
"When expr in non-nil, thread it through the first form (via `-->'),
and when that result is non-nil, through the next form, etc."
- (declare (debug ->))
+ (declare (debug ->)
+ (indent 1))
(if (null form) x
(let ((result (make-symbol "result")))
`(-some--> (-when-let (,result ,x)
- [elpa] externals/dash 83190a2 106/316: Emacs 26.1 was released and pretest does no longer exist, (continued)
- [elpa] externals/dash 83190a2 106/316: Emacs 26.1 was released and pretest does no longer exist, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0505f5d 109/316: Merge pull request #271 from magnars/feature/-setq, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 148404c 114/316: [Fix #256] Allow `-let` bindings with no explicit value, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f1ffdf7 131/316: Merge pull request #288 from cireu/master, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6d2decb 122/316: Prefer number-to-string over int-to-string, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3f7bc26 132/316: Provided option to extend destructoring, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a6e1436 124/316: Add -common-suffix, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 016e0de 133/316: Generalize `-rotate` for `|n|` greater than `(length list)`., ELPA Syncer, 2021/02/15
- [elpa] externals/dash bbf8016 138/316: Remove dependecy `cl-lib` in tests., ELPA Syncer, 2021/02/15
- [elpa] externals/dash f3e9cd2 151/316: Fix doc and test harnesses (#309), ELPA Syncer, 2021/02/15
- [elpa] externals/dash 070b569 156/316: Add missing indent declaration for ‘-some->’ and siblings,
ELPA Syncer <=
- [elpa] externals/dash 800c25d 166/316: feat(docs): simplify (function x) to #'x, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 53323ec 169/316: Fix typo and its copies, ELPA Syncer, 2021/02/15
- [elpa] externals/dash fe9bbc2 170/316: Merge pull request #334 from tarsiiformes/typo, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e4e5269 180/316: Finish last change to package keywords, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b329938 182/316: Update CI configuration, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7629dae 183/316: Add dir-locals-file with useful settings, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 84721fc 206/316: Optimize -repeat a bit, ELPA Syncer, 2021/02/15
- [elpa] externals/dash d983d4f 217/316: Fix -doto, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 66e3e94 079/316: Define -second-item through to -fifth-item, ELPA Syncer, 2021/02/15
- [elpa] externals/dash dd30a1f 047/316: [Feature #196] Add -powerset and -permutations (#203), ELPA Syncer, 2021/02/15