4343 :group 'haskell
4444 :type 'string )
4545
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+
4651(defcustom haskell-interactive-set-+c
4752 t
4853 " Issue ':set +c' in interactive session to support type introspection."
@@ -806,9 +811,9 @@ stylish-haskell executable. This function tries to preserve
806811cursor position and markers by using
807812`haskell-mode-buffer-apply-command' ."
808813 (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 ))
810815
811- (defun haskell-mode-buffer-apply-command (cmd )
816+ (defun haskell-mode-buffer-apply-command (cmd &optional args )
812817 " Execute shell command CMD with current buffer as input and output.
813818Use buffer as input and replace the whole buffer with the
814819output. If CMD fails the buffer remains unchanged."
@@ -817,9 +822,9 @@ output. If CMD fails the buffer remains unchanged."
817822 (err-file (make-temp-file " stylish-error" )))
818823 (unwind-protect
819824 (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 ))
823828 (err-file-empty-p
824829 (equal 0 (nth 7 (file-attributes err-file))))
825830 (out-file-empty-p
0 commit comments