Index: Tomboy.mdp
===================================================================
--- Tomboy.mdp	(révision 2455)
+++ Tomboy.mdp	(copie de travail)
@@ -145,6 +145,8 @@
     <File name="Tomboy/GnomeFactory.cs" subtype="Code" buildaction="Compile" />
     <File name="Tomboy/WindowsFactory.cs" subtype="Code" buildaction="Compile" />
     <File name="Tomboy/Addins/ExportToHtml/ExportToHtml.xsl" subtype="Code" buildaction="Nothing" />
+    <File name="gtk-gui/gui.stetic" subtype="Code" buildaction="EmbedAsResource" />
+    <File name="gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
Index: Tomboy/PreferencesDialog.cs
===================================================================
--- Tomboy/PreferencesDialog.cs	(révision 2455)
+++ Tomboy/PreferencesDialog.cs	(copie de travail)
@@ -886,9 +886,8 @@
 			Gtk.Dialog advancedDlg =
 			        new Gtk.Dialog (Catalog.GetString ("Other Synchronization Options"),
 			                        this,
-			                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal,
+			                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal | Gtk.DialogFlags.NoSeparator,
 			                        Gtk.Stock.Close, Gtk.ResponseType.Close);
-
 			// Populate dialog
 			Gtk.Label label =
 			        new Gtk.Label (Catalog.GetString ("When a conflict is detected between " +
Index: Tomboy/Watchers.cs
===================================================================
--- Tomboy/Watchers.cs	(révision 2455)
+++ Tomboy/Watchers.cs	(copie de travail)
@@ -374,13 +374,55 @@
 		Gtk.TextMark click_mark;
 
 		const string URL_REGEX =
-		        @"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S*@\S*\.)|/\S+/|~/\S+)\S*\b/?)";
-
+			    @"("+
+		    		@"("+
+		    		    @"(?<=(?<starter>("+        // preceded by a starter 
+		    			 @"(?<starterA>(\())"+	//	opening parenthesis closed by ) 
+		    			@"|(?<starterB>(\[))"+	// or	opening bracket	    closed by ]
+		    			@"|(?<starterC>(\{))"+	// or	opening thing	    closed by }
+		    		    @")))"+
+		    		    @"|\b"+			    //  or at beginning of a word \b
+		    		@")"+
+		    		@"("+					
+		    		    @"("+					
+		    			@"(news|http|https|ftp|file|irc)://"+    // http:// ...
+		    		        @"|mailto:"+				// or mailto...
+		    			@"|(www|ftp)\."+				// or www...
+		    		        @"|\S*@\S*\."+				// or email adress
+		    		    @")"+
+		    		    @"|/\S+/"+				// or starting with '/'
+		    		    @"|~/\S+"+				// or starting with '~/'
+		    		@")"+
+		    		@"(?(starter)"+			    // 	
+		    		    @"(\S(?!("+			    // if starter detected : forbid ender 
+									//ignore this comment (for syntax) ([{
+		    			@"(?(starterA)\)|"+				// closing parenthesis 
+		    			@"(?(starterB)\]|"+				// closing bracket 
+		    			@"(?(starterC)\})))"+				// closing thing 
+		    		    @")))*\S?"+		
+		    		    @"|\S*"+			    // else anything without space
+		    		@")"+
+		    	    @")";
+ 
+		
+		// DEBUG: regression test for Bug 531085
+		// from version 1991 (including patch id=110279) 
+	    	const string URL_REGEX_old_version = @"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S*@\S*\.)|/\S+/|~/\S+)\S*\b/?)";
+		// see also below in "static NoteUrlWatcher ()"
+		
+		// older version	(without patch id=110279)
+		//     @"((\b((news|http|https|ftp|file|irc)://|mailto:|(www|ftp)\.|\S*@\S*\.)|(^|\s)/\S+/|(^|\s)~/\S+)\S*\b/?)";
+	    
+ 
 		static Regex regex;
 		static bool text_event_connected;
 
 		static NoteUrlWatcher ()
 		{
+			// DEBUG: regression test for Bug 531085
+			Logger.Log ("[URL_WATCH] OLD version =>{0}<=",URL_REGEX_old_version );
+			Logger.Log ("[URL_WATCH] NEW version =>{0}<=",URL_REGEX);
+			// END_OF_DEBUG: regression test
 			regex = new Regex (URL_REGEX,
 			                   RegexOptions.IgnoreCase | RegexOptions.Compiled);
 			text_event_connected = false;
