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

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

[nongnu] elpa/reformatter 664fa96fd0 24/81: Add/update comments


From: ELPA Syncer
Subject: [nongnu] elpa/reformatter 664fa96fd0 24/81: Add/update comments
Date: Tue, 5 Sep 2023 04:03:34 -0400 (EDT)

branch: elpa/reformatter
commit 664fa96fd068f7b20e49c5ec16299888fced31db
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>

    Add/update comments
---
 reformatter.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/reformatter.el b/reformatter.el
index 34baedefdb..b1c2dcc0f1 100644
--- a/reformatter.el
+++ b/reformatter.el
@@ -164,6 +164,10 @@ DISPLAY-ERRORS, shows a buffer if the formatting fails."
          (interactive "rp")
          (let* ((err-file (make-temp-file ,(symbol-name name)))
                 (out-file (make-temp-file ,(symbol-name name)))
+                ;; Setting this coding sysmte might not universally be
+                ;; the best default, but was apparently necessary for
+                ;; some hand-rolled reformatter functions that this
+                ;; library was written to replace.
                 (coding-system-for-read 'utf-8)
                 (coding-system-for-write 'utf-8))
            (unwind-protect
@@ -179,16 +183,15 @@ DISPLAY-ERRORS, shows a buffer if the formatting fails."
                      (ansi-color-apply-on-region (point-min) (point-max)))
                    (special-mode))
                  (if (eq retcode 0)
-                     (progn
-                       (save-restriction
-                         ;; This replacement method minimises
-                         ;; disruption to marker positions and the
-                         ;; undo list
-                         (narrow-to-region beg end)
-                         (insert-file-contents out-file nil nil nil t)
-                         ;; In future this might be made optional, or a 
user-provided
-                         ;; ":after" form could be inserted for execution
-                         (whitespace-cleanup)))
+                     (save-restriction
+                       ;; This replacement method minimises
+                       ;; disruption to marker positions and the
+                       ;; undo list
+                       (narrow-to-region beg end)
+                       (insert-file-contents out-file nil nil nil t)
+                       ;; In future this might be made optional, or a 
user-provided
+                       ;; ":after" form could be inserted for execution
+                       (whitespace-cleanup))
                    (if display-errors
                        (display-buffer error-buffer)
                      (message ,(concat (symbol-name name) " failed: see %s") 
(buffer-name error-buffer)))))



reply via email to

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