about summary refs log tree commit diff
path: root/nix-yapf-mode.el
blob: 9dba47bd361420709bdafc6085bc3a416eddf71a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
;;; ~/.doom.d/nix-yapf-mode.el -*- lexical-binding: t; -*-


(defun +grfn/yapfify-call-bin (input-buffer output-buffer start-line end-line)
  (with-current-buffer input-buffer
    (call-process-region
     (point-min)
     (point-max)
     "nix-shell"
     nil
     (list output-buffer nil)
     nil
     "/home/griffin/code/urb/grid/yapf.nix"
     "--run"
     (concat
      "yapf -l "
      (number-to-string start-line)
      "-"
      (number-to-string end-line)))))

(advice-add #'yapfify-call-bin :override #'+grfn/yapfify-call-bin)