emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/paredit 856d927 180/224: Use `paredit-preserving-column' i


From: ELPA Syncer
Subject: [nongnu] elpa/paredit 856d927 180/224: Use `paredit-preserving-column' in `paredit-reindent-defun'.
Date: Sat, 7 Aug 2021 09:22:45 -0400 (EDT)

branch: elpa/paredit
commit 856d927bfb94c9a39005a92a7c71ba8f62a42115
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>

    Use `paredit-preserving-column' in `paredit-reindent-defun'.
---
 paredit.el | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/paredit.el b/paredit.el
index 0be1477..a79db21 100644
--- a/paredit.el
+++ b/paredit.el
@@ -1015,21 +1015,11 @@ If the point is in a string or a comment, fill the 
paragraph instead,
   (if (or (paredit-in-string-p)
           (paredit-in-comment-p))
       (lisp-fill-paragraph argument)
-    (let ((column (current-column))
-          (indentation (paredit-current-indentation)))
-      (save-excursion (end-of-defun) (beginning-of-defun) (indent-sexp))
-      ;; Preserve the point's position either in the indentation or in
-      ;; the code: if on code, move with the code; if in indentation,
-      ;; leave it in the indentation, either where it was (if that's
-      ;; still indentation) or at the end of the indentation (if the
-      ;; code moved far enough left).
-      (let ((indentation* (paredit-current-indentation)))
-        (goto-char
-         (+ (point-at-bol)
-            (cond ((not (< column indentation))
-                   (+ column (- indentation* indentation)))
-                  ((<= indentation* column) indentation*)
-                  (t column))))))))
+    (paredit-preserving-column
+      (save-excursion
+        (end-of-defun)
+        (beginning-of-defun)
+        (indent-sexp)))))
 
 ;;;; Comment Insertion
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]