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

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

[nongnu] elpa/reformatter f5fbed9e7d 46/81: Close error window when ther


From: ELPA Syncer
Subject: [nongnu] elpa/reformatter f5fbed9e7d 46/81: Close error window when there is no errors to be shown
Date: Tue, 5 Sep 2023 04:03:36 -0400 (EDT)

branch: elpa/reformatter
commit f5fbed9e7d381e9b910421df9cd869d7e500df76
Author: Erick Navarro <erick@navarro.io>
Commit: Erick Navarro <erick@navarro.io>

    Close error window when there is no errors to be shown
    
    After fixing the code and if there is no more errors to be shown,
    error window kept open and it has to be closed manually
---
 reformatter.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/reformatter.el b/reformatter.el
index acf2aa9fb2..1262fcd695 100644
--- a/reformatter.el
+++ b/reformatter.el
@@ -183,12 +183,15 @@ DISPLAY-ERRORS, shows a buffer if the formatting fails."
                      (ansi-color-apply-on-region (point-min) (point-max)))
                    (special-mode))
                  (if (zerop retcode)
-                     (save-restriction
-                       ;; This replacement method minimises
-                       ;; disruption to marker positions and the
-                       ;; undo list
-                       (narrow-to-region beg end)
-                       (reformatter-replace-buffer-contents-from-file 
out-file))
+                     (progn
+                       (save-restriction
+                         ;; This replacement method minimises
+                         ;; disruption to marker positions and the
+                         ;; undo list
+                         (narrow-to-region beg end)
+                         (reformatter-replace-buffer-contents-from-file 
out-file))
+                         ;; if there is no errors the error-buffer shouldn't 
be kept open
+                       (delete-windows-on error-buffer))
                    (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]