@@ -376,27 +376,54 @@ following customization:
376
376
377
377
### Threading macros related features
378
378
379
- ` clojure-ts-thread ` : Thread another form into the surrounding thread. Both
380
- ` ->> ` /` some->> ` and ` -> ` /` some-> ` variants are supported.
379
+ There are a bunch of commands for threading and unwinding threaded Clojure forms:
381
380
382
- ` clojure-ts-unwind ` : Unwind a threaded expression. Supports both ` ->> ` /` some->> `
381
+ - ` clojure-ts-thread ` : Thread another form into the surrounding thread. Both
382
+ ` ->> ` /` some->> ` and ` -> ` /` some-> ` variants are supported.
383
+ - ` clojure-ts-unwind ` : Unwind a threaded expression. Supports both ` ->> ` /` some->> `
383
384
and ` -> ` /` some-> ` .
384
-
385
- ` clojure-ts-thread-first-all ` : Introduce the thread first macro (` -> ` ) and
385
+ - ` clojure-ts-thread-first-all ` : Introduce the thread first macro (` -> ` ) and
386
386
rewrite the entire form. With a prefix argument do not thread the last form.
387
-
388
- ` clojure-ts-thread-last-all ` : Introduce the thread last macro and rewrite the
387
+ - ` clojure-ts-thread-last-all ` : Introduce the thread last macro and rewrite the
389
388
entire form. With a prefix argument do not thread the last form.
390
-
391
- ` clojure-ts-unwind-all ` : Fully unwind a threaded expression removing the
389
+ - ` clojure-ts-unwind-all ` : Fully unwind a threaded expression removing the
392
390
threading macro.
393
391
392
+ #### Customize threading refactoring behavior
393
+
394
+ By default ` clojure-ts-thread-first-all ` and ` clojure-ts-thread-last-all ` will
395
+ thread all nested expressions. For example this expression:
396
+
397
+ ``` clojure
398
+ (->map (assoc {} :key " value" ) :lock )
399
+ ```
400
+
401
+ After executing ` clojure-ts-thread-last-all ` will be converted to:
402
+
403
+ ``` clojure
404
+ (-> {}
405
+ (assoc :key " value" )
406
+ (->map :lock ))
407
+ ```
408
+
409
+ This behavior can be changed by setting:
410
+
411
+ ``` emacs-lisp
412
+ (setopt clojure-ts-thread-all-but-last t)
413
+ ```
414
+
415
+ Then the last expression will not be threaded and the result will be:
416
+
417
+ ``` clojure
418
+ (-> (assoc {} :key " value" )
419
+ (->map :lock ))
420
+ ```
421
+
394
422
### Cycling things
395
423
396
- ` clojure-ts-cycle-keyword-string ` : Convert the string at point to a keyword and
424
+ - ` clojure-ts-cycle-keyword-string ` : Convert the string at point to a keyword and
397
425
vice versa.
398
-
399
- ` clojure-ts-cycle-privacy ` : Cycle privacy of ` def ` s or ` defn ` s. Use metadata
426
+ - ` clojure-ts-cycle-privacy ` : Cycle privacy of ` def ` s or ` defn ` s. Use metadata
400
427
explicitly with setting ` clojure-ts-use-metadata-for-defn-privacy ` to ` t ` for
401
428
` defn ` s too.
402
429
@@ -441,40 +468,10 @@ multi-arity function or macro. Function can be defined using `defn`, `fn` or
441
468
By default prefix for all refactoring commands is ` C-c C-r ` . It can be changed
442
469
by customizing ` clojure-ts-refactor-map-prefix ` variable.
443
470
444
- ### Customize threading refactoring behavior
445
-
446
- By default ` clojure-ts-thread-first-all ` and ` clojure-ts-thread-last-all ` will
447
- thread all nested expressions. For example this expression:
448
-
449
- ``` clojure
450
- (->map (assoc {} :key " value" ) :lock )
451
- ```
452
-
453
- After executing ` clojure-ts-thread-last-all ` will be converted to:
454
-
455
- ``` clojure
456
- (-> {}
457
- (assoc :key " value" )
458
- (->map :lock ))
459
- ```
460
-
461
- This behavior can be changed by setting:
462
-
463
- ``` emacs-lisp
464
- (setopt clojure-ts-thread-all-but-last t)
465
- ```
466
-
467
- Then the last expression will not be threaded and the result will be:
468
-
469
- ``` clojure
470
- (-> (assoc {} :key " value" )
471
- (->map :lock ))
472
- ```
473
-
474
471
## Migrating to clojure-ts-mode
475
472
476
473
If you are migrating to ` clojure-ts-mode ` note that ` clojure-mode ` is still
477
- required for cider and clj-refactor packages to work properly.
474
+ required for CIDER and ` clj-refactor ` packages to work properly.
478
475
479
476
After installing the package do the following:
480
477
0 commit comments