branch: elpa/macrostep
commit d1e954de8e13853f91a8e41e8b68e14de260cab0
Author: joddie <[email protected]>
Commit: joddie <[email protected]>
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)