LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File otp-R15B03-1-alt.patch of Package erlang (Project home:Ledest:erlang:R15)

 erts/configure.in                           |  40 +-
 erts/emulator/Makefile.in                   |  12 +-
 erts/emulator/zlib/zlib.mk                  |   2 +-
 erts/lib_src/Makefile.in                    |   2 +-
 lib/Makefile                                |   4 +-
 lib/asn1/c_src/Makefile                     |   2 +-
 lib/crypto/priv/Makefile                    |   2 +-
 lib/erl_docgen/priv/js/flipmenu/flipmenu.js | 704 ++++++++++++++--------------
 lib/inets/test/rules.mk                     |   2 -
 lib/kernel/examples/uds_dist/c_src/Makefile |   2 +-
 lib/megaco/src/rules.mk                     |   2 +-
 lib/stdlib/src/supervisor.erl               |   4 +-
 lib/tools/c_src/Makefile.in                 |   2 +-
 lib/tools/emacs/Makefile                    |   2 +-
 lib/tools/emacs/test.erl.orig               | 702 ---------------------------
 lib/tools/emacs/test.erl.original           | 702 +++++++++++++++++++++++++++
 lib/wx/api_gen/Makefile                     |   2 +-
 make/otp.mk.in                              |   3 -
 18 files changed, 1077 insertions(+), 1114 deletions(-)

diff --git a/erts/configure.in b/erts/configure.in
index 6ad1951..6fbe19a 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -449,35 +449,6 @@ dnl
 
 extra_flags="-I${ERL_TOP}/erts/$host $OTP_EXTRA_FLAGS"
 CFLAGS="$CFLAGS $extra_flags"
-DEBUG_CFLAGS="-g $CPPFLAGS $extra_flags"
-DEBUG_FLAGS=-g
-
-dnl
-dnl Adjust DEBUG_CFLAGS to match CFLAGS in terms of -m
-dnl
-
-case $CFLAGS in
-	*-m64*)
-		case $DEBUG_CFLAGS in
-			*-m64*)
-				;;
-			*)
-				DEBUG_CFLAGS="-m64 $DEBUG_CFLAGS"
-				;;
-		esac
-		;;
-	*-m32*)
-		case $DEBUG_CFLAGS in
-			*-m32*)
-				;;
-			*)
-				DEBUG_CFLAGS="-m32 $DEBUG_CFLAGS"
-				;;
-		esac
-		;;
-	*)
-		;;
-esac
 
 
 
@@ -492,6 +463,9 @@ case $host_os in
   osf*)
 	CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-rpath,"
 	;;
+  linux*)
+	CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-rpath,"
+	;;
   *)
 	;;
 esac
@@ -560,8 +534,7 @@ if test "x$GCC" = xyes; then
 else
   WFLAGS=""
 fi
-dnl DEBUG_FLAGS is obsolete (I hope)
-AC_SUBST(DEBUG_FLAGS)
+
 AC_SUBST(DEBUG_CFLAGS)
 AC_SUBST(WFLAGS)
 AC_SUBST(CFLAG_RUNTIME_LIBRARY_PATH)
@@ -588,7 +561,7 @@ fi
 case $chk_opsys_ in
     win32)			OPSYS=win32;;
     solaris2.*|SunOS5.*)	OPSYS=sol2;;
-    linux|Linux)		OPSYS=linux;;
+    linux*|Linux)		OPSYS=linux;;
     darwin|Darwin)		OPSYS=darwin;;
     freebsd|FreeBSD)		OPSYS=freebsd;;
     *)				OPSYS=noopsys
@@ -4216,6 +4189,8 @@ if test "x$SSL_APP" != "x" ; then
 		"$erl_xcomp_isysroot/cygdrive/c/kerberos/include" \
 		"$erl_xcomp_isysroot/usr/local/kerberos/include" \
 		"$erl_xcomp_isysroot/usr/kerberos/include" \
+		"$erl_xcomp_isysroot/usr/include/krb5/krb5" \
+		"$erl_xcomp_isysroot/usr/include/krb5" \
 		"$erl_xcomp_isysroot/usr/include"
 	do
             if test -f "$dir/krb5.h" ; then
@@ -4249,6 +4224,7 @@ ld_rflg="$LDFLAG_RUNTIME_LIBRARY_PATH"
 ded_ld_rflg="$DED_LD_FLAG_RUNTIME_LIBRARY_PATH"
 
 if test "$SSL_APP" != "" && test "$SSL_DYNAMIC_ONLY" = "yes" && \
+   test "$OPSYS" != "linux" &&
    { test "$cc_rflg" != "" || test "$ld_rflg" != "" || test "$ded_ld_rflg" != ""; } ; then
 
     AC_MSG_CHECKING(for ssl runtime library path to use)
diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in
index 985ef72..f120ffe 100644
--- a/erts/emulator/Makefile.in
+++ b/erts/emulator/Makefile.in
@@ -223,14 +223,6 @@ ifeq (@EMU_LOCK_CHECKING@,yes)
 NO_INLINE_FUNCTIONS=true
 endif
 
-ifneq ($(filter tile-%,$(TARGET)), )
-# -O2 generally produces faster for tile-cc, because the code is smaller.
-# Since tile-cc looks like gcc, we need to override the normal gcc -O3 setting.
-OPT_LEVEL = -O2
-else
-OPT_LEVEL = -O3
-endif
-
 ifeq ($(GCC),yes)
 ifeq ($(NO_INLINE_FUNCTIONS),true)
 GEN_OPT_FLGS = $(OPT_LEVEL) -fno-inline-functions
@@ -875,7 +867,7 @@ $(OBJDIR)/%.o: hipe/%.S
 	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
 
 $(OBJDIR)/%.o: hipe/%.c
-	$(CC) $(subst O2,O3, $(CFLAGS)) $(INCLUDES) -c $< -o $@
+	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
 
 $(BINDIR)/hipe_mkliterals$(TF_MARKER):	$(OBJDIR)/hipe_mkliterals.o
 	$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
@@ -927,7 +919,7 @@ $(OBJDIR)/hipe_arm_bifs.o:	$(TTF_DIR)/hipe_arm_bifs.S \
 # Use -fomit-frame-pointer to work around gcc (v4.5.2) bug causing
 # "error: r7 cannot be used in asm here" for DEBUG build.
 $(OBJDIR)/hipe_arm.o:           hipe/hipe_arm.c
-	$(CC) $(subst O2,O3, $(CFLAGS)) -fomit-frame-pointer $(INCLUDES) -c $< -o $@
+	$(CC) $(CFLAGS) -fomit-frame-pointer $(INCLUDES) -c $< -o $@
 
 # end of HiPE section
 ########################################
diff --git a/erts/emulator/zlib/zlib.mk b/erts/emulator/zlib/zlib.mk
index fa1f159..900faab 100644
--- a/erts/emulator/zlib/zlib.mk
+++ b/erts/emulator/zlib/zlib.mk
@@ -53,7 +53,7 @@ else  # gcov
 ifeq ($(TYPE),debug)
 ZLIB_CFLAGS = $(DEBUG_CFLAGS) $(DEFS) $(THR_DEFS)
 else # debug
-ZLIB_CFLAGS = $(subst -O2, -O3, $(CONFIGURE_CFLAGS) $(DEFS) $(THR_DEFS))
+ZLIB_CFLAGS = $(CONFIGURE_CFLAGS) $(DEFS) $(THR_DEFS)
 #ZLIB_CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
 #ZLIB_CFLAGS=-g -DDEBUG
 #ZLIB_CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
diff --git a/erts/lib_src/Makefile.in b/erts/lib_src/Makefile.in
index aed889e..f0e4180 100644
--- a/erts/lib_src/Makefile.in
+++ b/erts/lib_src/Makefile.in
@@ -37,7 +37,7 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@
 ERLANG_OSTYPE=@ERLANG_OSTYPE@
 
 OMIT_FP=false
-CFLAGS=$(subst O2,O3, @CFLAGS@)
+CFLAGS=@CFLAGS@
 
 ifeq ($(TYPE),debug)
 CFLAGS=@DEBUG_CFLAGS@ -DDEBUG
diff --git a/lib/Makefile b/lib/Makefile
index 3753bd1..f639658 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -19,13 +19,13 @@
 include $(ERL_TOP)/make/target.mk
 include $(ERL_TOP)/make/$(TARGET)/otp.mk
 
-ERTS_SUB_DIRECTORIES = stdlib sasl kernel compiler
+ERTS_SUB_DIRECTORIES = parsetools stdlib sasl kernel compiler
 OTHER_SUB_DIRECTORIES = tools test_server common_test runtime_tools
 ifdef BUILD_ALL
   OTHER_SUB_DIRECTORIES += \
           snmp otp_mibs appmon erl_interface asn1 jinterface \
           wx debugger reltool gs inets \
-          ic mnesia crypto orber os_mon parsetools syntax_tools \
+          ic mnesia crypto orber os_mon syntax_tools \
           pman public_key ssl toolbar tv observer odbc \
           diameter \
           cosTransactions cosEvent cosTime cosNotification \
diff --git a/lib/asn1/c_src/Makefile b/lib/asn1/c_src/Makefile
index a73d01a..1ab63e4 100644
--- a/lib/asn1/c_src/Makefile
+++ b/lib/asn1/c_src/Makefile
@@ -99,7 +99,7 @@ docs:
 
 
 $(OBJDIR)/%.o: %.c
-	$(CC) -c $(CFLAGS) -O3 -o $@ $<
+	$(CC) -c $(CFLAGS) -o $@ $<
 
 $(NIF_SHARED_OBJ_FILE): $(NIF_OBJ_FILES)
 	$(LD) $(LDFLAGS) -o $(NIF_SHARED_OBJ_FILE) $(NIF_OBJ_FILES) $(CLIB_FLAGS) $(LIBS)
diff --git a/lib/crypto/priv/Makefile b/lib/crypto/priv/Makefile
index 0989f14..40a85b6 100644
--- a/lib/crypto/priv/Makefile
+++ b/lib/crypto/priv/Makefile
@@ -60,7 +60,7 @@ OBJS = $(OBJDIR)/crypto.o
 # ----------------------------------------------------
 
 $(SO_NIFLIB): $(OBJS)
-	$(SO_LD) $(SO_LDFLAGS) -L$(SO_SSL_LIBDIR) -Wl,-R$(SO_SSL_LIBDIR) \
+	$(SO_LD) $(SO_LDFLAGS) -L$(SO_SSL_LIBDIR) -Wl,-rpath,(SO_SSL_LIBDIR) \
 	-o $@ $^ -lcrypto
 
 $(DLL_NIFLIB): $(OBJS)
diff --git a/lib/erl_docgen/priv/js/flipmenu/flipmenu.js b/lib/erl_docgen/priv/js/flipmenu/flipmenu.js
index 1f70f25..f3c41fa 100644
--- a/lib/erl_docgen/priv/js/flipmenu/flipmenu.js
+++ b/lib/erl_docgen/priv/js/flipmenu/flipmenu.js
@@ -1,352 +1,352 @@
-// ######################################################################
-
-// ## flipMenu 5.0.0 (c) J. Reijers
-// ## Last modifications: 23 March 2007
-
-// ######################################################################
-
-// ## Degree of indentation from the left.
-	flipIndentation = "5px";
-
-// ## Padding inbetween menu items.
-	flipVerticalPadding = "4px";
-
-// ## Margin between the left of the browser and the menu.
-	flipLeftMargin = "16px";
-
-// ## Margin between the top of the browser and the menu.
-	flipTopMargin = "10px";
-
-// ## Allow multiple menus to fold out without closing all the other open ones.
-	flipOpenMultipleMenus = false;
-
-// ## Preserve the current state of the menu (requires cookies).
-	flipSaveMenuState = false;
-
-// ## Open entries where the attribute expanded is true
-	flipMarked = true;
-
-// ## Use custom images for bullets
-	flipImages = true;
-
-// ## Images to use (specify full path)
-	flipImg_open   = "flip_open.gif";
-	flipImg_closed = "flip_closed.gif";
-	flipImg_static = "flip_static.gif";
-
-// ## Initialise all flipMenus onload
-	flipInitOnLoad = true;
-
-// ## Message to display in status bar while loading
-	flipLoadingMessage = "Loading...";
-
-// ######################################################################
-
-function alterSize(someSize, alterAmount) {
-	someSize = String(someSize);
-	var tmpNr = parseFloat(someSize.replace(/\D/g, ""));
-	var tmpChar = someSize.replace(/\d/g, "");
-	return isNaN(tmpNr) ? someSize : ((tmpNr + alterAmount) + tmpChar);
-}
-
-isIE = (String(navigator.appVersion).indexOf("MSIE") > -1);
-if (!isIE) flipIndentation = alterSize(flipIndentation, -16);
-if (!isIE) flipLeftMargin = alterSize(flipLeftMargin, -16);
-
-document.write(
-	"<style type=\"text/css\">" +
-
-	"ul.flipMenu { margin-top: " + flipTopMargin + "; margin-left: " + flipLeftMargin + "; " + (flipImages ? "" : "list-style-type: none;") + " }" +
-	"ul.flipMenu ul, ul.flipMenu li { padding-top: " + flipVerticalPadding + "; margin-left: " + flipIndentation + "; margin-right: 0px; " + (flipImages ? "" : "list-style-type: none;") + " }" +
-
-	"li.flipFolderOpen { cursor: pointer; " + (flipImages ? "list-style-image: url(" + document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_open + ");" : "") + " }" +
-	"li.flipFolderClosed { cursor: pointer; " + (flipImages ? "list-style-image: url(" + document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_closed + ");" : "") + " }" +
-
-	"</style>"
-);
-         
-
-
-if (flipImages) {
-	aFlipPreloads = [];
-	aFlipPreloads[0] = new Image;
-	aFlipPreloads[0].src = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_open;
-	aFlipPreloads[1] = new Image;
-	aFlipPreloads[1].src = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_closed;
-	aFlipPreloads[2] = new Image;
-	aFlipPreloads[2].src = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_static;
-}
-
-function addEvent(someObj, someEvent, someFunction) {
-	if (someObj.addEventListener) { someObj.addEventListener(someEvent, someFunction, true); return true; } else if (someObj.attachEvent) return someObj.attachEvent("on" + someEvent, someFunction); else return false;
-}
-
-function openCloseFlip(theItem, newSetting, openParents) {
-	if (theItem.flipID) {
-		if (openParents) {
-			var tmpItem = theItem;
-			while (tmpItem.parentElement || tmpItem.parentNode) {
-				tmpItem = (tmpItem.parentElement) ? tmpItem.parentElement : tmpItem.parentNode;
-				openCloseFlip(tmpItem, newSetting);
-			}
-		}
-		if ((theItem.className == "flipFolderOpen" && newSetting == "closed") || (theItem.className == "flipFolderClosed" && newSetting == "open")) {
-			if (!theItem.childrenInitialised) {
-				for (var j = 0; j < theItem.childNodes.length; j++) if (theItem.childNodes[j].nodeName == "UL" && !theItem.childNodes[j].initialised) initFlip(theItem.childNodes[j]);
-				theItem.childrenInitialised = true;
-			}
-			theItem.getElementsByTagName("UL")[0].style.display = (newSetting == "open") ? "" : "none";
-			theItem.className = newSetting == "open" ? "flipFolderOpen" : "flipFolderClosed";
-		}
-	}
-}
-
-function openFlip(theItem, openParents) {
-	openCloseFlip(theItem, "open", openParents);
-}
-
-function closeFlip(theItem, closeParents) {
-	openCloseFlip(theItem, "closed", closeParents);
-}
-
-function toggleFlip(theElement) {
-	if (theElement.flipID) {
-		var theItem = theElement;
-		var isContained = true;
-	} else {
-		if (theElement && theElement.button > 0) return false;
-		var theItem = (isIE) ? event.srcElement : theElement.target;
-
-		var isContained = false;
-		if (theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed") isContained = true; else while (theItem.parentElement || theItem.parentNode) {
-			if (theItem.className == "flipStatic" || theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed") {
-				isContained = (theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed");
-				break;
-			}
-			theItem = (theItem.parentElement) ? theItem.parentElement : theItem.parentNode;
-		}
-	}
-
-	var toOpenFlip = (isContained && theItem.className == "flipFolderClosed");
-
-	if (!flipOpenMultipleMenus && (toOpenFlip || theItem.className == "flipStatic")) {
-		if (theItem.parentElement || theItem.parentNode) {
-			var parentUL = (theItem.parentElement) ? theItem.parentElement : theItem.parentNode;
-			for (var i = 0; i < parentUL.childNodes.length; i++) closeFlip(parentUL.childNodes[i]);
-		}
-	}
-
-	if (isContained) {
-		if (toOpenFlip) openFlip(theItem); else closeFlip(theItem);
-	}
-}
-
-function setAllFlips(startElement, newSetting) {
-	if (typeof startElement == "undefined") var startElement = document;
-	if (typeof newSetting == "undefined") var newSetting = "closed";
-
-	var aUL = startElement.getElementsByTagName("UL");
-	for (var i = 0; i < aUL.length; i++) {
-		var parentFlip = aUL[i].parentElement ? aUL[i].parentElement : aUL[i].parentNode;
-		openCloseFlip(parentFlip, newSetting);
-	}
-}
-
-function openAllFlips(startElement) {
-	setAllFlips(startElement, "open");
-}
-
-function closeAllFlips(startElement) {
-	setAllFlips(startElement, "closed");
-}
-
-function initFlip(startElement) {
-	if (!document.createElement) return false;
-
-	if (!startElement || !startElement.nodeName) {
-		var aUL = document.getElementsByTagName("UL");
-		for (var i = 0; i < aUL.length; i++) {
-			if (flipLoadingMessage != "") window.status = flipLoadingMessage + " " + parseInt((i / (aUL.length - 1)) * 100, 10) + "%";
-			var curUL = aUL[i];
-			if (curUL.className == "flipMenu") {
-				initFlip(curUL);
-
-				// ## Fix text selecting problem in Mozilla
-				curUL.onselectstart = new Function("return false");
-				curUL.onmousedown = new Function("return false");
-				curUL.onclick = new Function("return true");
-			}
-		}
-
-		if (flipSaveMenuState) loadMenuState();
-
-		if (flipLoadingMessage != "") window.status = "";
-		return true;
-	}
-
-	if (startElement.className == "flipMenu") startElement.style.display = "";
-
-	if (!startElement.childNodes || startElement.childNodes.length == 0) return false;
-
-	if (typeof flipIDCur == "undefined") flipIDCur = 0;
-	if (!startElement.initialised) {
-		var aUL = startElement.getElementsByTagName("UL");
-		for (var i = 0; i < aUL.length; i++) aUL[i].style.display = "none";
-	}
-
-	for (var i = 0; i < startElement.childNodes.length; i++) {
-		var curNode = startElement.childNodes[i];
-		if (curNode.nodeName == "LI") {
-			flipIDCur++;
-			curNode.flipID = flipIDCur;
-
-			var nodeHasChildren = curNode.getElementsByTagName("UL").length > 0;
-			if (nodeHasChildren) {
-				if (flipImages && curNode.flipClosed) curNode.style.listStyleImage = "url(" + curNode.flipClosed + ")";
-
-				if (curNode.className == null || curNode.className == "") curNode.className = "flipFolderClosed";
-			} else {
-				curNode.className = "flipStatic";
-				if (flipImages && !curNode.style.listStyleImage) {
-					if (!curNode.flipStatic) curNode.flipStatic = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_static;
-					curNode.style.listStyleImage = "url(" + curNode.flipStatic + ")";
-				}
-			}
-
-
-			if (!curNode.flipOpen) curNode.flipOpen = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_open;
-			if (!curNode.flipClosed) curNode.flipClosed = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_closed;
-
-			if (flipMarked) {
-			  if (curNode.getAttribute("expanded") == "true") curNode.flipIsOpen=1;
-			}
-
-			if (curNode.flipIsOpen) openFlip(curNode);
-		}
-	}
-
-	startElement.initialised = true;
-}
-
-function rootOfFlip(flipID, startElement) {
-
-	function containsFlip(startElement, flipID) {
-		var flipFound = false;
-		var i = 0;
-		while (i < startElement.childNodes.length && !flipFound) {
-			var curNode = startElement.childNodes[i];
-			flipFound = (curNode.flipID == flipID) ? true : containsFlip(curNode, flipID);
-			i++;
-		}
-		return flipFound;
-	}
-
-	var rootFlip = null;
-
-	if (!startElement || !startElement.nodeName) {
-		var aUL = document.getElementsByTagName("UL");
-		var i = 0;
-		while (rootFlip == null && i < aUL.length) {
-			var curUL = aUL[i];
-			if (curUL.nodeName == "UL" && curUL.className == "flipMenu") rootFlip = rootOfFlip(flipID, curUL);
-			i++;
-		}
-		return rootFlip;
-	}
-
-	if (startElement.childNodes) for (var i = 0; i < startElement.childNodes.length; i++) {
-		var curNode = startElement.childNodes[i];
-		if (curNode.flipID == flipID || containsFlip(curNode, flipID)) rootFlip = curNode;
-	}
-
-	return rootFlip;
-}
-
-function getCookie(cookieName) {
-	var allCookies = document.cookie;
-	var indexStr = allCookies.indexOf(cookieName + "=");
-	if (indexStr == -1) return "";
-	indexStr = allCookies.indexOf("=", indexStr) + 1;
-	var endStr = allCookies.indexOf(";", indexStr);
-	if (endStr == -1) endStr = allCookies.length;
-	return unescape(allCookies.substring(indexStr, endStr));
-}
-
-function inArray(someID, someArray) {
-	for (var i = 0; i < someArray.length; i++) if (someArray[i] == someID) return true;
-	return false;
-}
-
-function getMenuState(startElement) {
-	if (!startElement.childNodes || startElement.childNodes.length == 0) return "";
-
-	var openItems = "";
-	var aUL = startElement.getElementsByTagName("UL");
-	for (var i = 0; i < aUL.length; i++) {
-		var curNode = aUL[i];
-		var parentFlip = (curNode.parentElement) ? curNode.parentElement : curNode.parentNode;
-		if (curNode.style.display == "" && parentFlip.flipID) openItems += " " + parentFlip.flipID;		
-	}
-	return openItems;
-}
-
-function putMenuState(startElement) {
-	if (!startElement.childNodes || startElement.childNodes.length == 0) return false;
-
-	var aUL = startElement.getElementsByTagName("UL");
-	for (var i = 0; i < aUL.length; i++) {
-		var curNode = aUL[i];
-		var parentFlip = (curNode.parentElement) ? curNode.parentElement : curNode.parentNode;
-		if (inArray(parentFlip.flipID, aOpenItems)) {
-			openFlip(parentFlip);
-			if (typeof prevFlipRoot == "undefined") {
-				var testRoot = rootOfFlip(parentFlip.flipID);
-				if (testRoot.flipID == parentFlip.flipID) prevFlipRoot = testRoot;
-			}
-		}
-	}
-}
-
-function saveMenuState() {
-	if (flipSaveMenuState) {
-		var aUL = document.getElementsByTagName("UL");
-		for (var i = 0; i < aUL.length; i++) {
-			var curUL = aUL[i];
-			var curID = curUL.id ? curUL.id : i;
-			if (curUL.className == "flipMenu") document.cookie = cookiePrefix + curID + "=" + getMenuState(curUL) + ";";
-		}
-	}
-}
-
-function loadMenuState() {
-	var aUL = document.getElementsByTagName("UL");
-	for (var i = 0; i < aUL.length; i++) {
-		var curUL = aUL[i];
-		var curID = curUL.id ? curUL.id : i;
-		if (curUL.className == "flipMenu") {
-			var savedState = String(getCookie(cookiePrefix + curID));
-			if (savedState != "") {
-				aOpenItems = savedState.split(" ");
-				putMenuState(curUL);
-			}
-		}
-	}
-
-	addEvent(window, "unload", saveMenuState);
-}
-
-function clearMenuState(flipMenuID) {
-	if (typeof flipMenuID == "undefined") {
-		var aUL = document.getElementsByTagName("UL");
-		for (var i = 0; i < aUL.length; i++) {
-			var curUL = aUL[i];
-			var curID = curUL.id ? curUL.id : i;
-			if (curUL.className == "flipMenu") document.cookie = cookiePrefix + curID + "=;";
-		}
-	} else document.cookie = cookiePrefix + flipMenuID + "=;";
-}
-
-cookiePrefix = document.location.pathname + "_";
-
-addEvent(document, "click", toggleFlip);
-if (flipInitOnLoad) addEvent(window, "load", initFlip);
+// ######################################################################
+
+// ## flipMenu 5.0.0 (c) J. Reijers
+// ## Last modifications: 23 March 2007
+
+// ######################################################################
+
+// ## Degree of indentation from the left.
+	flipIndentation = "5px";
+
+// ## Padding inbetween menu items.
+	flipVerticalPadding = "4px";
+
+// ## Margin between the left of the browser and the menu.
+	flipLeftMargin = "16px";
+
+// ## Margin between the top of the browser and the menu.
+	flipTopMargin = "10px";
+
+// ## Allow multiple menus to fold out without closing all the other open ones.
+	flipOpenMultipleMenus = false;
+
+// ## Preserve the current state of the menu (requires cookies).
+	flipSaveMenuState = false;
+
+// ## Open entries where the attribute expanded is true
+	flipMarked = true;
+
+// ## Use custom images for bullets
+	flipImages = true;
+
+// ## Images to use (specify full path)
+	flipImg_open   = "flip_open.gif";
+	flipImg_closed = "flip_closed.gif";
+	flipImg_static = "flip_static.gif";
+
+// ## Initialise all flipMenus onload
+	flipInitOnLoad = true;
+
+// ## Message to display in status bar while loading
+	flipLoadingMessage = "Loading...";
+
+// ######################################################################
+
+function alterSize(someSize, alterAmount) {
+	someSize = String(someSize);
+	var tmpNr = parseFloat(someSize.replace(/\D/g, ""));
+	var tmpChar = someSize.replace(/\d/g, "");
+	return isNaN(tmpNr) ? someSize : ((tmpNr + alterAmount) + tmpChar);
+}
+
+isIE = (String(navigator.appVersion).indexOf("MSIE") > -1);
+if (!isIE) flipIndentation = alterSize(flipIndentation, -16);
+if (!isIE) flipLeftMargin = alterSize(flipLeftMargin, -16);
+
+document.write(
+	"<style type=\"text/css\">" +
+
+	"ul.flipMenu { margin-top: " + flipTopMargin + "; margin-left: " + flipLeftMargin + "; " + (flipImages ? "" : "list-style-type: none;") + " }" +
+	"ul.flipMenu ul, ul.flipMenu li { padding-top: " + flipVerticalPadding + "; margin-left: " + flipIndentation + "; margin-right: 0px; " + (flipImages ? "" : "list-style-type: none;") + " }" +
+
+	"li.flipFolderOpen { cursor: pointer; " + (flipImages ? "list-style-image: url(" + document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_open + ");" : "") + " }" +
+	"li.flipFolderClosed { cursor: pointer; " + (flipImages ? "list-style-image: url(" + document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_closed + ");" : "") + " }" +
+
+	"</style>"
+);
+         
+
+
+if (flipImages) {
+	aFlipPreloads = [];
+	aFlipPreloads[0] = new Image;
+	aFlipPreloads[0].src = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_open;
+	aFlipPreloads[1] = new Image;
+	aFlipPreloads[1].src = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_closed;
+	aFlipPreloads[2] = new Image;
+	aFlipPreloads[2].src = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_static;
+}
+
+function addEvent(someObj, someEvent, someFunction) {
+	if (someObj.addEventListener) { someObj.addEventListener(someEvent, someFunction, true); return true; } else if (someObj.attachEvent) return someObj.attachEvent("on" + someEvent, someFunction); else return false;
+}
+
+function openCloseFlip(theItem, newSetting, openParents) {
+	if (theItem.flipID) {
+		if (openParents) {
+			var tmpItem = theItem;
+			while (tmpItem.parentElement || tmpItem.parentNode) {
+				tmpItem = (tmpItem.parentElement) ? tmpItem.parentElement : tmpItem.parentNode;
+				openCloseFlip(tmpItem, newSetting);
+			}
+		}
+		if ((theItem.className == "flipFolderOpen" && newSetting == "closed") || (theItem.className == "flipFolderClosed" && newSetting == "open")) {
+			if (!theItem.childrenInitialised) {
+				for (var j = 0; j < theItem.childNodes.length; j++) if (theItem.childNodes[j].nodeName == "UL" && !theItem.childNodes[j].initialised) initFlip(theItem.childNodes[j]);
+				theItem.childrenInitialised = true;
+			}
+			theItem.getElementsByTagName("UL")[0].style.display = (newSetting == "open") ? "" : "none";
+			theItem.className = newSetting == "open" ? "flipFolderOpen" : "flipFolderClosed";
+		}
+	}
+}
+
+function openFlip(theItem, openParents) {
+	openCloseFlip(theItem, "open", openParents);
+}
+
+function closeFlip(theItem, closeParents) {
+	openCloseFlip(theItem, "closed", closeParents);
+}
+
+function toggleFlip(theElement) {
+	if (theElement.flipID) {
+		var theItem = theElement;
+		var isContained = true;
+	} else {
+		if (theElement && theElement.button > 0) return false;
+		var theItem = (isIE) ? event.srcElement : theElement.target;
+
+		var isContained = false;
+		if (theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed") isContained = true; else while (theItem.parentElement || theItem.parentNode) {
+			if (theItem.className == "flipStatic" || theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed") {
+				isContained = (theItem.className == "flipFolderOpen" || theItem.className == "flipFolderClosed");
+				break;
+			}
+			theItem = (theItem.parentElement) ? theItem.parentElement : theItem.parentNode;
+		}
+	}
+
+	var toOpenFlip = (isContained && theItem.className == "flipFolderClosed");
+
+	if (!flipOpenMultipleMenus && (toOpenFlip || theItem.className == "flipStatic")) {
+		if (theItem.parentElement || theItem.parentNode) {
+			var parentUL = (theItem.parentElement) ? theItem.parentElement : theItem.parentNode;
+			for (var i = 0; i < parentUL.childNodes.length; i++) closeFlip(parentUL.childNodes[i]);
+		}
+	}
+
+	if (isContained) {
+		if (toOpenFlip) openFlip(theItem); else closeFlip(theItem);
+	}
+}
+
+function setAllFlips(startElement, newSetting) {
+	if (typeof startElement == "undefined") var startElement = document;
+	if (typeof newSetting == "undefined") var newSetting = "closed";
+
+	var aUL = startElement.getElementsByTagName("UL");
+	for (var i = 0; i < aUL.length; i++) {
+		var parentFlip = aUL[i].parentElement ? aUL[i].parentElement : aUL[i].parentNode;
+		openCloseFlip(parentFlip, newSetting);
+	}
+}
+
+function openAllFlips(startElement) {
+	setAllFlips(startElement, "open");
+}
+
+function closeAllFlips(startElement) {
+	setAllFlips(startElement, "closed");
+}
+
+function initFlip(startElement) {
+	if (!document.createElement) return false;
+
+	if (!startElement || !startElement.nodeName) {
+		var aUL = document.getElementsByTagName("UL");
+		for (var i = 0; i < aUL.length; i++) {
+			if (flipLoadingMessage != "") window.status = flipLoadingMessage + " " + parseInt((i / (aUL.length - 1)) * 100, 10) + "%";
+			var curUL = aUL[i];
+			if (curUL.className == "flipMenu") {
+				initFlip(curUL);
+
+				// ## Fix text selecting problem in Mozilla
+				curUL.onselectstart = new Function("return false");
+				curUL.onmousedown = new Function("return false");
+				curUL.onclick = new Function("return true");
+			}
+		}
+
+		if (flipSaveMenuState) loadMenuState();
+
+		if (flipLoadingMessage != "") window.status = "";
+		return true;
+	}
+
+	if (startElement.className == "flipMenu") startElement.style.display = "";
+
+	if (!startElement.childNodes || startElement.childNodes.length == 0) return false;
+
+	if (typeof flipIDCur == "undefined") flipIDCur = 0;
+	if (!startElement.initialised) {
+		var aUL = startElement.getElementsByTagName("UL");
+		for (var i = 0; i < aUL.length; i++) aUL[i].style.display = "none";
+	}
+
+	for (var i = 0; i < startElement.childNodes.length; i++) {
+		var curNode = startElement.childNodes[i];
+		if (curNode.nodeName == "LI") {
+			flipIDCur++;
+			curNode.flipID = flipIDCur;
+
+			var nodeHasChildren = curNode.getElementsByTagName("UL").length > 0;
+			if (nodeHasChildren) {
+				if (flipImages && curNode.flipClosed) curNode.style.listStyleImage = "url(" + curNode.flipClosed + ")";
+
+				if (curNode.className == null || curNode.className == "") curNode.className = "flipFolderClosed";
+			} else {
+				curNode.className = "flipStatic";
+				if (flipImages && !curNode.style.listStyleImage) {
+					if (!curNode.flipStatic) curNode.flipStatic = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_static;
+					curNode.style.listStyleImage = "url(" + curNode.flipStatic + ")";
+				}
+			}
+
+
+			if (!curNode.flipOpen) curNode.flipOpen = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_open;
+			if (!curNode.flipClosed) curNode.flipClosed = document.getElementById("js").getAttribute("src").match( /.*\// ) + flipImg_closed;
+
+			if (flipMarked) {
+			  if (curNode.getAttribute("expanded") == "true") curNode.flipIsOpen=1;
+			}
+
+			if (curNode.flipIsOpen) openFlip(curNode);
+		}
+	}
+
+	startElement.initialised = true;
+}
+
+function rootOfFlip(flipID, startElement) {
+
+	function containsFlip(startElement, flipID) {
+		var flipFound = false;
+		var i = 0;
+		while (i < startElement.childNodes.length && !flipFound) {
+			var curNode = startElement.childNodes[i];
+			flipFound = (curNode.flipID == flipID) ? true : containsFlip(curNode, flipID);
+			i++;
+		}
+		return flipFound;
+	}
+
+	var rootFlip = null;
+
+	if (!startElement || !startElement.nodeName) {
+		var aUL = document.getElementsByTagName("UL");
+		var i = 0;
+		while (rootFlip == null && i < aUL.length) {
+			var curUL = aUL[i];
+			if (curUL.nodeName == "UL" && curUL.className == "flipMenu") rootFlip = rootOfFlip(flipID, curUL);
+			i++;
+		}
+		return rootFlip;
+	}
+
+	if (startElement.childNodes) for (var i = 0; i < startElement.childNodes.length; i++) {
+		var curNode = startElement.childNodes[i];
+		if (curNode.flipID == flipID || containsFlip(curNode, flipID)) rootFlip = curNode;
+	}
+
+	return rootFlip;
+}
+
+function getCookie(cookieName) {
+	var allCookies = document.cookie;
+	var indexStr = allCookies.indexOf(cookieName + "=");
+	if (indexStr == -1) return "";
+	indexStr = allCookies.indexOf("=", indexStr) + 1;
+	var endStr = allCookies.indexOf(";", indexStr);
+	if (endStr == -1) endStr = allCookies.length;
+	return unescape(allCookies.substring(indexStr, endStr));
+}
+
+function inArray(someID, someArray) {
+	for (var i = 0; i < someArray.length; i++) if (someArray[i] == someID) return true;
+	return false;
+}
+
+function getMenuState(startElement) {
+	if (!startElement.childNodes || startElement.childNodes.length == 0) return "";
+
+	var openItems = "";
+	var aUL = startElement.getElementsByTagName("UL");
+	for (var i = 0; i < aUL.length; i++) {
+		var curNode = aUL[i];
+		var parentFlip = (curNode.parentElement) ? curNode.parentElement : curNode.parentNode;
+		if (curNode.style.display == "" && parentFlip.flipID) openItems += " " + parentFlip.flipID;		
+	}
+	return openItems;
+}
+
+function putMenuState(startElement) {
+	if (!startElement.childNodes || startElement.childNodes.length == 0) return false;
+
+	var aUL = startElement.getElementsByTagName("UL");
+	for (var i = 0; i < aUL.length; i++) {
+		var curNode = aUL[i];
+		var parentFlip = (curNode.parentElement) ? curNode.parentElement : curNode.parentNode;
+		if (inArray(parentFlip.flipID, aOpenItems)) {
+			openFlip(parentFlip);
+			if (typeof prevFlipRoot == "undefined") {
+				var testRoot = rootOfFlip(parentFlip.flipID);
+				if (testRoot.flipID == parentFlip.flipID) prevFlipRoot = testRoot;
+			}
+		}
+	}
+}
+
+function saveMenuState() {
+	if (flipSaveMenuState) {
+		var aUL = document.getElementsByTagName("UL");
+		for (var i = 0; i < aUL.length; i++) {
+			var curUL = aUL[i];
+			var curID = curUL.id ? curUL.id : i;
+			if (curUL.className == "flipMenu") document.cookie = cookiePrefix + curID + "=" + getMenuState(curUL) + ";";
+		}
+	}
+}
+
+function loadMenuState() {
+	var aUL = document.getElementsByTagName("UL");
+	for (var i = 0; i < aUL.length; i++) {
+		var curUL = aUL[i];
+		var curID = curUL.id ? curUL.id : i;
+		if (curUL.className == "flipMenu") {
+			var savedState = String(getCookie(cookiePrefix + curID));
+			if (savedState != "") {
+				aOpenItems = savedState.split(" ");
+				putMenuState(curUL);
+			}
+		}
+	}
+
+	addEvent(window, "unload", saveMenuState);
+}
+
+function clearMenuState(flipMenuID) {
+	if (typeof flipMenuID == "undefined") {
+		var aUL = document.getElementsByTagName("UL");
+		for (var i = 0; i < aUL.length; i++) {
+			var curUL = aUL[i];
+			var curID = curUL.id ? curUL.id : i;
+			if (curUL.className == "flipMenu") document.cookie = cookiePrefix + curID + "=;";
+		}
+	} else document.cookie = cookiePrefix + flipMenuID + "=;";
+}
+
+cookiePrefix = document.location.pathname + "_";
+
+addEvent(document, "click", toggleFlip);
+if (flipInitOnLoad) addEvent(window, "load", initFlip);
diff --git a/lib/inets/test/rules.mk b/lib/inets/test/rules.mk
index 047c03b..89a15d6 100644
--- a/lib/inets/test/rules.mk
+++ b/lib/inets/test/rules.mk
@@ -24,8 +24,6 @@ ERL_COMPILE_FLAGS += +compressed
 else
 ifdef BOOTSTRAP
 ERL_COMPILE_FLAGS += +slim
-else
-ERL_COMPILE_FLAGS += +debug_info
 endif
 endif
 ERLC_WFLAGS = -W
diff --git a/lib/kernel/examples/uds_dist/c_src/Makefile b/lib/kernel/examples/uds_dist/c_src/Makefile
index de3a373..3c17f18 100644
--- a/lib/kernel/examples/uds_dist/c_src/Makefile
+++ b/lib/kernel/examples/uds_dist/c_src/Makefile
@@ -1,6 +1,6 @@
 # Example makefile, Solaris only
 CC = gcc
-CFLAGS=-O3 -g -fPIC -pedantic -Wall -I$(ERL_INCLUDE)
+CFLAGS=-g -fPIC -pedantic -Wall -I$(ERL_INCLUDE)
 LD=ld
 RM_RF=rm -rf
 INSTALL_DIR=/usr/ucb/install -d
diff --git a/lib/megaco/src/rules.mk b/lib/megaco/src/rules.mk
index 20fbed2..0e81244 100644
--- a/lib/megaco/src/rules.mk
+++ b/lib/megaco/src/rules.mk
@@ -21,7 +21,7 @@
 
 
 CC     = gcc
-CFLAGS = -g -O2 -funroll-loops -Wall -fPIC
+CFLAGS = -O2 -funroll-loops -Wall -fPIC
 FLEX   = flex
 PERL   = perl
 
diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl
index 7d3c5a0..ff5784f 100644
--- a/lib/stdlib/src/supervisor.erl
+++ b/lib/stdlib/src/supervisor.erl
@@ -1240,7 +1240,7 @@ validChildType(What) -> throw({invalid_child_type, What}).
 
 validName(_Name) -> true.
 
-validFunc({M, F, A}) when is_atom(M), 
+validFunc({M, F, A}) when (is_atom(M) orelse is_tuple(M)), 
                           is_atom(F), 
                           is_list(A) -> true;
 validFunc(Func)                      -> throw({invalid_mfa, Func}).
@@ -1260,7 +1260,7 @@ validMods(dynamic) -> true;
 validMods(Mods) when is_list(Mods) ->
     lists:foreach(fun(Mod) ->
 		    if
-			is_atom(Mod) -> ok;
+			(is_atom(Mod) orelse is_tuple(Mod)) -> ok;
 			true -> throw({invalid_module, Mod})
 		    end
 		  end,
diff --git a/lib/tools/c_src/Makefile.in b/lib/tools/c_src/Makefile.in
index 0382d32..44bd253 100644
--- a/lib/tools/c_src/Makefile.in
+++ b/lib/tools/c_src/Makefile.in
@@ -109,7 +109,7 @@ EMEM_INCLUDES =	-I$(ERL_TOP)/erts/include \
 EMEM_HEADERS = erl_memory_trace_block_table.h
 EMEM_SRCS = erl_memory.c erl_memory_trace_block_table.c
 
-EMEM_CFLAGS = $(THR_DEFS) $(subst O2,O3, $(CFLAGS)) $(EMEM_INCLUDES)
+EMEM_CFLAGS = $(THR_DEFS) $(CFLAGS) $(EMEM_INCLUDES)
 EMEM_LDFLAGS = $(LDFLAGS)
 
 ifeq ($(USING_VC), yes)
diff --git a/lib/tools/emacs/Makefile b/lib/tools/emacs/Makefile
index 69946be..f9dd407 100644
--- a/lib/tools/emacs/Makefile
+++ b/lib/tools/emacs/Makefile
@@ -51,7 +51,7 @@ EL_FILES = $(EMACS_FILES:%=%.el)
 
 ELC_FILES = $(EMACS_FILES:%=%.elc) 
 
-TEST_FILES = test.erl.indented test.erl.orig
+TEST_FILES = test.erl.indented test.erl.original
 
 # ----------------------------------------------------
 # Targets
diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig
deleted file mode 100644
index 0f8c4a9..0000000
--- a/lib/tools/emacs/test.erl.orig
+++ /dev/null
@@ -1,702 +0,0 @@
-%% -*- erlang -*-
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-
-%%%-------------------------------------------------------------------
-%%% File    : test.erl
-%%% Author  : Dan Gudmundsson <dan.gudmundsson@ericsson.com>
-%%% Description :   Test emacs mode indention and font-locking
-%%%                 this file is intentionally not indented.
-%%%                 Copy the file and indent it and you should end up with test.erl.indented
-%%% Created :  6 Oct 2009 by Dan Gudmundsson <dan.gudmundsson@ericsson.com>
-%%%-------------------------------------------------------------------
-
-%% Start off with syntax highlighting you have to verify this by looking here 
-%% and see that the code looks alright
-
--module(test).
--compile(export_all).
-
-%% Module attributes should be highlighted
-
--export([t/1]).
--record(record1, {a, 
- b, 
- c
-}).
--record(record2, {
-  a,
-  b
- }).
-	  
--record(record3, {a = 8#42423 bor
-    8#4234,
-  b = 8#5432 
-		  bor 2#1010101
-  c = 123 +
-234,
-		  d}).
-
--record(record4, {
- a = 8#42423 bor
-   8#4234,
- b = 8#5432 
-    bor 2#1010101
- c = 123 +
-     234,
- d}).
-
-
--define(MACRO_1, macro).
--define(MACRO_2(_), macro).
-
--spec t(integer()) -> any().
-
--type ann() :: Var :: integer(). 
--type ann2() :: Var :: 
-   'return' 
- | 'return_white_spaces' 
-  | 'return_comments'
-  | 'text' | ann(). 
--type paren() :: 
-  (ann2()). 
--type t1() :: atom(). 
--type t2() :: [t1()]. 
--type t3(Atom) :: integer(Atom). 
--type t4() :: t3(foobar). 
--type t5() :: {t1(), t3(foo)}. 
--type t6() :: 1 | 2 | 3 | 
-	'foo' | 'bar'. 
--type t7() :: []. 
--type t71() :: [_]. 
--type t8() :: {any(),none(),pid(),port(),
-	       reference(),float()}. 
--type t9() :: [1|2|3|foo|bar] | 
-    list(a | b | c) | t71(). 
--type t10() :: {1|2|3|foo|t9()} | {}. 
--type t11() :: 1..2. 
--type t13() :: maybe_improper_list(integer(), t11()). 
--type t14() :: [erl_scan:foo() | 
-        %% Should be highlighted
-	term() |
-	bool() |
-	byte() |
-	char() |
-	non_neg_integer() | nonempty_list() |
-	pos_integer() |
-	neg_integer() |
-	number() |
-	list() |
-	nonempty_improper_list() | nonempty_maybe_improper_list() |
-	maybe_improper_list() | string() | iolist() | byte() |
-	module() |
-	mfa() 	|
-	node() 	|
-	timeout() |
-	no_return() |
-	%% Should not be highlighted
-	nonempty_() | nonlist() | 
- erl_scan:bar(34, 92) | t13() | m:f(integer() | <<_:_*16>>)].
-
-
--type t15() :: {binary(),<<>>,<<_:34>>,<<_:_*42>>,
-		<<_:3,_:_*14>>,<<>>} | [<<>>|<<_:34>>|<<_:16>>|
-<<_:3,_:_*1472>>|<<_:19,_:_*14>>| <<_:34>>|
-<<_:34>>|<<_:34>>|<<_:34>>]. 
--type t16() :: fun(). 
--type t17() :: fun((...) -> paren()). 
--type t18() :: fun(() -> t17() | t16()). 
--type t19() :: fun((t18()) -> t16()) |
-  fun((nonempty_maybe_improper_list('integer', any())|
-      1|2|3|a|b|<<_:3,_:_*14>>|integer()) ->
-nonempty_maybe_improper_list('integer', any())|
-1|2|3|a|b|<<_:3,_:_*14>>|integer()). 
--type t20() :: [t19(), ...]. 
--type t21() :: tuple(). 
--type t21(A) :: A. 
--type t22() :: t21(integer()). 
--type t23() :: #rec1{}. 
--type t24() :: #rec2{a :: t23(), b :: [atom()]}. 
--type t25() :: #rec3{f123 :: [t24() | 
-1|2|3|4|a|b|c|d| 
-nonempty_maybe_improper_list(integer, any())]}. 
--type t99() ::
-{t2(),t4(),t5(),t6(),t7(),t8(),t10(),t14(),
-t15(),t20(),t21(), t22(),t25()}. 
--spec t1(FooBar :: t99()) -> t99();
-(t2()) -> t2();
-	(t4()) -> t4() when is_subtype(t4(), t24);
-(t23()) -> t23() when is_subtype(t23(), atom()),
-                      is_subtype(t23(), t14());
-(t24()) -> t24() when is_subtype(t24(), atom()),
-                      is_subtype(t24(), t14()),
-	   is_subtype(t24(), t4()).
-
--spec over(I :: integer()) -> R1 :: foo:typen();
-  (A :: atom()) -> R2 :: foo:atomen();
- (T :: tuple()) -> R3 :: bar:typen().
-
--spec mod:t2() -> any(). 
-
--spec handle_cast(Cast :: {'exchange', node(), [[name(),...]]} 
-  | {'del_member', name(), pid()},
-     #state{}) -> {'noreply', #state{}}.
-
--spec handle_cast(Cast :: 
-   {'exchange', node(), [[name(),...]]} 
- | {'del_member', name(), pid()},
-   #state{}) -> {'noreply', #state{}}.
-
--spec all(fun((T) -> boolean()), List :: [T]) ->
- boolean() when is_subtype(T, term()). % (*)
-
--spec get_closest_pid(term()) -> 
-       Return :: pid()
- | {'error', {'no_process', term()}
-   | {'no_such_group', term()}}.
-
--opaque attributes_data() :: 
-[{'column', column()} | {'line', info_line()} |
- {'text', string()}] |  {line(),column()}.   
--record(r,{
-	  f1 :: attributes_data(),
-f222 = foo:bar(34, #rec3{}, 234234234423, 
-               aassdsfsdfsdf, 2234242323) :: 
-[t24() | 1|2|3|4|a|b|c|d| 
- nonempty_maybe_improper_list(integer, any())],
-f333 :: [t24() | 1|2|3|4|a|b|c|d| 
-	 nonempty_maybe_improper_list(integer, any())],
-f3 = x:y(),
-f4 = x:z() :: t99(),
-f17 :: 'undefined',
-f18 :: 1 | 2 | 'undefined',
-f19 = 3 :: integer()|undefined,
-f5 = 3 :: undefined|integer()}). 
-
--record(state, {
-  sequence_number = 1          :: integer()
-  }).
-
-
-highlighting(X)			  % Function definitions should be highlighted
-  when is_integer(X) ->	  % and so should `when' and `is_integer' be
- %% Highlighting
- %% Various characters (we keep an `atom' after to see that highlighting ends)
- $a,atom,			  % Characters should be marked
- "string",atom,		  % and strings
- 'asdasd',atom,		  % quote should be atoms??
- 'VaV',atom,
- 'aVa',atom,
- '\'atom',atom,
- 'atom\'',atom,
- 'at\'om',atom,
- '#1',atom,
-
- $", atom,					% atom should be ok
- $', atom, 
- 
- "string$", atom,  "string$", atom,  		% currently buggy I know...
- "string\$", atom,   				% workaround for bug above
- 
- "char $in string", atom, 
-
- 'atom$', atom,  'atom$', atom,
- 'atom\$', atom,
-
- 'char $in atom', atom,
-
- $[, ${, $\\, atom,
- ?MACRO_1,
- ?MACRO_2(foo),
-
- %% Numerical constants
- 16#DD,					% AD Should not be highlighted
- 32#dd,					% AD Should not be highlighted
- 32#ddAB,				        % AD Should not be highlighted
- 32#101,				        % AD Should not be highlighted
- 32#ABTR,				        % AD Should not be highlighted
-
- %% Variables
- Variables = lists:foo(),
- _Variables = lists:foo(),                      % AD
- AppSpec = Xyz/2,
- Module42 = Xyz(foo, bar),
- Module:foo(),
- _Module:foo(),				% AD
- FooÅÅ = lists:reverse([tl,hd,tl,hd]),	% AD Should highlight FooÅÅ
- _FooÅÅ = 42,				% AD Should highlight _FooÅÅ
-
- %% Bifs
- erlang:registered(),
- registered(),
- hd(tl(tl(hd([a,b,c])))),
- erlang:anything(lists),
- %% Guards
- is_atom(foo), is_float(2.3), is_integer(32), is_number(4323.3),
- is_function(Fun), is_pid(self()), 
- not_a_guard:is_list([]),
- %% Other Types
-
- atom,			  % not (currently) hightlighted
- 234234, 
- 234.43,
-
- [list, are, not, higlighted],    
- {nor, is, tuple},
- ok.
-    
-%%%
-%%%  Indentation
-%%%
-
-%%%  Left
-
-%%   Indented
-
-%    Right
-
-
-indent_basics(X, Y, Z) 
-  when X > 42,
-Z < 13;
-Y =:= 4711 ->
- %% comments
- % right comments
- case lists:filter(fun(_, AlongName, 
-	      B, 
-    C) ->
-		       true
-		   end, 
-		   [a,v,b])
- of
- [] ->
- Y = 5 * 43,
- ok;
- [_|_] -> 
- Y = 5 * 43,
- ok
- end,
- Y,
- %% List, tuples and binaries
- [a, 
-  b, c
- ],
- [ a, 
-   b, c
-  ],
-
- [
- a,
- b
-],
- {a, 
-  b,c
- },
- { a, 
-  b,c
-    },
-
- {
- a,
- b
- },
-    
-<<1:8,
-  2:8
-  >>,
- <<
- 1:8,
- 2:8
-  >>,
- << 1:8,
-   2:8
-    >>,
-
- (a,
-  b,
-  c
- ),
-
-    ( a,
-     b,
-     c
-    ),
-
-    
- (
-  a,
-  b,
-  c
- ),
-
- call(2#42423 bor 
-   #4234,
-  2#5432,
- other_arg),
- ok;
-indent_basics(Xlongname, 
-     #struct{a=Foo,
-     b=Bar}, 
-       [X|
-	Y]) ->
- testing_next_clause,
- ok;
-indent_basics(					% AD added clause
- X, 						% not sure how this should look
- Y,
- Z)
- when
- X < 42, Z > 13;
- Y =:= 4711 ->
- foo;
-indent_basics(X, Y, Z) when			% AD added clause
- X < 42, Z > 13;				% testing when indentation
- Y =:= 4711 ->
- foo;
-indent_basics(X, Y, Z)				% AD added clause
- when						% testing when indentation
- X < 42, Z > 13;				% unsure about this one
- Y =:= 4711 ->
- foo.
-
-
-
-indent_nested() ->
- [
- {foo, 2, "string"},
- {bar, 3, "another string"}
-  ].
-
-
-indent_icr(Z) -> 				% icr = if case receive
- %% If
- if Z >= 0 ->
-	 X = 43 div 4,
-	 foo(X);
-    Z =< 10 ->
-	 X = 43 div 4,
-	 foo(X);
-    Z == 5 orelse
-    Z == 7 ->
-	 X = 43 div 4,
-	 foo(X);
-    true ->
-	 if_works
-  end,
- %% Case
- case {Z, foo, bar} of
-  {Z,_,_} ->
-  X = 43 div 4,
-  foo(X);
-  {Z,_,_}	when
-  Z =:= 42 ->				% AD line should be indented as a when
-  X = 43 div 4,
-  foo(X);
-  {Z,_,_}
-  when Z < 10 ->			% AD when should be indented
-  X = 43 div 4,
-  foo(X);
-  {Z,_,_}
-  when					% AD when should be indented
-  Z < 10				% and the guards should follow when
-  andalso				% unsure about how though
-  true ->
-  X = 43 div 4,
-  foo(X)
- end,
- %% begin
- begin
- sune,
- X = 74234 + foo(8456) +
-  345 div 43,
- ok
- end,
-
-
- %% receive
-  receive 
-  {Z,_,_} ->
-    X = 43 div 4,
-    foo(X);
-  Z ->
-   X = 43 div 4,
-   foo(X) 
-  end,
-  receive
-  {Z,_,_} ->
-  X = 43 div 4,
-  foo(X);
- Z 					% AD added clause
-  when Z =:= 1 ->			% This line should be indented by 2
-  X = 43 div 4,
-  foo(X);
- Z when					% AD added clause
-  Z =:= 2 ->				% This line should be indented by 2
-  X = 43 div 4,
-  foo(X);
- Z ->
-    X = 43 div 4,
-    foo(X) 
- after infinity ->
-    foo(X),
-    asd(X),
-    5*43
- end,
- receive
- after 10 -> 
- foo(X),
- asd(X),
- 5*43
- end,
- ok.
- 
-indent_fun() ->
-    %% Changed fun to one indention level
-Var = spawn(fun(X) 
-       when X == 2;
-	     X > 10 -> 
-  hello,
-  case Hello() of 
-   true when is_atom(X) -> 
-      foo;
-  false ->
-      bar
-  end;
- (Foo) when is_atom(Foo), 
-   is_integer(X) ->
-  X = 6* 45,
-  Y = true andalso
-	  kalle
- end),
-  ok.
-
-indent_try_catch() ->
- try
- io:format(stdout, "Parsing file ~s, ", 
- [St0#leex.xfile]),
- {ok,Line3,REAs,Actions,St3} = 
- parse_rules(Xfile, Line2, Macs, St2)
- catch
-  exit:{badarg,R} ->
-  foo(R),
-  io:format(stdout, 
-   "ERROR reason ~p~n",
-    R);
-  error:R 				% AD added clause
-  when R =:= 42 ->			% when should be indented
-  foo(R);
-  error:R 				% AD added clause
-  when					% when should be indented
-  R =:= 42 ->				% but unsure about this (maybe 2 more)
-  foo(R);
-  error:R when				% AD added clause
-  R =:= foo ->				% line should be 2 indented (works)
-  foo(R);
-  error:R ->
-  foo(R),
-  io:format(stdout, 
-   "ERROR reason ~p~n",
-    R)
- after
-  foo('after'),
-  file:close(Xfile)
- end;
-indent_try_catch() ->
- try
-   foo(bar)
- of
- X when true andalso
- kalle ->
-  io:format(stdout, "Parsing file ~s, ",
-  [St0#leex.xfile]),
-  {ok,Line3,REAs,Actions,St3} =
-  parse_rules(Xfile, Line2, Macs, St2);
- X 					% AD added clause
-  when false andalso			% when should be 2 indented
-  bengt ->
-  gurka();
- X when					% AD added clause
-  false andalso				% line should be 2 indented
-  not bengt ->
-  gurka();
- X ->
-  io:format(stdout, "Parsing file ~s, ",
-  [St0#leex.xfile]),
-  {ok,Line3,REAs,Actions,St3} =
-  parse_rules(Xfile, Line2, Macs, St2)
- catch
- exit:{badarg,R} ->
-    foo(R),
-    io:format(stdout, 
-	      "ERROR reason ~p~n",
-	      R);
- error:R ->
-    foo(R),
-    io:format(stdout, 
-	      "ERROR reason ~p~n",
-	      R)
- after
- foo('after'),
-  file:close(Xfile),
-  bar(with_long_arg,
-       with_second_arg)
- end;
- indent_try_catch() ->
- try foo()
- after 
-  foo(),
-  bar(with_long_arg,
-      with_second_arg)
- end.
-
-indent_catch() ->
-  D = B +
-  float(43.1),
-    
-  B = catch oskar(X),
-  
-  A = catch (baz + 
-      bax),
- catch foo(),
-
-  C = catch B + 
-     float(43.1),
- 
-  case catch foo(X) of
-  A ->
- B
- end,
-
- case
-  catch foo(X)
- of
- A ->
-   B
-  end,
-
-  case
-  foo(X)
-   of
- A ->
-	  catch B,
-	  X
-   end,
-
- try sune of
- _ -> foo
-   catch _:_ -> baf
-   end,
-
-    try
-sune
-   of
- _ ->
-   X = 5,
-   (catch foo(X)),
-   X + 10
-   catch _:_ -> baf
-   end,
-
-   try
- (catch sune)
-   of
- _ ->
-   catch foo()  %% BUGBUG can't handle catch inside try without parentheses
-   catch _:_ ->
-    baf
-   end,
-
-   try
-(catch exit())
-   catch
-_ ->
-    catch baf()
-   end,
- ok.
-
-indent_binary() ->
-  X = lists:foldr(fun(M) ->
-    <<Ma/binary, " ">>
-    end, [], A),
-  A = <<X/binary, 0:8>>,
-  B.
-
-
-indent_comprehensions() ->
-%% I don't have a good idea how we want to handle this 
-%% but they are here to show how they are indented today.
-Result1 = [X || 
-  #record{a=X} <- lists:seq(1, 10),
-  true = (X rem 2)
-     ],
-Result2 = [X || <<X:32,_:32>> <= <<0:512>>,
-    true = (X rem 2)
-       ],
-
-Binary1 = << <<X:8>> || 
-  #record{a=X} <- lists:seq(1, 10),
-  true = (X rem 2)
-      >>,
-
-Binary2 = << <<X:8>> || <<X:32,_:32>> <= <<0:512>>,
-  true = (X rem 2)
-      >>,
-ok.
-
-%% This causes an error in earlier erlang-mode versions.
-foo() ->
-[#foo{
-foo = foo}].
-
-%% Record indentation
-some_function_with_a_very_long_name() ->
- #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
- field1=a,
- field2=b},
- case dummy_function_with_a_very_very_long_name(x) of
- #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
- field1=a,
- field2=b} ->
- ok;
- Var = #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
- field1=a,
- field2=b} ->
- Var#'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
- field1=a,
- field2=b};
- #xyz{
- a=1,
- b=2} ->
- ok
- end.
-
-another_function_with_a_very_very_long_name() ->
- #rec{
- field1=1,
- field2=1}.
-
-some_function_name_xyz(xyzzy, #some_record{
- field1=Field1,
- field2=Field2}) ->
- SomeVariable = f(#'Some-long-record-name'{
- field_a = 1,
- 'inter-xyz-parameters' =
- #'Some-other-very-long-record-name'{
- field2 = Field1,
- field2 = Field2}}),
- {ok, SomeVariable}.
diff --git a/lib/tools/emacs/test.erl.original b/lib/tools/emacs/test.erl.original
new file mode 100644
index 0000000..0f8c4a9
--- /dev/null
+++ b/lib/tools/emacs/test.erl.original
@@ -0,0 +1,702 @@
+%% -*- erlang -*-
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+
+%%%-------------------------------------------------------------------
+%%% File    : test.erl
+%%% Author  : Dan Gudmundsson <dan.gudmundsson@ericsson.com>
+%%% Description :   Test emacs mode indention and font-locking
+%%%                 this file is intentionally not indented.
+%%%                 Copy the file and indent it and you should end up with test.erl.indented
+%%% Created :  6 Oct 2009 by Dan Gudmundsson <dan.gudmundsson@ericsson.com>
+%%%-------------------------------------------------------------------
+
+%% Start off with syntax highlighting you have to verify this by looking here 
+%% and see that the code looks alright
+
+-module(test).
+-compile(export_all).
+
+%% Module attributes should be highlighted
+
+-export([t/1]).
+-record(record1, {a, 
+ b, 
+ c
+}).
+-record(record2, {
+  a,
+  b
+ }).
+	  
+-record(record3, {a = 8#42423 bor
+    8#4234,
+  b = 8#5432 
+		  bor 2#1010101
+  c = 123 +
+234,
+		  d}).
+
+-record(record4, {
+ a = 8#42423 bor
+   8#4234,
+ b = 8#5432 
+    bor 2#1010101
+ c = 123 +
+     234,
+ d}).
+
+
+-define(MACRO_1, macro).
+-define(MACRO_2(_), macro).
+
+-spec t(integer()) -> any().
+
+-type ann() :: Var :: integer(). 
+-type ann2() :: Var :: 
+   'return' 
+ | 'return_white_spaces' 
+  | 'return_comments'
+  | 'text' | ann(). 
+-type paren() :: 
+  (ann2()). 
+-type t1() :: atom(). 
+-type t2() :: [t1()]. 
+-type t3(Atom) :: integer(Atom). 
+-type t4() :: t3(foobar). 
+-type t5() :: {t1(), t3(foo)}. 
+-type t6() :: 1 | 2 | 3 | 
+	'foo' | 'bar'. 
+-type t7() :: []. 
+-type t71() :: [_]. 
+-type t8() :: {any(),none(),pid(),port(),
+	       reference(),float()}. 
+-type t9() :: [1|2|3|foo|bar] | 
+    list(a | b | c) | t71(). 
+-type t10() :: {1|2|3|foo|t9()} | {}. 
+-type t11() :: 1..2. 
+-type t13() :: maybe_improper_list(integer(), t11()). 
+-type t14() :: [erl_scan:foo() | 
+        %% Should be highlighted
+	term() |
+	bool() |
+	byte() |
+	char() |
+	non_neg_integer() | nonempty_list() |
+	pos_integer() |
+	neg_integer() |
+	number() |
+	list() |
+	nonempty_improper_list() | nonempty_maybe_improper_list() |
+	maybe_improper_list() | string() | iolist() | byte() |
+	module() |
+	mfa() 	|
+	node() 	|
+	timeout() |
+	no_return() |
+	%% Should not be highlighted
+	nonempty_() | nonlist() | 
+ erl_scan:bar(34, 92) | t13() | m:f(integer() | <<_:_*16>>)].
+
+
+-type t15() :: {binary(),<<>>,<<_:34>>,<<_:_*42>>,
+		<<_:3,_:_*14>>,<<>>} | [<<>>|<<_:34>>|<<_:16>>|
+<<_:3,_:_*1472>>|<<_:19,_:_*14>>| <<_:34>>|
+<<_:34>>|<<_:34>>|<<_:34>>]. 
+-type t16() :: fun(). 
+-type t17() :: fun((...) -> paren()). 
+-type t18() :: fun(() -> t17() | t16()). 
+-type t19() :: fun((t18()) -> t16()) |
+  fun((nonempty_maybe_improper_list('integer', any())|
+      1|2|3|a|b|<<_:3,_:_*14>>|integer()) ->
+nonempty_maybe_improper_list('integer', any())|
+1|2|3|a|b|<<_:3,_:_*14>>|integer()). 
+-type t20() :: [t19(), ...]. 
+-type t21() :: tuple(). 
+-type t21(A) :: A. 
+-type t22() :: t21(integer()). 
+-type t23() :: #rec1{}. 
+-type t24() :: #rec2{a :: t23(), b :: [atom()]}. 
+-type t25() :: #rec3{f123 :: [t24() | 
+1|2|3|4|a|b|c|d| 
+nonempty_maybe_improper_list(integer, any())]}. 
+-type t99() ::
+{t2(),t4(),t5(),t6(),t7(),t8(),t10(),t14(),
+t15(),t20(),t21(), t22(),t25()}. 
+-spec t1(FooBar :: t99()) -> t99();
+(t2()) -> t2();
+	(t4()) -> t4() when is_subtype(t4(), t24);
+(t23()) -> t23() when is_subtype(t23(), atom()),
+                      is_subtype(t23(), t14());
+(t24()) -> t24() when is_subtype(t24(), atom()),
+                      is_subtype(t24(), t14()),
+	   is_subtype(t24(), t4()).
+
+-spec over(I :: integer()) -> R1 :: foo:typen();
+  (A :: atom()) -> R2 :: foo:atomen();
+ (T :: tuple()) -> R3 :: bar:typen().
+
+-spec mod:t2() -> any(). 
+
+-spec handle_cast(Cast :: {'exchange', node(), [[name(),...]]} 
+  | {'del_member', name(), pid()},
+     #state{}) -> {'noreply', #state{}}.
+
+-spec handle_cast(Cast :: 
+   {'exchange', node(), [[name(),...]]} 
+ | {'del_member', name(), pid()},
+   #state{}) -> {'noreply', #state{}}.
+
+-spec all(fun((T) -> boolean()), List :: [T]) ->
+ boolean() when is_subtype(T, term()). % (*)
+
+-spec get_closest_pid(term()) -> 
+       Return :: pid()
+ | {'error', {'no_process', term()}
+   | {'no_such_group', term()}}.
+
+-opaque attributes_data() :: 
+[{'column', column()} | {'line', info_line()} |
+ {'text', string()}] |  {line(),column()}.   
+-record(r,{
+	  f1 :: attributes_data(),
+f222 = foo:bar(34, #rec3{}, 234234234423, 
+               aassdsfsdfsdf, 2234242323) :: 
+[t24() | 1|2|3|4|a|b|c|d| 
+ nonempty_maybe_improper_list(integer, any())],
+f333 :: [t24() | 1|2|3|4|a|b|c|d| 
+	 nonempty_maybe_improper_list(integer, any())],
+f3 = x:y(),
+f4 = x:z() :: t99(),
+f17 :: 'undefined',
+f18 :: 1 | 2 | 'undefined',
+f19 = 3 :: integer()|undefined,
+f5 = 3 :: undefined|integer()}). 
+
+-record(state, {
+  sequence_number = 1          :: integer()
+  }).
+
+
+highlighting(X)			  % Function definitions should be highlighted
+  when is_integer(X) ->	  % and so should `when' and `is_integer' be
+ %% Highlighting
+ %% Various characters (we keep an `atom' after to see that highlighting ends)
+ $a,atom,			  % Characters should be marked
+ "string",atom,		  % and strings
+ 'asdasd',atom,		  % quote should be atoms??
+ 'VaV',atom,
+ 'aVa',atom,
+ '\'atom',atom,
+ 'atom\'',atom,
+ 'at\'om',atom,
+ '#1',atom,
+
+ $", atom,					% atom should be ok
+ $', atom, 
+ 
+ "string$", atom,  "string$", atom,  		% currently buggy I know...
+ "string\$", atom,   				% workaround for bug above
+ 
+ "char $in string", atom, 
+
+ 'atom$', atom,  'atom$', atom,
+ 'atom\$', atom,
+
+ 'char $in atom', atom,
+
+ $[, ${, $\\, atom,
+ ?MACRO_1,
+ ?MACRO_2(foo),
+
+ %% Numerical constants
+ 16#DD,					% AD Should not be highlighted
+ 32#dd,					% AD Should not be highlighted
+ 32#ddAB,				        % AD Should not be highlighted
+ 32#101,				        % AD Should not be highlighted
+ 32#ABTR,				        % AD Should not be highlighted
+
+ %% Variables
+ Variables = lists:foo(),
+ _Variables = lists:foo(),                      % AD
+ AppSpec = Xyz/2,
+ Module42 = Xyz(foo, bar),
+ Module:foo(),
+ _Module:foo(),				% AD
+ FooÅÅ = lists:reverse([tl,hd,tl,hd]),	% AD Should highlight FooÅÅ
+ _FooÅÅ = 42,				% AD Should highlight _FooÅÅ
+
+ %% Bifs
+ erlang:registered(),
+ registered(),
+ hd(tl(tl(hd([a,b,c])))),
+ erlang:anything(lists),
+ %% Guards
+ is_atom(foo), is_float(2.3), is_integer(32), is_number(4323.3),
+ is_function(Fun), is_pid(self()), 
+ not_a_guard:is_list([]),
+ %% Other Types
+
+ atom,			  % not (currently) hightlighted
+ 234234, 
+ 234.43,
+
+ [list, are, not, higlighted],    
+ {nor, is, tuple},
+ ok.
+    
+%%%
+%%%  Indentation
+%%%
+
+%%%  Left
+
+%%   Indented
+
+%    Right
+
+
+indent_basics(X, Y, Z) 
+  when X > 42,
+Z < 13;
+Y =:= 4711 ->
+ %% comments
+ % right comments
+ case lists:filter(fun(_, AlongName, 
+	      B, 
+    C) ->
+		       true
+		   end, 
+		   [a,v,b])
+ of
+ [] ->
+ Y = 5 * 43,
+ ok;
+ [_|_] -> 
+ Y = 5 * 43,
+ ok
+ end,
+ Y,
+ %% List, tuples and binaries
+ [a, 
+  b, c
+ ],
+ [ a, 
+   b, c
+  ],
+
+ [
+ a,
+ b
+],
+ {a, 
+  b,c
+ },
+ { a, 
+  b,c
+    },
+
+ {
+ a,
+ b
+ },
+    
+<<1:8,
+  2:8
+  >>,
+ <<
+ 1:8,
+ 2:8
+  >>,
+ << 1:8,
+   2:8
+    >>,
+
+ (a,
+  b,
+  c
+ ),
+
+    ( a,
+     b,
+     c
+    ),
+
+    
+ (
+  a,
+  b,
+  c
+ ),
+
+ call(2#42423 bor 
+   #4234,
+  2#5432,
+ other_arg),
+ ok;
+indent_basics(Xlongname, 
+     #struct{a=Foo,
+     b=Bar}, 
+       [X|
+	Y]) ->
+ testing_next_clause,
+ ok;
+indent_basics(					% AD added clause
+ X, 						% not sure how this should look
+ Y,
+ Z)
+ when
+ X < 42, Z > 13;
+ Y =:= 4711 ->
+ foo;
+indent_basics(X, Y, Z) when			% AD added clause
+ X < 42, Z > 13;				% testing when indentation
+ Y =:= 4711 ->
+ foo;
+indent_basics(X, Y, Z)				% AD added clause
+ when						% testing when indentation
+ X < 42, Z > 13;				% unsure about this one
+ Y =:= 4711 ->
+ foo.
+
+
+
+indent_nested() ->
+ [
+ {foo, 2, "string"},
+ {bar, 3, "another string"}
+  ].
+
+
+indent_icr(Z) -> 				% icr = if case receive
+ %% If
+ if Z >= 0 ->
+	 X = 43 div 4,
+	 foo(X);
+    Z =< 10 ->
+	 X = 43 div 4,
+	 foo(X);
+    Z == 5 orelse
+    Z == 7 ->
+	 X = 43 div 4,
+	 foo(X);
+    true ->
+	 if_works
+  end,
+ %% Case
+ case {Z, foo, bar} of
+  {Z,_,_} ->
+  X = 43 div 4,
+  foo(X);
+  {Z,_,_}	when
+  Z =:= 42 ->				% AD line should be indented as a when
+  X = 43 div 4,
+  foo(X);
+  {Z,_,_}
+  when Z < 10 ->			% AD when should be indented
+  X = 43 div 4,
+  foo(X);
+  {Z,_,_}
+  when					% AD when should be indented
+  Z < 10				% and the guards should follow when
+  andalso				% unsure about how though
+  true ->
+  X = 43 div 4,
+  foo(X)
+ end,
+ %% begin
+ begin
+ sune,
+ X = 74234 + foo(8456) +
+  345 div 43,
+ ok
+ end,
+
+
+ %% receive
+  receive 
+  {Z,_,_} ->
+    X = 43 div 4,
+    foo(X);
+  Z ->
+   X = 43 div 4,
+   foo(X) 
+  end,
+  receive
+  {Z,_,_} ->
+  X = 43 div 4,
+  foo(X);
+ Z 					% AD added clause
+  when Z =:= 1 ->			% This line should be indented by 2
+  X = 43 div 4,
+  foo(X);
+ Z when					% AD added clause
+  Z =:= 2 ->				% This line should be indented by 2
+  X = 43 div 4,
+  foo(X);
+ Z ->
+    X = 43 div 4,
+    foo(X) 
+ after infinity ->
+    foo(X),
+    asd(X),
+    5*43
+ end,
+ receive
+ after 10 -> 
+ foo(X),
+ asd(X),
+ 5*43
+ end,
+ ok.
+ 
+indent_fun() ->
+    %% Changed fun to one indention level
+Var = spawn(fun(X) 
+       when X == 2;
+	     X > 10 -> 
+  hello,
+  case Hello() of 
+   true when is_atom(X) -> 
+      foo;
+  false ->
+      bar
+  end;
+ (Foo) when is_atom(Foo), 
+   is_integer(X) ->
+  X = 6* 45,
+  Y = true andalso
+	  kalle
+ end),
+  ok.
+
+indent_try_catch() ->
+ try
+ io:format(stdout, "Parsing file ~s, ", 
+ [St0#leex.xfile]),
+ {ok,Line3,REAs,Actions,St3} = 
+ parse_rules(Xfile, Line2, Macs, St2)
+ catch
+  exit:{badarg,R} ->
+  foo(R),
+  io:format(stdout, 
+   "ERROR reason ~p~n",
+    R);
+  error:R 				% AD added clause
+  when R =:= 42 ->			% when should be indented
+  foo(R);
+  error:R 				% AD added clause
+  when					% when should be indented
+  R =:= 42 ->				% but unsure about this (maybe 2 more)
+  foo(R);
+  error:R when				% AD added clause
+  R =:= foo ->				% line should be 2 indented (works)
+  foo(R);
+  error:R ->
+  foo(R),
+  io:format(stdout, 
+   "ERROR reason ~p~n",
+    R)
+ after
+  foo('after'),
+  file:close(Xfile)
+ end;
+indent_try_catch() ->
+ try
+   foo(bar)
+ of
+ X when true andalso
+ kalle ->
+  io:format(stdout, "Parsing file ~s, ",
+  [St0#leex.xfile]),
+  {ok,Line3,REAs,Actions,St3} =
+  parse_rules(Xfile, Line2, Macs, St2);
+ X 					% AD added clause
+  when false andalso			% when should be 2 indented
+  bengt ->
+  gurka();
+ X when					% AD added clause
+  false andalso				% line should be 2 indented
+  not bengt ->
+  gurka();
+ X ->
+  io:format(stdout, "Parsing file ~s, ",
+  [St0#leex.xfile]),
+  {ok,Line3,REAs,Actions,St3} =
+  parse_rules(Xfile, Line2, Macs, St2)
+ catch
+ exit:{badarg,R} ->
+    foo(R),
+    io:format(stdout, 
+	      "ERROR reason ~p~n",
+	      R);
+ error:R ->
+    foo(R),
+    io:format(stdout, 
+	      "ERROR reason ~p~n",
+	      R)
+ after
+ foo('after'),
+  file:close(Xfile),
+  bar(with_long_arg,
+       with_second_arg)
+ end;
+ indent_try_catch() ->
+ try foo()
+ after 
+  foo(),
+  bar(with_long_arg,
+      with_second_arg)
+ end.
+
+indent_catch() ->
+  D = B +
+  float(43.1),
+    
+  B = catch oskar(X),
+  
+  A = catch (baz + 
+      bax),
+ catch foo(),
+
+  C = catch B + 
+     float(43.1),
+ 
+  case catch foo(X) of
+  A ->
+ B
+ end,
+
+ case
+  catch foo(X)
+ of
+ A ->
+   B
+  end,
+
+  case
+  foo(X)
+   of
+ A ->
+	  catch B,
+	  X
+   end,
+
+ try sune of
+ _ -> foo
+   catch _:_ -> baf
+   end,
+
+    try
+sune
+   of
+ _ ->
+   X = 5,
+   (catch foo(X)),
+   X + 10
+   catch _:_ -> baf
+   end,
+
+   try
+ (catch sune)
+   of
+ _ ->
+   catch foo()  %% BUGBUG can't handle catch inside try without parentheses
+   catch _:_ ->
+    baf
+   end,
+
+   try
+(catch exit())
+   catch
+_ ->
+    catch baf()
+   end,
+ ok.
+
+indent_binary() ->
+  X = lists:foldr(fun(M) ->
+    <<Ma/binary, " ">>
+    end, [], A),
+  A = <<X/binary, 0:8>>,
+  B.
+
+
+indent_comprehensions() ->
+%% I don't have a good idea how we want to handle this 
+%% but they are here to show how they are indented today.
+Result1 = [X || 
+  #record{a=X} <- lists:seq(1, 10),
+  true = (X rem 2)
+     ],
+Result2 = [X || <<X:32,_:32>> <= <<0:512>>,
+    true = (X rem 2)
+       ],
+
+Binary1 = << <<X:8>> || 
+  #record{a=X} <- lists:seq(1, 10),
+  true = (X rem 2)
+      >>,
+
+Binary2 = << <<X:8>> || <<X:32,_:32>> <= <<0:512>>,
+  true = (X rem 2)
+      >>,
+ok.
+
+%% This causes an error in earlier erlang-mode versions.
+foo() ->
+[#foo{
+foo = foo}].
+
+%% Record indentation
+some_function_with_a_very_long_name() ->
+ #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b},
+ case dummy_function_with_a_very_very_long_name(x) of
+ #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b} ->
+ ok;
+ Var = #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b} ->
+ Var#'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b};
+ #xyz{
+ a=1,
+ b=2} ->
+ ok
+ end.
+
+another_function_with_a_very_very_long_name() ->
+ #rec{
+ field1=1,
+ field2=1}.
+
+some_function_name_xyz(xyzzy, #some_record{
+ field1=Field1,
+ field2=Field2}) ->
+ SomeVariable = f(#'Some-long-record-name'{
+ field_a = 1,
+ 'inter-xyz-parameters' =
+ #'Some-other-very-long-record-name'{
+ field2 = Field1,
+ field2 = Field2}}),
+ {ok, SomeVariable}.
diff --git a/lib/wx/api_gen/Makefile b/lib/wx/api_gen/Makefile
index 8adb485..c0f13fd 100644
--- a/lib/wx/api_gen/Makefile
+++ b/lib/wx/api_gen/Makefile
@@ -25,7 +25,7 @@ WXGTK_DIR = /usr/include/wx-2.8
 #WXGTK_DIR = /opt/wxgtk2.8.9/include/wx-2.8
 GL_DIR = /usr/include/GL
 
-ERL_COMPILE_FLAGS=+debug_info +warn_unused_vars
+ERL_COMPILE_FLAGS=+warn_unused_vars
 
 COMPILER = gen_util wx_gen wx_gen_erl wx_gen_cpp
 COMPILER_T = $(COMPILER:%=$(EBIN)/%.beam)
diff --git a/make/otp.mk.in b/make/otp.mk.in
index d742205..e1bf023 100644
--- a/make/otp.mk.in
+++ b/make/otp.mk.in
@@ -63,7 +63,6 @@ HCC = @HCC@
 CC32 = @CC32@
 CFLAGS32 = @CFLAGS32@
 BASIC_CFLAGS = @CFLAGS@
-DEBUG_FLAGS =  @DEBUG_FLAGS@
 LD = @LD@
 RANLIB = @RANLIB@
 AR = @AR@
@@ -87,8 +86,6 @@ else
   else
     ifdef BOOTSTRAP
       ERL_COMPILE_FLAGS += +slim
-    else
-      ERL_COMPILE_FLAGS += +debug_info
     endif
   endif
 endif