4
# GNU sed compilance (q-specifier)
6
# Author: Nick R. Papior, 2016
8
# This small script ensures a custom setting of
9
# variables for consistent editing of files across
10
# platforms and user-boxes.
12
# Essentially the script sets the design choices
13
# regarding the indentation and other settings.
15
# Each file has the settings at the end of the file
16
# The settings MUST be the last lines in each file.
18
_LINE_END="buds -- local file settings"
20
# Here are the fortran local variables
22
for v in do if structure continuation associate \
28
function update_setting() {
29
# Set settings in this file:
34
function clean_tmp() {
38
# We use this fixed file-name...
39
# I hardly think anybody would like to
40
# seriously create a file named this
41
sed -e "/$_LINE_END/Q" $f > .tmp_file
46
echo "! project-$_LINE_END"
47
echo "! Anything below this line may be overwritten by scripts"
48
echo "! Below are non-editable settings"
55
echo "! Local Variables:"
56
# Note that if users override the f90
57
# format name, we cannot do anything about it...
61
echo "! $key: ${fv[$key]}"
66
echo "Error, could not figure out file type"
82
[ -z "${f}" ] && continue
84
done < $d/files.fortran