Skip to content

Commit e98f88a

Browse files
committed
Remove esy-opam-npx setup
1 parent 5e6205c commit e98f88a

1 file changed

Lines changed: 3 additions & 34 deletions

File tree

refmt.el

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,8 @@
3636

3737
(require 'cl-lib)
3838

39-
(defvar-local refmt-opam-bin-dir nil)
40-
41-
(defcustom refmt-command "refmt"
42-
"The 'refmt' command."
43-
:type '(choice (file :tag "Filename (default binary is \"refmt\")")
44-
(const :tag "Use current opam switch" opam)
45-
(const :tag "Use current npm version (via npx)" npm)
46-
(const :tag "Use current esy version (via esy exec-command)" esy))
47-
:group 're-fmt)
39+
(defvar refmt-command "refmt"
40+
"The 'refmt' command.")
4841

4942
(defcustom refmt-show-errors 'buffer
5043
"Where to display refmt error output.
@@ -203,31 +196,7 @@ function."
203196
(erase-buffer))
204197
(if (zerop (let* ((files (list (list :file outputfile) errorfile))
205198
(args (append width-args (list "--parse" from "--print" to bufferfile))))
206-
(cond ((equal refmt-command 'opam)
207-
;; this was originally done via `opam exec' but that does not
208-
;; work for opam 1, and added a performance hit
209-
(progn
210-
(when (not refmt-opam-bin-dir)
211-
(setq-local
212-
refmt-opam-bin-dir
213-
(with-temp-buffer
214-
(when (eq (call-process-shell-command
215-
"opam config var bin" nil (current-buffer) nil) 0)
216-
(replace-regexp-in-string "\n$" "" (buffer-string))))))
217-
218-
(apply 'call-process (concat refmt-opam-bin-dir "/refmt") nil files nil args)))
219-
220-
((equal refmt-command 'npm)
221-
(apply 'call-process
222-
"npx" nil files nil (append '("refmt") args)))
223-
224-
((equal refmt-command 'esy)
225-
(apply 'call-process
226-
"esy" nil files nil (append '("exec-command" "refmt") args)))
227-
228-
(t
229-
(apply 'call-process
230-
refmt-command nil files nil args)))))
199+
(apply 'call-process refmt-command nil files nil args)))
231200
(progn
232201
(call-process-region start end "diff" nil patchbuf nil "-n" "-"
233202
outputfile)

0 commit comments

Comments
 (0)