Skip to content

Commit dd4c555

Browse files
ikappakibbatsov
authored andcommitted
Style thread-first/last with new Emacs 28 indent format
It was changed to (indent 0) from (indent 1) with https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2a736738095c313ccef07d074aac4c5467b750e0
1 parent 0f8fd4d commit dd4c555

19 files changed

+210
-159
lines changed

.dir-locals.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
(insert-rect . defun) ;; cl-flet
2828
(cl-defun . 2)
2929
(with-parsed-tramp-file-name . 2)
30-
(thread-first . 1)
31-
(thread-last . 1)))))
30+
(thread-first . 0)
31+
(thread-last . 0)))))
3232

3333
;; To use the bug-reference stuff, do:
3434
;; (add-hook 'text-mode-hook #'bug-reference-mode)

cider-browse-spec.el

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ Display TITLE at the top and SPECS are indented underneath."
129129
(insert (cider-propertize title 'emph) "\n")
130130
(dolist (spec-name specs)
131131
(insert (propertize " " 'spec-name spec-name))
132-
(thread-first (cider-font-lock-as-clojure spec-name)
132+
(thread-first
133+
(cider-font-lock-as-clojure spec-name)
133134
(insert-text-button 'type 'cider-browse-spec--spec)
134135
(button-put 'spec-name spec-name))
135136
(insert (propertize "\n" 'spec-name spec-name)))
@@ -148,13 +149,15 @@ Display TITLE at the top and SPECS are indented underneath."
148149
(cond ((stringp form)
149150
(if (cider--qualified-keyword-p form)
150151
(with-temp-buffer
151-
(thread-first form
152+
(thread-first
153+
form
152154
(insert-text-button 'type 'cider-browse-spec--spec)
153155
(button-put 'spec-name form))
154156
(buffer-string))
155157
;; to make it easier to read replace all clojure.spec ns with s/
156158
;; and remove all clojure.core ns
157-
(thread-last form
159+
(thread-last
160+
form
158161
(replace-regexp-in-string "^\\(clojure.spec\\|clojure.spec.alpha\\)/" "s/")
159162
(replace-regexp-in-string "^\\(clojure.core\\)/" ""))))
160163

@@ -168,34 +171,38 @@ Display TITLE at the top and SPECS are indented underneath."
168171
(format "(fn [%%] %s)" (cl-reduce #'concat (mapcar #'cider-browse-spec--pprint (cl-rest (cl-rest form)))))))
169172
;; prettier (s/and )
170173
((cider--spec-fn-p form-tag "and")
171-
(format "(s/and\n%s)" (string-join (thread-last (cl-rest form)
174+
(format "(s/and\n%s)" (string-join (thread-last
175+
(cl-rest form)
172176
(mapcar #'cider-browse-spec--pprint)
173177
(mapcar (lambda (x) (format "%s" x))))
174178
"\n")))
175179
;; prettier (s/or )
176180
((cider--spec-fn-p form-tag "or")
177181
(let ((name-spec-pair (seq-partition (cl-rest form) 2)))
178182
(format "(s/or\n%s)" (string-join
179-
(thread-last name-spec-pair
183+
(thread-last
184+
name-spec-pair
180185
(mapcar (lambda (s) (format "%s %s" (cl-first s) (cider-browse-spec--pprint (cl-second s))))))
181186
"\n"))))
182187
;; prettier (s/merge )
183188
((cider--spec-fn-p form-tag "merge")
184-
(format "(s/merge\n%s)" (string-join (thread-last (cl-rest form)
189+
(format "(s/merge\n%s)" (string-join (thread-last
190+
(cl-rest form)
185191
(mapcar #'cider-browse-spec--pprint)
186192
(mapcar (lambda (x) (format "%s" x))))
187193
"\n")))
188194
;; prettier (s/keys )
189195
((cider--spec-fn-p form-tag "keys")
190196
(let ((keys-args (seq-partition (cl-rest form) 2)))
191197
(format "(s/keys%s)" (thread-last
192-
keys-args
198+
keys-args
193199
(mapcar (lambda (s)
194200
(let ((key-type (cl-first s))
195201
(specs-vec (cl-second s)))
196202
(concat "\n" key-type
197203
" ["
198-
(string-join (thread-last specs-vec
204+
(string-join (thread-last
205+
specs-vec
199206
(mapcar #'cider-browse-spec--pprint)
200207
(mapcar (lambda (x) (format "%s" x))))
201208
"\n")
@@ -210,29 +217,33 @@ Display TITLE at the top and SPECS are indented underneath."
210217
multi-method
211218
retag
212219
(string-join
213-
(thread-last sub-specs
220+
(thread-last
221+
sub-specs
214222
(mapcar (lambda (s)
215223
(concat "\n\n" (cl-first s) " " (cider-browse-spec--pprint (cl-second s))))))
216224
"\n"))))
217225
;; prettier (s/cat )
218226
((cider--spec-fn-p form-tag "cat")
219227
(let ((name-spec-pairs (seq-partition (cl-rest form) 2)))
220228
(format "(s/cat %s)"
221-
(thread-last name-spec-pairs
229+
(thread-last
230+
name-spec-pairs
222231
(mapcar (lambda (s)
223232
(concat "\n" (cl-first s) " " (cider-browse-spec--pprint (cl-second s)))))
224233
(cl-reduce #'concat)))))
225234
;; prettier (s/alt )
226235
((cider--spec-fn-p form-tag "alt")
227236
(let ((name-spec-pairs (seq-partition (cl-rest form) 2)))
228237
(format "(s/alt %s)"
229-
(thread-last name-spec-pairs
238+
(thread-last
239+
name-spec-pairs
230240
(mapcar (lambda (s)
231241
(concat "\n" (cl-first s) " " (cider-browse-spec--pprint (cl-second s)))))
232242
(cl-reduce #'concat)))))
233243
;; prettier (s/fspec )
234244
((cider--spec-fn-p form-tag "fspec")
235-
(thread-last (seq-partition (cl-rest form) 2)
245+
(thread-last
246+
(seq-partition (cl-rest form) 2)
236247
(cl-remove-if (lambda (s) (and (stringp (cl-second s))
237248
(string-empty-p (cl-second s)))))
238249
(mapcar (lambda (s)

0 commit comments

Comments
 (0)