Index: core/tdiary.rb
===================================================================
--- core/tdiary.rb	(���r�W���� 30859)
+++ core/tdiary.rb	(��ƃR�s�[)
@@ -854,9 +854,9 @@
 			@update_procs << block
 		end
 
-		def update_proc
+		def update_proc( updated_section = nil )
 			@update_procs.each do |proc|
-				proc.call
+				proc.call( updated_section )
 			end
 			''
 		end
@@ -1591,17 +1591,58 @@
 			@body = conf.to_native( cgi.params['body'][0] )
 			@hide = cgi.params['hide'][0] == 'true' ? true : false
 			@author = conf.multi_user ? cgi.remote_user : nil
+			@updated_section = nil
 			super
 		end
 
 	protected
 		def do_eval_rhtml( prefix )
 			super
-			@plugin.instance_eval { update_proc }
+			_ = updated_section
+			@plugin.instance_eval{ update_proc( _ ) }
 			anchor_str = @plugin.instance_eval( %Q[anchor "#{@diary.date.strftime('%Y%m%d')}"].untaint )
 			clear_cache( /(latest|#{@date.strftime( '%Y%m' )})/ )
 			raise ForceRedirect::new( "#{@conf.index}#{anchor_str}" )
 		end
+
+		UpdatedSection = Struct.new(:before, :after)
+
+		attr_reader :updated_section
+
+		def count_sections( diary )
+			i = 0
+			diary.each_section{ i += 1 }
+			i
+		end
+
+		def before_append( diary )
+			@updated_section ||= UpdatedSection.new
+			nsections = count_sections( diary )
+			@updated_section.before = (nsections+1)...(nsections+1)
+		end
+
+		def after_append( diary )
+			nsections = count_sections( diary )
+			@updated_section.after = @updated_section.before.end...(nsections+1)
+		end
+
+		def before_replace( diary )
+			@updated_section ||= UpdatedSection.new
+			nsections = count_sections( diary )
+			@updated_section.before = 1...(nsections+1)
+		end
+
+		def after_replace( diary )
+			nsections = count_sections( diary )
+			@updated_section.after = 1...(nsections+1)
+		end
+
+		def after_create( diary )
+			@updated_section ||= UpdatedSection.new
+			nsections = count_sections( diary )
+			@updated_section.before = 1...1
+			@updated_section.after = 1...(nsections+1)
+		end
 	end
 
 	#
@@ -1619,7 +1660,9 @@
 			@io.transaction( @date ) do |diaries|
 				@diaries = diaries
 				@diary = self[@date] || @io.diary_factory( @date, @title, '', @conf.style )
+				before_append( @diary )
 				self << @diary.append( @body, @author )
+				after_append( @diary )
 				@diary.set_title( @title ) unless @title.empty?
 				@diary.show( ! @hide )
 				DIRTY_DIARY
@@ -1647,7 +1690,9 @@
 				@diary = self[@date]
 				if @diary then
 					if @date.strftime( '%Y%m%d' ) != old_date then
+						before_append( @diary )
 						@diary.append( @body, @author )
+						after_append( @diary )
 						@diary.set_title( @title ) if @title.length > 0
 					elsif section_id
 						section_to_update = nil
@@ -1658,6 +1703,8 @@
 							if sid == section_id
 								section_to_update = section
 								sections.push [@body, @author]
+								@updated_section = UpdatedSection.new;
+								@updated_section.before = sidx...(sidx+1)
 							else
 								sections.push [section.to_src, section.author]
 							end
@@ -1670,6 +1717,14 @@
 								# like a section-separator and which does not
 								# appear in the source of each section.
 							end
+							nsections = count_sections( @diary )
+							@updated_section.after = @updated_section.before.begin...(nsections+1 - (sidx - @updated_section.before.begin))
+							if @updated_section.before.count != @updated_section.after.count
+								# セクション数の増減は後ろのセクションの idを変更してしまう。
+								# リンク切れ、リンク先違いになってしまうのでこれも変更のうち。
+								@updated_section.before = @updated_section.before.begin...(sidx+1)
+								@updated_section.after = @updated_section.after.begin...(nsections+1)
+							end
 						else
 							raise <<-"ERRMSG".gsub(/^\t{8}/, '').chomp!
 								The section to update was not found.
@@ -1678,10 +1733,13 @@
 							ERRMSG
 						end
 					else
+						before_replace( @diary )
 						@diary.replace( @date, @title, @body )
+						after_replace( @diary )
 					end
 				else
 					@diary = @io.diary_factory( @date, @title, @body, @conf.style )
+					after_create( @diary )
 				end
 				@diary.show( ! @hide )
 				self << @diary
Index: plugin/makerss.rb
===================================================================
--- plugin/makerss.rb	(���r�W���� 30937)
+++ plugin/makerss.rb	(��ƃR�s�[)
@@ -173,7 +173,7 @@
 
 @makerss_rsses << MakeRssNoComments::new( @conf )
 
-def makerss_update
+def makerss_update( updated_section )
 	date = @date.strftime( "%Y%m%d" )
 	diary = @diaries[date]
 
@@ -192,18 +192,26 @@
 
 				if /^(append|replace)$/ =~ @mode then
 					format = "#{date}p%02d"
+					if updated_section
+						updated_section.before.each{|index|
+							id = format % index
+							cache.delete( id )
+						}
+					end
 					index = 0
 					diary.each_section do |section|
 						index += 1
-						id = format % index
-						if diary.visible? and !cache[id] then
-							cache[id] = RDFSection::new( id, Time::now, section )
-						elsif !diary.visible? and cache[id]
-							cache.delete( id )
-						elsif diary.visible? and cache[id]
-							if cache[id].section.body_to_html.strip != section.body_to_html.strip or
-									cache[id].section.subtitle_to_html.strip != section.subtitle_to_html.strip then
+						if updated_section.nil? or updated_section.after.include?( index )
+							id = format % index
+							if diary.visible? and !cache[id] then
 								cache[id] = RDFSection::new( id, Time::now, section )
+							elsif !diary.visible? and cache[id]
+								cache.delete( id )
+							elsif diary.visible? and cache[id]
+								if cache[id].section.body_to_html.strip != section.body_to_html.strip or
+										cache[id].section.subtitle_to_html.strip != section.subtitle_to_html.strip then
+									cache[id] = RDFSection::new( id, Time::now, section )
+								end
 							end
 						end
 					end
@@ -398,8 +406,8 @@
 	"</rdf:RDF>\n"
 end
 
-add_update_proc do
-	makerss_update unless @cgi.params['makerss_update'][0] == 'false'
+add_update_proc do |updated_section|
+	makerss_update( updated_section ) unless @cgi.params['makerss_update'][0] == 'false'
 end
 
 add_header_proc {
