|
4 | 4 |
|
5 | 5 | ;; Author: Oleh Krehel < [email protected]>
|
6 | 6 | ;; URL: https://github.com/abo-abo/lispy
|
7 |
| -;; Version: 0.23.0 |
| 7 | +;; Version: 0.26.0 |
8 | 8 | ;; Keywords: lisp
|
9 | 9 |
|
10 | 10 | ;; This file is not part of GNU Emacs
|
@@ -2456,25 +2456,27 @@ When the sexp is top-level, insert an additional newline."
|
2456 | 2456 | "Remove newlines from EXPR.
|
2457 | 2457 | When IGNORE-COMMENTS is not nil, don't remove comments.
|
2458 | 2458 | Instead keep them, with a newline after each comment."
|
2459 |
| - (lispy-mapcan-tree |
2460 |
| - (lambda (x y) |
2461 |
| - (cond ((equal x '(ly-raw newline)) |
2462 |
| - y) |
2463 |
| - ((lispy--raw-comment-p x) |
2464 |
| - (if (null ignore-comments) |
2465 |
| - (progn |
2466 |
| - (push x lispy--oneline-comments) |
2467 |
| - y) |
2468 |
| - (if (equal (car y) '(ly-raw newline)) |
2469 |
| - (cons x y) |
2470 |
| - `(,x (ly-raw newline) ,@y)))) |
2471 |
| - ((and (lispy--raw-string-p x) |
2472 |
| - (null ignore-comments)) |
2473 |
| - (cons `(ly-raw string ,(replace-regexp-in-string "\n" "\\\\n" (caddr x))) |
2474 |
| - y)) |
2475 |
| - (t |
2476 |
| - (cons x y)))) |
2477 |
| - expr)) |
| 2459 | + (if (vectorp expr) |
| 2460 | + (apply #'vector (lispy--oneline (mapcar #'identity expr))) |
| 2461 | + (lispy-mapcan-tree |
| 2462 | + (lambda (x y) |
| 2463 | + (cond ((equal x '(ly-raw newline)) |
| 2464 | + y) |
| 2465 | + ((lispy--raw-comment-p x) |
| 2466 | + (if (null ignore-comments) |
| 2467 | + (progn |
| 2468 | + (push x lispy--oneline-comments) |
| 2469 | + y) |
| 2470 | + (if (equal (car y) '(ly-raw newline)) |
| 2471 | + (cons x y) |
| 2472 | + `(,x (ly-raw newline) ,@y)))) |
| 2473 | + ((and (lispy--raw-string-p x) |
| 2474 | + (null ignore-comments)) |
| 2475 | + (cons `(ly-raw string ,(replace-regexp-in-string "\n" "\\\\n" (caddr x))) |
| 2476 | + y)) |
| 2477 | + (t |
| 2478 | + (cons x y)))) |
| 2479 | + expr))) |
2478 | 2480 |
|
2479 | 2481 | (defun lispy-oneline ()
|
2480 | 2482 | "Squeeze current sexp into one line.
|
|
0 commit comments