Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/ImportAlignedEditionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/ImportAlignedEditionMacro.groovy	(revision 2985)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/ImportAlignedEditionMacro.groovy	(revision 2986)
@@ -115,6 +115,7 @@
 	}
 	dest_edition = new Edition(dest_text)
 	dest_edition.setName(destination_edition_name)
+	dest_edition.saveParameter("corpus", destination_corpus.getID())
 	dest_edition.pPageNames = src_edition.pPageNames // replace with getter&setter when published in TXM 0.8.1
 	dest_edition.pPageFirstWordIds = src_edition.pPageFirstWordIds
 	dest_edition.compute(false)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/r/Index2barplotMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/r/Index2barplotMacro.groovy	(revision 2985)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/r/Index2barplotMacro.groovy	(revision 2986)
@@ -17,8 +17,8 @@
 String prop = "none"
 if (sel instanceof Index) {
 	println "Sending Index data to R..."
-	((Index)sel).asRMatrix()
-	symbol = "t("+((Index)sel).getSymbol()+'$data)'
+	symbol = ((Index)sel).asRMatrix()
+	symbol = "t("+symbol+'$data)'
 	prop = ((Index)sel).getProperties().toString()
 } else {
 	println "Selection is not an Index. Aborting."
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/tmxLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/tmxLoader.groovy	(revision 2985)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/tmxLoader.groovy	(revision 2986)
@@ -158,6 +158,7 @@
 			def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element,splitTUs);
 			Edition edition = new Edition(t);
 			edition.setName("default");
+			edition.saveParameter("corpus", txmCorpusDir.getName());
 			edition.setIndex(outdir.getAbsolutePath());
 			for (i = 0 ; i < ed.getPageFiles().size();) {
 				File f = ed.getPageFiles().get(i);
Index: tmp/org.txm.core/src/java/org/txm/objects/Text.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Text.java	(revision 2985)
+++ tmp/org.txm.core/src/java/org/txm/objects/Text.java	(revision 2986)
@@ -94,8 +94,7 @@
 	 * Retro compatiblity to load Editions from a XML Element
 	 */
 	protected boolean _load(Element e) {
-		Element src = (Element) e
-				.getElementsByTagName("source").item(0); //$NON-NLS-1$
+		Element src = (Element) e.getElementsByTagName("source").item(0); //$NON-NLS-1$
 		pSource = new File(src.getAttribute("file")); //$NON-NLS-1$
 		// sourcetype = src.getAttribute("type"); //$NON-NLS-1$
 		try {
Index: tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 2985)
+++ tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 2986)
@@ -349,6 +349,17 @@
 				// texts.put(t.getName(), t);
 				// textnames.add(t.getName());
 				// }
+				if (this.getID() != null && this.getID().length() > 0) {
+					try {
+						for (Edition ed : t.getEditions()) {
+							ed.saveParameter("corpus", this.getID());
+						}
+					}
+					catch (Exception e1) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
+				}
 			}
 		}
 		
@@ -781,6 +792,14 @@
 				Text text = this.getProject().getText(id);
 				if (text != null) {
 					Edition biblioEdition = new Edition(text);
+					try {
+						if (this.getID() != null && this.getID().length() > 0) {
+							biblioEdition.saveParameter("corpus", this.getID());
+						}
+					}
+					catch (Exception e) {
+						e.printStackTrace();
+					}
 					biblioEdition.setIndex(url);
 				}
 			}
Index: tmp/org.txm.core/src/java/org/txm/objects/Edition.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Edition.java	(revision 2985)
+++ tmp/org.txm.core/src/java/org/txm/objects/Edition.java	(revision 2986)
@@ -331,7 +331,14 @@
 		
 		if (defaultHtmlDir == null) {
 			File binDir = getText().getProject().getProjectDirectory();
-			defaultHtmlDir = new File(binDir, "HTML/" + getText().getProject().getName() + "/" + getName()); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			// if the edition is not stored in the default corpus which usually has the same name as the project name
+			String corpus = this.getStringParameterValue("corpus");
+			if (corpus == null || corpus.length() == 0) {
+				corpus = getText().getProject().getName();
+			}
+			
+			defaultHtmlDir = new File(binDir, "HTML/" + corpus + "/" + getName()); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		return defaultHtmlDir;
 	}
Index: tmp/org.txm.core/src/java/org/txm/objects/BaseOldParameters.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/BaseOldParameters.java	(revision 2985)
+++ tmp/org.txm.core/src/java/org/txm/objects/BaseOldParameters.java	(revision 2986)
@@ -389,7 +389,7 @@
 		texts.appendChild(text);
 		
 		Element source = texts.getOwnerDocument().createElement("source");//$NON-NLS-1$
-		source.setAttribute("file", sourceFile.getAbsolutePath());//$NON-NLS-1$
+		source.setAttribute("file", "" + sourceFile);//$NON-NLS-1$
 		source.setAttribute("type", ".xml");//$NON-NLS-1$ //$NON-NLS-2$
 		text.appendChild(source);
 		text.appendChild(texts.getOwnerDocument().createElement("editions"));//$NON-NLS-1$
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/dialogs/ExportCorpusDialog.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/dialogs/ExportCorpusDialog.java	(revision 2985)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/dialogs/ExportCorpusDialog.java	(revision 2986)
@@ -85,7 +85,7 @@
 	@Override
 	protected void configureShell(Shell newShell) {
 		super.configureShell(newShell);
-		newShell.setText(NLS.bind("Exporting {0}...", corpus.getName()));
+		newShell.setText(NLS.bind("Exporting {0}...", corpus.getProject().getName().toUpperCase()));
 		newShell.setMinimumSize(400, 300);
 	}
 	
@@ -106,7 +106,7 @@
 		if (previousPath == null || previousPath.length() == 0) {
 			previousPath = System.getProperty("user.home"); //
 		}
-		textField.setText(previousPath + "/" + corpus.getName() + "-" + Toolbox.dateformat.format(Calendar.getInstance().getTime()) + ".txm"); //$NON-NLS-1$
+		textField.setText(previousPath + "/" + corpus.getProject().getName().toUpperCase() + "-" + Toolbox.dateformat.format(Calendar.getInstance().getTime()) + ".txm"); //$NON-NLS-1$
 		
 		selectButton = new Button(comp, SWT.PUSH);
 		selectButton.setText("...");
