Index: misc/autocomplete.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/autocomplete.js,v
retrieving revision 1.17
diff -u -Ff -r1.17 autocomplete.js
--- misc/autocomplete.js	9 Jan 2007 07:31:04 -0000	1.17
+++ misc/autocomplete.js	16 Mar 2007 14:09:16 -0000
@@ -203,8 +203,11 @@     return false;
   var ac = this;
   for (key in matches) {
     var li = document.createElement('li');
+    // Highlight the user input in the current match
+    var search = new RegExp('('+this.input.value+')', 'i');
+    var string = matches[key].replace(search, '<strong>$1</strong>');
     $(li)
-      .html('<div>'+ matches[key] +'</div>')
+      .html('<div>'+ string +'</div>')
       .mousedown(function () { ac.select(this); })
       .mouseover(function () { ac.highlight(this); })
       .mouseout(function () { ac.unhighlight(this); });
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.194
diff -u -Ff -r1.194 profile.module
--- modules/profile/profile.module	11 Feb 2007 09:30:51 -0000	1.194
+++ modules/profile/profile.module	16 Mar 2007 13:55:38 -0000
@@ -707,11 +707,10 @@  * Callback to allow autocomplete of pro
 function profile_autocomplete($field, $string) {
   if (db_result(db_query("SELECT COUNT(*) FROM {profile_fields} WHERE fid = %d AND autocomplete = 1", $field))) {
     $matches = array();
-    $result = db_query_range("SELECT value FROM {profile_values} WHERE fid = %d AND LOWER(value) LIKE LOWER('%s%%') GROUP BY value ORDER BY value ASC", $field, $string, 0, 10);
+    $result = db_query_range("SELECT value FROM {profile_values} WHERE fid = %d AND LOWER(value) LIKE LOWER('%%%s%%') GROUP BY value ORDER BY value ASC", $field, $string, 0, 10);
     while ($data = db_fetch_object($result)) {
       $matches[$data->value] = check_plain($data->value);
     }
-
     print drupal_to_js($matches);
   }
   exit();
@@ -830,7 +829,7 @@  * Retrieve a pipe delimited string of a
  */
 function profile_admin_settings_autocomplete($string) {
   $matches = array();
-  $result = db_query_range("SELECT category FROM {profile_fields} WHERE LOWER(category) LIKE LOWER('%s%%')", $string, 0, 10);
+  $result = db_query_range("SELECT category FROM {profile_fields} WHERE LOWER(category) LIKE LOWER('%%%s%%')", $string, 0, 10);
   while ($data = db_fetch_object($result)) {
     $matches[$data->category] = check_plain($data->category);
   }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.758
diff -u -Ff -r1.758 user.module
--- modules/user/user.module	8 Mar 2007 19:03:48 -0000	1.758
+++ modules/user/user.module	16 Mar 2007 13:41:52 -0000
@@ -2543,7 +2543,7 @@  * Retrieve a pipe delimited string of a
 function user_autocomplete($string = '') {
   $matches = array();
   if ($string) {
-    $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $string, 0, 10);
+    $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", $string, 0, 10);
     while ($user = db_fetch_object($result)) {
       $matches[$user->name] = check_plain($user->name);
    }
