[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 3bd52a4 2/2: Revert recent threading macro indenta
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 3bd52a4 2/2: Revert recent threading macro indentation changes |
Date: |
Sun, 4 Jul 2021 09:57:09 -0400 (EDT) |
branch: externals/dash
commit 3bd52a45aa81a3aab0d02ece800042415669399a
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Revert recent threading macro indentation changes
This reverts commit 92562909a763d766fd81b817418c2e05d35d50e0
"* dash.el (-->): Indent with 1 distinguished arg."
of 2021-01-10.
This reverts commit 911ef09a30c0a5211f064e7761f9fc26dbf512b6
"* dash.el (->, ->>): Indent with 1 distinguished arg."
of 2021-03-08.
The Clojure-inspired threading macros -> and ->> are quite popular
and were indented until recently with no distinguished arguments as
per Clojure conventions. In Elisp practice this is not a problem
since the macros have short names. For the converse argument
against threading macros such as -some-> that have longer names, see
the discussion in #319 and #321.
This commit reverts relatively recent breaking and controversial
indentation changes that tried to make ->, ->>, and --> more
consistent with the rest of Dash, including -some->, -doto,
etc. which are all indented with a distinguished argument despite
being inspired by Clojure. For the relevant discussion, see #375.
* dash.el (->, ->>, -->): Indent without a distinguished argument.
(-as->, -some->, -some->>, -fixfn): Reindent.
* NEWS.md (2.19.0): Announce indentation change to -->.
---
NEWS.md | 3 +++
dash.el | 38 ++++++++++++++++++--------------------
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 6a18da3..148b5a9 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -8,6 +8,9 @@ See the end of the file for license conditions.
### From 2.18.1 to 2.19.0
+- Reverted a breaking change introduced in `2.18.0` that caused the
+ threading macro `-->` to be indented differently from `->` and
+ `->>` (#375).
- Added and fixed Edebug specifications for many Dash macros (Philipp
Stephani, #380, #381).
- New macro `--partition-after-pred` which affords
diff --git a/dash.el b/dash.el
index be50166..8fb08f7 100644
--- a/dash.el
+++ b/dash.el
@@ -1747,8 +1747,7 @@ See also: `-select-columns', `-select-by-indices'"
in the first form, making a list of it if it is not a list
already. If there are more forms, insert the first form as the
second item in second form, etc."
- (declare (debug (form &rest [&or symbolp (sexp &rest form)]))
- (indent 1))
+ (declare (debug (form &rest [&or symbolp (sexp &rest form)])))
(cond
((null form) x)
((null more) (if (listp form)
@@ -1761,8 +1760,7 @@ second item in second form, etc."
in the first form, making a list of it if it is not a list
already. If there are more forms, insert the first form as the
last item in second form, etc."
- (declare (debug ->)
- (indent 1))
+ (declare (debug ->))
(cond
((null form) x)
((null more) (if (listp form)
@@ -1776,7 +1774,7 @@ last item in second form, etc."
Insert X at the position signified by the symbol `it' in the first
form. If there are more forms, insert the first form at the position
signified by `it' in in second form, etc."
- (declare (debug (form body)) (indent 1))
+ (declare (debug (form body)))
`(-as-> ,x it ,@forms))
(defmacro -as-> (value variable &rest forms)
@@ -1789,9 +1787,9 @@ VARIABLE to the result of the first form, and so forth."
`,value
`(let ((,variable ,value))
(-as-> ,(if (symbolp (car forms))
- (list (car forms) variable)
- (car forms))
- ,variable
+ (list (car forms) variable)
+ (car forms))
+ ,variable
,@(cdr forms)))))
(defmacro -some-> (x &optional form &rest more)
@@ -1803,7 +1801,7 @@ and when that result is non-nil, through the next form,
etc."
(let ((result (make-symbol "result")))
`(-some-> (-when-let (,result ,x)
(-> ,result ,form))
- ,@more))))
+ ,@more))))
(defmacro -some->> (x &optional form &rest more)
"When expr is non-nil, thread it through the first form (via `->>'),
@@ -1814,7 +1812,7 @@ and when that result is non-nil, through the next form,
etc."
(let ((result (make-symbol "result")))
`(-some->> (-when-let (,result ,x)
(->> ,result ,form))
- ,@more))))
+ ,@more))))
(defmacro -some--> (expr &rest forms)
"Thread EXPR through FORMS via `-->', while the result is non-nil.
@@ -3188,18 +3186,18 @@ cdr the final output from HALT-TEST.
In types: (a -> a) -> a -> a."
(let ((eqfn (or equal-test 'equal))
- (haltfn (or halt-test
- (-not
- (-counter 0 -fixfn-max-iterations)))))
+ (haltfn (or halt-test
+ (-not
+ (-counter 0 -fixfn-max-iterations)))))
(lambda (x)
(let ((re (funcall fn x))
- (halt? (funcall haltfn x)))
- (while (and (not halt?) (not (funcall eqfn x re)))
- (setq x re
- re (funcall fn re)
- halt? (funcall haltfn re)))
- (if halt? (cons 'halted halt?)
- re)))))
+ (halt? (funcall haltfn x)))
+ (while (and (not halt?) (not (funcall eqfn x re)))
+ (setq x re
+ re (funcall fn re)
+ halt? (funcall haltfn re)))
+ (if halt? (cons 'halted halt?)
+ re)))))
(defun -prodfn (&rest fns)
"Take a list of n functions and return a function that takes a