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

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

[nongnu] elpa/macrostep d1e954d 099/110: Attempt to shell out to "indent


From: ELPA Syncer
Subject: [nongnu] elpa/macrostep d1e954d 099/110: Attempt to shell out to "indent" in macrostep-c
Date: Sat, 7 Aug 2021 09:18:11 -0400 (EDT)

branch: elpa/macrostep
commit d1e954de8e13853f91a8e41e8b68e14de260cab0
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>

    Attempt to shell out to "indent" in macrostep-c
---
 macrostep-c.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/macrostep-c.el b/macrostep-c.el
index 3bf0a5d..a5bc0d9 100644
--- a/macrostep-c.el
+++ b/macrostep-c.el
@@ -161,6 +161,12 @@
         (mapcar #'string-trim (list expansion warnings))))))
 
 (defun macrostep-c-print-function (expansion &rest _ignore)
+  (with-temp-buffer
+    (insert expansion)
+    (let ((exit-code
+           (shell-command-on-region (point-min) (point-max) "indent" nil t)))
+      (when (zerop exit-code)
+        (setq expansion (string-trim (buffer-string))))))
   (insert expansion))
 
 (provide 'macrostep-c)



reply via email to

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