lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GOP2-4: add script for batch indenting Scheme files (issue 6450162)


From: john . mandereau
Subject: GOP2-4: add script for batch indenting Scheme files (issue 6450162)
Date: Mon, 20 Aug 2012 10:00:44 +0000

Reviewers: ,

Message:
Note: these two new files (.dir-locals.el from David Kastrup and
fixscm.sh from me) actually operate independently, see
http://lists.gnu.org/archive/html/lilypond-devel/2012-08/msg00450.html

and so they may be applied independently one from the other; if both are
applied, they will be in separate commits.

Description:
GOP2-4: add script for batch indenting Scheme files

Establish some coding styles in Emacs

This uses directory variables to enforce some coding style features in
C++, Scheme and Texinfo files in the source tree.

Please review this at http://codereview.appspot.com/6450162/

Affected files:
  A .dir-locals.el
  A scripts/auxiliar/fixscm.sh


Index: .dir-locals.el
diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000000000000000000000000000000000000..72472a6055d9deeb7eac214bb61e06e9cb8c74cc
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,11 @@
+;;; Directory Local Variables
+;;; See Info node `(emacs) Directory Variables' for more information.
+
+((c++-mode
+  (c-default-style . "gnu")
+  (indent-tabs-mode))
+ (scheme-mode
+  (indent-tabs-mode))
+ (texinfo-mode
+  (fill-column . 66)
+  (indent-tabs-mode)))
Index: scripts/auxiliar/fixscm.sh
diff --git a/scripts/auxiliar/fixscm.sh b/scripts/auxiliar/fixscm.sh
new file mode 100755
index 0000000000000000000000000000000000000000..fb733dba08ed12a708b18d0bb8e9165d7fe5e5f5
--- /dev/null
+++ b/scripts/auxiliar/fixscm.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# Indent and untabify source files (given by their
+# filenames in the command line), according to
+# LilyPond source style standards.
+# This relies on having indent style set up with
+# Emacs starting without arguments, e.g. by a
+# .dir-locals.el at top of the source tree.
+
+elisp_expression='(progn
+  (delete-trailing-whitespace)
+  (indent-region (point-min) (point-max) nil)
+  (untabify (point-min) (point-max))
+  (save-buffer))'
+emacs -batch "$@" --eval "${elisp_expression}"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]