Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 7641)
+++ wp-includes/taxonomy.php	(working copy)
@@ -2031,4 +2031,24 @@
 	return get_object_taxonomies($post);
 }
 
+// FIXME: testing only, to be removed
+function add_test_taxonomies_alex() {
+register_taxonomy(
+'people',
+array('attachment:image', 'attachment:video', 'attachment:audio', 'post', 'page'),
+array(
+'label' => __('People'),
+'template' => __('People: %l.'),
+'helps' => __('Separate people with commas.'),
+'sort' => true,
+'args' => array('orderby' => 'term_order'),
+'rewrite' => array('slug' => 'person'),
+)
+);
+	register_taxonomy( 'post_place', 'post' );
+}
+
+add_action('init', 'add_test_taxonomies_alex');
+
+
 ?>
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 7641)
+++ wp-includes/post.php	(working copy)
@@ -1320,7 +1320,15 @@
 	}
 
 	wp_set_post_categories( $post_ID, $post_category );
-	wp_set_post_tags( $post_ID, $tags_input );
+	// old-style tags_input
+	if ( !empty($tags_input) )
+		wp_set_post_tags( $post_ID, $tags_input );
+	// new-style support for all tag-like taxonomies
+	if ( !empty($tax_input) ) {
+		foreach ( $tax_input as $taxonomy => $tags ) {
+			wp_set_post_tax( $post_ID, $taxonomy, $tags );			
+		}
+	}
 
 	$current_guid = get_post_field( 'guid', $post_ID );
 
@@ -1474,6 +1482,10 @@
 }
 
 function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) {
+	return wp_set_post_tax( $post_id, 'post_tag', $tags, $append);
+}
+
+function wp_set_post_tax( $post_id = 0, $taxonomy='post_tag', $tags = '', $append = false ) {
 	/* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */
 
 	$post_id = (int) $post_id;
@@ -1484,7 +1496,7 @@
 	if ( empty($tags) )
 		$tags = array();
 	$tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \n\t\r\0\x0B,") );
-	wp_set_object_terms($post_id, $tags, 'post_tag', $append);
+	wp_set_object_terms($post_id, $tags, $taxonomy, $append);
 }
 
 /**
Index: wp-includes/js/autosave.js
===================================================================
--- wp-includes/js/autosave.js	(revision 7641)
+++ wp-includes/js/autosave.js	(working copy)
@@ -133,10 +133,14 @@
 		post_ID:  jQuery("#post_ID").val() || 0,
 		post_title: jQuery("#title").val() || "",
 		autosavenonce: jQuery('#autosavenonce').val(),
-		tags_input: jQuery("#tags-input").val() || "",
+		//tags_input: jQuery("#tags-input").val() || "",
 		post_type: jQuery('#post_type').val() || "",
 		autosave: 1
 	};
+	
+	jQuery('.tags-input').each( function() {
+		post_data[this.name] = this.value;
+	} );
 
 	// We always send the ajax request in order to keep the post lock fresh.
 	// This (bool) tells whether or not to write the post to the DB during the ajax request.
Index: wp-admin/admin-ajax.php
===================================================================
--- wp-admin/admin-ajax.php	(revision 7641)
+++ wp-admin/admin-ajax.php	(working copy)
@@ -465,7 +465,6 @@
 
 	$_POST['post_status'] = 'draft';
 	$_POST['post_category'] = explode(",", $_POST['catslist']);
-	$_POST['tags_input'] = explode(",", $_POST['tags_input']);
 	if($_POST['post_type'] == 'page' || empty($_POST['post_category']))
 		unset($_POST['post_category']);
 
Index: wp-admin/wp-admin.css
===================================================================
--- wp-admin/wp-admin.css	(revision 7641)
+++ wp-admin/wp-admin.css	(working copy)
@@ -892,24 +892,24 @@
 
 /* Post Screen */
 
-#tagsdiv #newtag {
+.tagsdiv .newtag {
 	margin-right: 5px;
 	width: 16em;
 }
 
-#tagchecklist {
+.tagchecklist {
 	margin-left: 10px;
 
 	font-size: 12px;
 	overflow: auto;
 }
 
-#tagchecklist strong {
+.tagchecklist strong {
 	margin-left: -8px;
 	position: absolute;
 }
 
-#tagchecklist span {
+.tagchecklist span {
 	margin-right: 25px;
 	display: block;
 	float: left;
@@ -919,7 +919,7 @@
 	cursor: default;
 }
 
-#tagchecklist span a {
+.tagchecklist span a {
 	margin: 6px 0pt 0pt -9px;
 	cursor: pointer;
 	width: 10px;
Index: wp-admin/includes/taxonomy.php
===================================================================
--- wp-admin/includes/taxonomy.php	(revision 7641)
+++ wp-admin/includes/taxonomy.php	(working copy)
@@ -150,4 +150,24 @@
 	return wp_insert_term($tag_name, 'post_tag');
 }
 
+//
+// Other
+//
+
+// equivalent to get_tags_to_edit(), but for any tag-like taxonomy
+function get_tax_to_edit( $post_id, $taxonomy ) {
+	$post_id = (int) $post_id;
+	if ( !$post_id )
+		return false;
+
+	$tags = wp_get_object_terms( $post_id, $taxonomy, array('fields'=>'names') );
+	if ( !$tags )
+		return false;
+	
+	$tags_to_edit = join( ', ', $tags );
+	$tags_to_edit = attribute_escape( $tags_to_edit );
+	$tags_to_edit = apply_filters( 'tax_to_edit', $tags_to_edit, $taxonomy );
+	return $tags_to_edit;
+}
+
 ?>
Index: wp-admin/js/post.js
===================================================================
--- wp-admin/js/post.js	(revision 7641)
+++ wp-admin/js/post.js	(working copy)
@@ -2,8 +2,9 @@
 
 function new_tag_remove_tag() {
 	var id = jQuery( this ).attr( 'id' );
-	var num = id.substr( 10 );
-	var current_tags = jQuery( '#tags-input' ).val().split(',');
+	var num = id.split('-check-num-')[1];
+	var obj = jQuery(this).parents('.tagsdiv');
+	var current_tags = jQuery(obj).find( '.tags-input' ).val().split(',');
 	delete current_tags[num];
 	var new_tags = [];
 	jQuery.each( current_tags, function( key, val ) {
@@ -11,60 +12,93 @@
 			new_tags = new_tags.concat( val );
 		}
 	});
-	jQuery( '#tags-input' ).val( new_tags.join( ',' ).replace( /\s*,+\s*/, ',' ).replace( /,+/, ',' ).replace( /,+\s+,+/, ',' ).replace( /,+\s*$/, '' ).replace( /^\s*,+/, '' ) );
-	tag_update_quickclicks();
-	jQuery('#newtag').focus();
+	jQuery( obj ).find( '.tags-input' ).val( new_tags.join( ',' ).replace( /\s*,+\s*/, ',' ).replace( /,+/, ',' ).replace( /,+\s+,+/, ',' ).replace( /,+\s*$/, '' ).replace( /^\s*,+/, '' ) );
+	tag_update_quickclicks(obj);
+	jQuery( obj ).find('input.newtag').focus();
 	return false;
 }
 
-function tag_update_quickclicks() {
-	var current_tags = jQuery( '#tags-input' ).val().split(',');
-	jQuery( '#tagchecklist' ).empty();
+function tag_update_quickclicks(obj) {
+	var current_tags = jQuery(obj).find('.tags-input').val().split(',');
+	jQuery(obj).find( '.tagchecklist' ).empty();
 	shown = false;
 //	jQuery.merge( current_tags, current_tags ); // this doesn't work anymore, need something to array_unique
 	jQuery.each( current_tags, function( key, val ) {
 		val = val.replace( /^\s+/, '' ).replace( /\s+$/, '' ); // trim
 		if ( !val.match(/^\s+$/) && '' != val ) {
-			txt = '<span><a id="tag-check-' + key + '" class="ntdelbutton">X</a>&nbsp;' + val + '</span> ';
-			jQuery( '#tagchecklist' ).append( txt );
-			jQuery( '#tag-check-' + key ).click( new_tag_remove_tag );
+			var button_id = jQuery(obj).attr('id') + '-check-num-' + key;
+			txt = '<span><a id="' + button_id + '" class="ntdelbutton">X</a>&nbsp;' + val + '</span> ';
+			jQuery(obj).find( '.tagchecklist' ).append( txt );
+			jQuery( '#' + button_id ).click( new_tag_remove_tag );
 			shown = true;
 		}
 	});
 	if ( shown )
-		jQuery( '#tagchecklist' ).prepend( '<strong>'+postL10n.tagsUsed+'</strong><br />' );
+		jQuery(obj).find( '.tagchecklist' ).prepend( '<strong>'+postL10n.tagsUsed+'</strong><br />' );
 }
 
-function tag_flush_to_text() {
-	var newtags = jQuery('#tags-input').val() + ',' + jQuery('#newtag').val();
+function tag_flush_to_text(obj) {
+	obj = jQuery(obj).parents('.tagsdiv');
+	
+	var newtags = jQuery(obj).find('.tags-input').val() + ',' + jQuery(obj).find('input.newtag').val();
 	// massage
 	newtags = newtags.replace( /\s+,+\s*/g, ',' ).replace( /,+/g, ',' ).replace( /,+\s+,+/g, ',' ).replace( /,+\s*$/g, '' ).replace( /^\s*,+/g, '' );
-	jQuery('#tags-input').val( newtags );
-	tag_update_quickclicks();
-	jQuery('#newtag').val('');
-	jQuery('#newtag').focus();
+	jQuery(obj).find('.tags-input').val( newtags );
+	tag_update_quickclicks(obj);
+	jQuery(obj).find('input.newtag').val('');
+	jQuery(obj).find('input.newtag').focus();
 	return false;
 }
 
 function tag_save_on_publish() {
-	if ( jQuery('#newtag').val() != postL10n.addTag )
-		tag_flush_to_text();
+	jQuery('.tagsdiv').each( function(i) {
+		if ( jQuery(this).find('input.newtag').val() != postL10n.addTag )
+			tag_flush_to_text(this);
+		} );
 }
 
 function tag_press_key( e ) {
 	if ( 13 == e.keyCode ) {
-		tag_flush_to_text();
+		tag_flush_to_text(e.target);
 		return false;
 	}
 }
 
+function tag_init() {
+	jQuery('.ajaxtag').show();
+	jQuery('.tags-input').hide();
+	jQuery('.tagsdiv').each( function(i) {
+			tag_update_quickclicks(this);
+		} );
+		
+	// add the quickadd form
+	jQuery('.ajaxtag input.tagadd').click( tag_flush_to_text );
+	jQuery('.ajaxtag input.newtag').focus(function() {
+		if ( this.value == postL10n.addTag )
+			jQuery(this).val( '' ).removeClass( 'form-input-tip' );
+	});
+	jQuery('.ajaxtag input.newtag').blur(function() {
+		if ( this.value == '' )
+			jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' );
+	});
+
+	// auto-save tags on post save/publish
+	jQuery('#publish').click( tag_save_on_publish );
+	jQuery('#save-post').click( tag_save_on_publish );
+
+	// catch the enter key
+	jQuery('.ajaxtag input.newtag').keypress( tag_press_key );
+
+}
+
+
 jQuery(document).ready( function() {
-	// close postboxes that should be closed
-	jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
+	// close postboxes that should be closed 
+	jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); 
 
-	// show things that should be visible, hide what should be hidden
-	jQuery('.hide-if-no-js').show();
-	jQuery('.hide-if-js').hide();
+	// show things that should be visible, hide what should be hidden 
+	jQuery('.hide-if-no-js').show(); 
+	jQuery('.hide-if-js').hide(); 
 
 	// postboxes
 	add_postbox_toggles('post');
@@ -74,30 +108,14 @@
 
 	// hide advanced slug field
 	jQuery('#slugdiv').hide();
+	
+	// prepare the tag UI
+	tag_init();
 
-	jQuery('#tags-input').hide();
-	tag_update_quickclicks();
-	// add the quickadd form
-	jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="button" class="button" id="tagadd" value="' + postL10n.add + '" tabindex="3" /><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');
-	jQuery('#tagadd').click( tag_flush_to_text );
-	jQuery('#newtag').focus(function() {
-		if ( this.value == postL10n.addTag )
-			jQuery(this).val( '' ).removeClass( 'form-input-tip' );
-	});
-	jQuery('#newtag').blur(function() {
-		if ( this.value == '' )
-			jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' );
-	});
-
-	// auto-save tags on post save/publish
-	jQuery('#publish').click( tag_save_on_publish );
-	jQuery('#save-post').click( tag_save_on_publish );
-
 	jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } );
 
 	// auto-suggest stuff
 	jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2 } );
-	jQuery('#newtag').keypress( tag_press_key );
 
 	// category tabs
 	var categoryTabs =jQuery('#category-tabs').tabs();
Index: wp-admin/edit-form-advanced.php
===================================================================
--- wp-admin/edit-form-advanced.php	(revision 7641)
+++ wp-admin/edit-form-advanced.php	(working copy)
@@ -205,14 +205,36 @@
 <?php echo $form_pingback ?>
 <?php echo $form_prevstatus ?>
 
-<div id="tagsdiv" class="postbox <?php echo postbox_classes('tagsdiv', 'post'); ?>">
-<h3><?php _e('Tags'); ?></h3>
+<?php
+
+// all tag-style post taxonomies
+foreach ( get_object_taxonomies('post') as $_tax ) {
+	if ( !is_taxonomy_hierarchical($_tax) ) {
+		$taxonomy = get_taxonomy($_tax);
+
+		$label = ( isset($taxonomy->label) ? $taxonomy->label : $_tax );
+		$helps = ( isset($taxonomy->helps) ? $taxonomy->helps : __('Separate tags with commas') );
+		
+		$tags_to_edit = get_tax_to_edit( $post_ID, $_tax );
+
+		?>
+<div id="tagsdiv-<?php echo $_tax; ?>" class="postbox tagsdiv <?php echo postbox_classes('tagsdiv-'.$_tax, 'post'); ?>">
+<h3><?php echo $label; ?></h3>
 <div class="inside">
-<p id="jaxtag"><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID ); ?>" /></p>
-<div id="tagchecklist"></div>
+<p class="jaxtag"><input type="text" name="<?php echo "tax_input[{$_tax}]"; ?>" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo $tags_to_edit; ?>" />
+
+<span class="ajaxtag" style="display:none;"><input type="text" name="newtag[]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php _e('Add new tag'); ?>" /><input type="button" class="button tagadd" value="<?php _e('Add'); ?>" tabindex="3" /><input type="hidden"/><input type="hidden"/><span class="howto"><?php echo $helps; ?></span></span>
+	
+	</p>
+<div class="tagchecklist"></div>
 </div>
 </div>
+		<?
+	}
+}
 
+?>
+
 <div id="categorydiv" class="postbox <?php echo postbox_classes('categorydiv', 'post'); ?>">
 <h3><?php _e('Categories') ?></h3>
 <div class="inside">
Index: wp-admin/css/colors-fresh.css
===================================================================
--- wp-admin/css/colors-fresh.css	(revision 7641)
+++ wp-admin/css/colors-fresh.css	(working copy)
@@ -434,11 +434,11 @@
 	border-top-color: #e4f2fd;
 }
 
-#tagchecklist span a {
+.tagchecklist span a {
 	background: url(../images/xit.gif) no-repeat;
 }
 
-#tagchecklist span a:hover {
+.tagchecklist span a:hover {
 	background: url(../images/xit.gif) no-repeat -10px 0;
 }
 
Index: wp-admin/css/colors-classic.css
===================================================================
--- wp-admin/css/colors-classic.css	(revision 7641)
+++ wp-admin/css/colors-classic.css	(working copy)
@@ -466,11 +466,11 @@
 	color: #cfebf6;
 }
 
-#tagchecklist span a {
+.tagchecklist span a {
 	background: url(../images/xit.gif) no-repeat;
 }
 
-#tagchecklist span a:hover {
+.tagchecklist span a:hover {
 	background: url(../images/xit.gif) no-repeat -10px 0;
 }
 
