File: indent-matlab

package info (click to toggle)
dynare 6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 67,796 kB
  • sloc: cpp: 79,110; ansic: 28,917; objc: 12,445; yacc: 4,537; pascal: 1,993; lex: 1,441; sh: 1,132; python: 634; makefile: 628; lisp: 163; xml: 18
file content (19 lines) | stat: -rwxr-xr-x 415 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

# Reindents the MATLAB source code files given in argument

[[ -n $1 ]] || { echo "Give filename(s) in argument" 2>&1; exit 1; }

pushd "$(dirname "$0")" > /dev/null
SCRIPTS_DIR=$(pwd)
popd > /dev/null

for f in "$@"; do
    echo "*** Indenting $f…"

    pushd "$(dirname "$f")" > /dev/null
    emacs -batch "$(basename "$f")" -l "${SCRIPTS_DIR}"/indent-matlab.el
    popd > /dev/null

    echo
done