|
40 | 40 |
|
41 | 41 | ;; ## Insertion
|
42 | 42 |
|
43 |
| -(defn prepend-space |
44 |
| - "Prepend a whitespace node representing the given number of spaces (default: 1)." |
45 |
| - ([zloc] (prepend-space zloc 1)) |
| 43 | +(defn ^{:added "0.5.0"} insert-space-left |
| 44 | + "Insert a whitespace node before the given one, representing the given |
| 45 | + number of spaces (default: 1)." |
| 46 | + ([zloc] (insert-space-left zloc 1)) |
46 | 47 | ([zloc n]
|
47 | 48 | {:pre [(>= n 0)]}
|
48 | 49 | (if (pos? n)
|
49 | 50 | (z/insert-left zloc (node/spaces n))
|
50 | 51 | zloc)))
|
51 | 52 |
|
52 |
| -(defn append-space |
53 |
| - "Append a whitespace node representing the given number of spaces (default: 1)." |
54 |
| - ([zloc] (append-space zloc 1)) |
| 53 | +(defn ^{:added "0.5.0"} insert-space-right |
| 54 | + "Insert a whitespace node after the given one, representing the given number |
| 55 | + of spaces (default: 1)." |
| 56 | + ([zloc] (insert-space-right zloc 1)) |
55 | 57 | ([zloc n]
|
56 | 58 | {:pre [(>= n 0)]}
|
57 | 59 | (if (pos? n)
|
58 | 60 | (z/insert-right zloc (node/spaces n))
|
59 | 61 | zloc)))
|
60 | 62 |
|
61 |
| -(defn prepend-newline |
62 |
| - "Prepend a whitespace node representing the given number of spaces (default: 1)." |
63 |
| - ([zloc] (prepend-newline zloc 1)) |
| 63 | +(defn ^{:added "0.5.0"} insert-newline-left |
| 64 | + "Insert a newline node before the given one, representing the given number of |
| 65 | + spaces (default: 1)." |
| 66 | + ([zloc] (insert-newline-left zloc 1)) |
64 | 67 | ([zloc n]
|
65 | 68 | (z/insert-left zloc (node/newlines n))))
|
66 | 69 |
|
67 |
| -(defn append-newline |
68 |
| - "Append a whitespace node representing the given number of spaces (default: 1)." |
69 |
| - ([zloc] (append-newline zloc 1)) |
| 70 | +(defn ^{:added "0.5.0"} insert-newline-right |
| 71 | + "Insert a newline node after the given one, representing the given number of |
| 72 | + linebreaks (default: 1)." |
| 73 | + ([zloc] (insert-newline-right zloc 1)) |
70 | 74 | ([zloc n]
|
71 | 75 | (z/insert-right zloc (node/newlines n))))
|
| 76 | + |
| 77 | +;; ## Deprecated Functions |
| 78 | + |
| 79 | +(defn ^{:deprecated "0.5.0"} prepend-space |
| 80 | + "Prepend a whitespace node representing the given number of spaces (default: 1). |
| 81 | +
|
| 82 | + DEPRECATED: use 'insert-space-left' instead." |
| 83 | + [zloc & [n]] |
| 84 | + (insert-space-left zloc (or n 1))) |
| 85 | + |
| 86 | +(defn ^{:deprecated "0.5.0"} append-space |
| 87 | + "Append a whitespace node representing the given number of spaces (default: 1). |
| 88 | +
|
| 89 | + DEPRECATED: use 'insert-space-right' instead." |
| 90 | + [zloc & [n]] |
| 91 | + (insert-space-right zloc (or n 1))) |
| 92 | + |
| 93 | +(defn ^{:deprecated "0.5.0"} prepend-newline |
| 94 | + "Prepend a newline node representing the given number of linebreaks (default: |
| 95 | + 1). |
| 96 | +
|
| 97 | + DEPRECATED: use 'insert-newline-left' instead." |
| 98 | + [zloc & [n]] |
| 99 | + (insert-newline-left zloc (or n 1))) |
| 100 | + |
| 101 | +(defn ^{:deprecated "0.5.0"} append-newline |
| 102 | + "Append a newline node representing the given number of linebreaks (default: |
| 103 | + 1). |
| 104 | +
|
| 105 | + DEPRECATED: use 'insert-newline-right' instead." |
| 106 | + [zloc & [n]] |
| 107 | + (insert-newline-right zloc (or n 1))) |
0 commit comments