Commits

Stephen Weeks  committed 7016440

small cleanups to ocp-indent integration

  • Participants
  • Parent commits 58c73b6

Comments (0)

Files changed (5)

File jane-common.el

    (t 'local)))
 
 (defconst jane-dirs
-  '("elisp/jane"
+  '(
+    "ocp-indent"
+    "elisp/jane"
     "elisp/omake"
     "elisp/contrib"
     "elisp/contrib/tuareg"
 (dolist (dir jane-dirs)
   (add-to-list 'load-path (expand-file-name dir jane-home)))
 
+(require 'ocp-indent)
+
 (require 'jane-deprecated)
 (require 'jane-micro-features)
 (require 'jane-ocaml)

File ocp-indent/doit

 #!/bin/bash
 
-if [ ! $(ocp-indentt) ]; then
+set -e -u -o pipefail
+
+if ! which ocp-indent >/dev/null 2>&1; then
     echo "You don't have ocp-indent in your path."
     echo "Get it using"
     echo "  git clone https://github.com/OCamlPro/ocp-indent.git"
 fi
 
 rm -f ocp.ml tuareg.ml
-ocp-indent model.ml > ocp.ml
+ocp-indent model.ml >ocp.ml
 cp model.ml tuareg.ml
 emacs --batch --eval '(load-file "doit.el")'
 

File ocp-indent/ocp-indent-stdin

 #!/bin/bash
 
-ocp-indent <(while read line; do echo $line; done)
+set -e -u -o pipefail
+
+ocp-indent <(cat)

File ocp-indent/ocp-indent.el

 
-(defcustom Ocp.indent-program (format "%s/bin/ocp-indent-stdin" (getenv "HOME"))
-  "Program to use to indent your code")
-;; (setq Ocp.indent-program "/Users/seanmcl/bin/ocp-indent-stdin")
+(defcustom Ocp.indent-program
+  (concat (file-name-directory load-file-name) "ocp-indent-stdin")
+  ;; (format "%s/bin/ocp-indent-stdin" (getenv "HOME"))
+  "Program to use to indent your code"
+  )
 
 (defun Ocp.indentation ()
   (save-excursion

File ocp-indent/test-ocp-indent

 
 set -e -u -o pipefail
 
-if [[ $# -ne 1 ]]; then
+if (( $# != 1 )); then
     echo "Usage: $(basename $0) FILE"
     echo $#
     exit 1