Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 3125)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 3126)
@@ -9,19 +9,15 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.objects.Project;
-import org.txm.objects.Text;
 import org.txm.rcp.commands.CloseEditorsUsing;
 import org.txm.rcp.commands.RestartTXM;
-import org.txm.rcp.handlers.scripts.ExecuteImportScript;
 import org.txm.rcp.utils.JobHandler;
-import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.utils.logger.Log;
 
@@ -133,8 +129,7 @@
 					}
 				}
 				catch (InterruptedException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
+					Log.printStackTrace(e);
 					return Status.CANCEL_STATUS;
 				}
 			}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java	(revision 3125)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java	(revision 3126)
@@ -75,26 +75,26 @@
  * @author mdecorde
  */
 public class LoadBinaryCorporaDirectory extends AbstractHandler {
-	
+
 	private static final String ID = LoadBinaryCorporaDirectory.class.getName();
-	
+
 	@Override
 	/**
 	 * calling this command will : open a directory dialog and try to load the content of the selected directory
 	 */
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		
+
 		// create dialog to get the corpus directory
 		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
 		DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN);
 		if (LastOpened.getFile(ID) != null) {
 			dialog.setFilterPath(LastOpened.getFolder(ID) + "/" + LastOpened.getFile(ID));
 		}
-		
+
 		if (dialog.open() != null) {
-			
+
 			File directory = new File(dialog.getFilterPath());
-			
+
 			if (directory.exists()) {
 				LastOpened.set(ID, directory);
 				JobHandler job = loadBinaryCorpusFromCorporaDirectory(directory, true, true, true);
@@ -111,7 +111,7 @@
 		}
 		return null;
 	}
-	
+
 	/**
 	 * stop engines, try loading binary corpora from a directory, restart engines and refresh views
 	 * 
@@ -119,103 +119,106 @@
 	 * @return
 	 */
 	public static JobHandler loadBinaryCorpusFromCorporaDirectory(final File directory, final boolean askSelection, final boolean replace, final boolean loadDirectories) {
-		
+
 		JobHandler jobhandler = new JobHandler(NLS.bind(TXMUIMessages.LoadBinaryCorporaDirectory_loadingCorporaFromTheP0Directory, directory), true) {
-			
+
 			JobHandler self = this;
-			
+
 			@Override
 			protected IStatus run(final IProgressMonitor monitor) {
 				this.runInit(monitor);
-				
-				// try {
-				// SearchEnginesManager.getCQPSearchEngine().stop();
-				// } catch (Exception e1) {
-				// // TODO Auto-generated catch block
-				// e1.printStackTrace();
-				// }
-				
-				File corporaDirectory = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$
-				if (!corporaDirectory.exists()) {
-					Log.severe(TXMUIMessages.LoadBinaryCorporaDirectory_corporaDirectoryNotFoundAborting);
+
+				try {
+					// SearchEnginesManager.getCQPSearchEngine().stop();
+					// } catch (Exception e1) {
+					// // TODO Auto-generated catch block
+					// e1.printStackTrace();
+					// }
+
+					File corporaDirectory = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$
+					if (!corporaDirectory.exists()) {
+						Log.severe(TXMUIMessages.LoadBinaryCorporaDirectory_corporaDirectoryNotFoundAborting);
+						// try {
+						// SearchEnginesManager.getCQPSearchEngine().start(null);
+						// } catch (Exception e) {
+						// // TODO Auto-generated catch block
+						// e.printStackTrace();
+						// }
+						return Status.CANCEL_STATUS;
+					}
+
+					final ArrayList<Project> newProjects = new ArrayList<>();
+					if (askSelection) {
+
+						this.syncExec(new Runnable() {
+
+							@Override
+							public void run() {
+								List<File> files = getBinaryCorpusSelection(directory, loadDirectories);
+								ArrayList<Project> tmp = loadBinaryCorpusFromCorporaDirectory(files, self, monitor, replace);
+								if (tmp != null) {
+									newProjects.addAll(tmp);
+								}
+							}
+						});
+
+					}
+					else { // try loading corpora and dont replace existing corpus
+						List<File> files = Arrays.asList(getBinaryCorpusFiles(directory, loadDirectories));
+						ArrayList<Project> tmp = loadBinaryCorpusFromCorporaDirectory(files, this, monitor, replace);
+						if (tmp != null) {
+							newProjects.addAll(tmp);
+						}
+					}
+
+					// this.acquireSemaphore();
 					// try {
 					// SearchEnginesManager.getCQPSearchEngine().start(null);
 					// } catch (Exception e) {
-					// // TODO Auto-generated catch block
 					// e.printStackTrace();
 					// }
-					return Status.CANCEL_STATUS;
-				}
-				
-				final ArrayList<Project> newProjects = new ArrayList<>();
-				if (askSelection) {
-					
+					// this.releaseSemaphore();
+
+					for (Project newProject2 : newProjects) {
+						try {
+							newProject2.compute(true);
+						}
+						catch (Exception e) {
+							e.printStackTrace();
+						}
+					}
+					if (newProjects.size() > 0) {
+						System.out.println(NLS.bind(TXMUIMessages.P0CorpusLoaded, newProjects.size()));
+					}
+
 					this.syncExec(new Runnable() {
-						
+
 						@Override
 						public void run() {
-							List<File> files = getBinaryCorpusSelection(directory, loadDirectories);
-							ArrayList<Project> tmp = loadBinaryCorpusFromCorporaDirectory(files, self, monitor, replace);
-							if (tmp != null) {
-								newProjects.addAll(tmp);
-							}
+							RestartTXM.reloadViews();
+							StatusLine.setMessage(TXMUIMessages.info_txmIsReady);
 						}
 					});
-					
+				} catch(ThreadDeath ex) {
+					Log.info(TXMUIMessages.executionCanceled);
+					return Status.CANCEL_STATUS;
 				}
-				else { // try loading corpora and dont replace existing corpus
-					List<File> files = Arrays.asList(getBinaryCorpusFiles(directory, loadDirectories));
-					ArrayList<Project> tmp = loadBinaryCorpusFromCorporaDirectory(files, this, monitor, replace);
-					if (tmp != null) {
-						newProjects.addAll(tmp);
-					}
-				}
-				
-				// this.acquireSemaphore();
-				// try {
-				// SearchEnginesManager.getCQPSearchEngine().start(null);
-				// } catch (Exception e) {
-				// e.printStackTrace();
-				// }
-				// this.releaseSemaphore();
-				
-				for (Project newProject2 : newProjects) {
-					try {
-						newProject2.compute(true);
-					}
-					catch (Exception e) {
-						e.printStackTrace();
-					}
-				}
-				if (newProjects.size() > 0) {
-					System.out.println(NLS.bind(TXMUIMessages.P0CorpusLoaded, newProjects.size()));
-				}
-				
-				this.syncExec(new Runnable() {
-					
-					@Override
-					public void run() {
-						RestartTXM.reloadViews();
-						StatusLine.setMessage(TXMUIMessages.info_txmIsReady);
-					}
-				});
-				
 				return Status.OK_STATUS;
 			}
 		};
-		
+
 		jobhandler.schedule();
 		return jobhandler;
 	}
-	
+
 	protected static List<File> getBinaryCorpusSelection(File directory, boolean loadDirectories) {
 		ArrayList<File> selectedFiles = new ArrayList<>();
 		;
 		if (!directory.isDirectory()) return selectedFiles;
 		if (!directory.exists()) return selectedFiles;
-		
+
 		Shell shell = null;
-		
+
 		if (Display.getCurrent() != null) {
 			shell = Display.getCurrent().getActiveShell();
 		}
@@ -229,9 +232,9 @@
 			return selectedFiles;
 		}
 		File[] files = getBinaryCorpusFiles(directory, loadDirectories);
-		
+
 		ListSelectionDialog lsd = new ListSelectionDialog(shell, files, new ArrayContentProvider(), new LabelProvider() {
-			
+
 			@Override
 			public Image getImage(Object element) {
 				File f = (File) element;
@@ -243,13 +246,13 @@
 				}
 				return null;
 			}
-			
+
 			@Override
 			public String getText(Object element) {
 				if (element == null) return "error";//$NON-NLS-1$
-				
+
 				if (!(element instanceof File)) return "not a file (" + element + ")";//$NON-NLS-1$ //$NON-NLS-2$
-				
+
 				File f = (File) element;
 				// if (f.isDirectory()) {
 				// if (new File(f, ".settings").exists()) {//$NON-NLS-1$
@@ -263,7 +266,7 @@
 				// return f.getName();
 				// }
 				return f.getName();
-				
+
 				// return "not a txm corpus (" + f + ")";//$NON-NLS-1$ //$NON-NLS-2$
 			}
 		}, TXMUIMessages.bind(TXMUIMessages.LoadBinaryCorporaDirectory_selectTheTXMCorpusToLoadIn, directory));
@@ -275,38 +278,38 @@
 				selectedFiles.add(new File(o.toString()));
 			}
 		}
-		
+
 		return selectedFiles;
 	}
-	
+
 	private static File[] getBinaryCorpusFiles(File directory, boolean loadDirectories) {
 		File[] files = null;
-		
+
 		if (loadDirectories) {
 			files = directory.listFiles(new FileFilter() {
-				
+
 				@Override
 				public boolean accept(File arg0) {
 					return IOUtils.HIDDENFILE_FILTER.accept(arg0) &&
 							((arg0.isDirectory() && (new File(arg0, "import.xml").exists() || new File(arg0, ".settings").exists()))
 									|| arg0.getName().endsWith(".txm")
-							
-							);
+
+									);
 				}
 			});
 		}
 		else {
 			files = directory.listFiles(new FileFilter() {
-				
+
 				@Override
 				public boolean accept(File arg0) {
 					return IOUtils.HIDDENFILE_FILTER.accept(arg0) && arg0.getName().endsWith(".txm"); //$NON-NLS-1$
 				}
 			});
 		}
-		
+
 		Arrays.sort(files, new Comparator<File>() {
-			
+
 			@Override
 			public int compare(File o1, File o2) {
 				int i = o1.getName().compareTo(o2.getName());
@@ -316,10 +319,10 @@
 				return i;
 			}
 		});
-		
+
 		return files;
 	}
-	
+
 	/**
 	 * dont manage SearchEngine state
 	 * 
@@ -332,7 +335,7 @@
 		File[] files = directory.listFiles(IOUtils.HIDDENFILE_FILTER);
 		return loadBinaryCorpusFromCorporaDirectory(Arrays.asList(files), job, monitor, replace);
 	}
-	
+
 	/**
 	 * dont manage SearchEngine state
 	 * 
@@ -344,42 +347,42 @@
 	 * @return the loaded projects
 	 */
 	protected static ArrayList<Project> loadBinaryCorpusFromCorporaDirectory(List<File> corporaFiles, JobHandler job, IProgressMonitor monitor, boolean replace) {
-		
+
 		ArrayList<Project> projects = new ArrayList<>();
-		
+
 		try {
-			
+
 			// SearchEngine engine = SearchEnginesManager.getCQPSearchEngine();
 			// if (engine.isRunning()) {
 			// engine.stop();
 			// }
-			
+
 			monitor.beginTask(TXMUIMessages.loadingBinaryCorpus, 100);
 			// job.acquireSemaphore();
 			// Toolbox.getEngineManager(EngineType.SEARCH).stopEngines();
 			// job.releaseSemaphore();
-			
+
 			monitor.subTask(TXMUIMessages.loadingTheCorpusInThePlatform);
 			for (File corpusDirectory : corporaFiles) {
 				try {
 					if (corpusDirectory.isHidden()) {
 						continue;
 					}
-					
+
 					Project project = Toolbox.workspace.getProject(corpusDirectory.getName().toUpperCase());
 					if (project != null) {
 						Log.warning(TXMCoreMessages.bind(TXMUIMessages.LoadBinaryCorporaDirectory_aCorpusNamedP0alreadyExistsLoadingOfP1Canceled, corpusDirectory.getName().toUpperCase(),
 								corpusDirectory));
 						continue;
 					}
-					
+
 					if (corpusDirectory.isDirectory()) {
 						project = LoadBinaryCorpus.loadBinaryCorpusAsDirectory(corpusDirectory, monitor, replace);
 					}
 					else {
 						project = LoadBinaryCorpus.loadBinaryCorpusArchive(corpusDirectory, job, monitor, replace);
 					}
-					
+
 					// Project base = LoadBinaryCorpus.loadBinaryCorpusAsDirectory(corpusDirectory);
 					if (project == null) {
 						// Log.warning("Failed to load binary corpus: "+corpusDirectory);
@@ -394,9 +397,9 @@
 					Log.printStackTrace(e2);
 				}
 			}
-			
+
 			monitor.subTask(TXMUIMessages.restartingThePlatform);
-			
+
 		}
 		catch (ThreadDeath td) {
 		}
@@ -406,7 +409,7 @@
 		finally {
 			monitor.done();
 		}
-		
+
 		return projects;
 	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/CloseCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/CloseCorpus.java	(revision 3125)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/CloseCorpus.java	(revision 3126)
@@ -16,8 +16,10 @@
 import org.txm.objects.Project;
 import org.txm.rcp.commands.CloseEditorsUsing;
 import org.txm.rcp.commands.RestartTXM;
+import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.utils.logger.Log;
 
 public class CloseCorpus extends AbstractHandler {
 
@@ -35,7 +37,7 @@
 				corpora.add((MainCorpus)s);
 			}
 		}
-		
+
 		close(corpora);
 
 		return corpora;
@@ -69,16 +71,22 @@
 
 			@Override
 			protected IStatus run(IProgressMonitor monitor) {
-				for (final MainCorpus corpus : corpora) {
-					corpus.getProject().close(monitor);
+				this.runInit(monitor);
+				try {
+					for (final MainCorpus corpus : corpora) {
+						corpus.getProject().close(monitor);
+					}
+
+					this.syncExec(new Runnable() {
+						@Override
+						public void run() {
+							RestartTXM.reloadViews();
+						}
+					});
+				} catch(ThreadDeath ex) {
+					Log.info(TXMUIMessages.executionCanceled);
+					return Status.CANCEL_STATUS;
 				}
-
-				this.syncExec(new Runnable() {
-					@Override
-					public void run() {
-						RestartTXM.reloadViews();
-					}
-				});
 				return Status.OK_STATUS;
 
 			}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3125)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3126)
@@ -1022,6 +1022,7 @@
 				}
 				catch (Exception e) {
 					TXMEditor.this.getResult().resetComputingState();
+					Log.warning(NLS.bind("Error while computing {0}: {1}.", this.getResultObject(), e.getMessage()));
 					Log.printStackTrace(e);
 				}
 				finally {
@@ -1065,7 +1066,6 @@
 		IWorkbenchWindow window = TXMWindows.getActiveWindow();
 		IWorkbenchPage page = window.getActivePage();
 		try {
-			
 			boolean wasAlreadyOpened = SWTEditorsUtils.isOpenEditor(editorInput, editorId);
 			
 			// since some editor fields need some values of their parent,
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/ComputeProgressMonitorDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/ComputeProgressMonitorDialog.java	(revision 3125)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/ComputeProgressMonitorDialog.java	(revision 3126)
@@ -151,5 +151,5 @@
 		this.result.getComputingThread().stop();
 		super.cancelPressed();
 	}
-	
 }
+
