43
43
:group 'haskell
44
44
:type 'string )
45
45
46
+ (defcustom haskell-mode-stylish-haskell-args nil
47
+ " Arguments to pass to program specified by haskell-mode-stylish-haskell-path."
48
+ :group 'haskell
49
+ :type 'list )
50
+
46
51
(defcustom haskell-interactive-set-+c
47
52
t
48
53
" Issue ':set +c' in interactive session to support type introspection."
@@ -806,9 +811,9 @@ stylish-haskell executable. This function tries to preserve
806
811
cursor position and markers by using
807
812
`haskell-mode-buffer-apply-command' ."
808
813
(interactive )
809
- (haskell-mode-buffer-apply-command haskell-mode-stylish-haskell-path))
814
+ (haskell-mode-buffer-apply-command haskell-mode-stylish-haskell-path haskell-mode-stylish-haskell-args ))
810
815
811
- (defun haskell-mode-buffer-apply-command (cmd )
816
+ (defun haskell-mode-buffer-apply-command (cmd &optional args )
812
817
" Execute shell command CMD with current buffer as input and output.
813
818
Use buffer as input and replace the whole buffer with the
814
819
output. If CMD fails the buffer remains unchanged."
@@ -817,9 +822,9 @@ output. If CMD fails the buffer remains unchanged."
817
822
(err-file (make-temp-file " stylish-error" )))
818
823
(unwind-protect
819
824
(let* ((_errcode
820
- (call-process-region (point-min ) (point-max ) cmd nil
821
- `((:file , out-file ) , err-file )
822
- nil ))
825
+ (apply ' call-process-region (point-min ) (point-max ) cmd nil
826
+ `((:file , out-file ) , err-file )
827
+ nil args ))
823
828
(err-file-empty-p
824
829
(equal 0 (nth 7 (file-attributes err-file))))
825
830
(out-file-empty-p
0 commit comments