Index: MoinMoin/macro/RecentChanges.py
===================================================================
--- MoinMoin/macro/RecentChanges.py	(revision 712)
+++ MoinMoin/macro/RecentChanges.py	(working copy)
@@ -47,33 +47,68 @@
     line = lines[0]
     pagename = line.pagename
     tnow = time.time()
-    is_new = lines[-1].action == 'SAVENEW'
-    # check whether this page is newer than the user's bookmark
-    hilite = line.ed_time_usecs > (bookmark_usecs or line.ed_time_usecs)
+
     page = Page(request, line.pagename)
 
-    html_link = ''
-    if not page.exists():
+    #request.write("pagename=%s<br>\n " % line.pagename)
+    
+    latestrev = None
+    oldestrevline = None
+    for line in lines:
+        #request.write("- rev=%s<br>\n" % line.rev)
+        # Determine the first & last _real_ page revision
+        # (i.e. attachnew/del == 999999; we don't care about these)
+        lrev = int(line.rev)
+        if lrev != 99999999:
+            if latestrev == None:
+                latestrev = lrev
+            oldestrevline = line
+
+    if latestrev and not page.get_rev(rev=latestrev)[2]:
+        # If the latest page revision was a delete, 
         # indicate page was deleted
         html_link = request.theme.make_icon('deleted')
-    elif is_new:
-        # show "NEW" icon if page was created after the user's bookmark
-        if hilite:
-            if page.exists():
-                html_link = request.theme.make_icon('new')
-    elif hilite:
-        # show "UPDATED" icon if page was edited after the user's bookmark
+        #request.write("- DELETED<br>\n")
+    elif oldestrevline and oldestrevline.action == 'SAVENEW':
+        # the oldest change was a create, show it as "new"
+        img = request.theme.make_icon('new')
+        html_link = wikiutil.link_tag(request, wikiutil.quoteWikinameURL(pagename),
+                                       img, formatter=macro.formatter)
+        #request.write("- NEW<br>\n")
+    else:
+        # else call it modified.
         img = request.theme.make_icon('updated')
-        html_link = wikiutil.link_tag(request,
-                                      wikiutil.quoteWikinameURL(pagename) + "?action=diff&date=%d" % bookmark_usecs,
-                                      img, formatter=macro.formatter, pretty_url=1)
-    else:
-        # show "DIFF" icon else
-        img = request.theme.make_icon('diffrc')
-        html_link = wikiutil.link_tag(request,
-                                      wikiutil.quoteWikinameURL(line.pagename) + "?action=diff",
-                                      img, formatter=macro.formatter, pretty_url=1)
+        html_link = ''
 
+        if latestrev:
+            # Try to link from the latest rev to one-before the oldest rev.
+            # Need to figure out what the next-oldest revision is.
+            oldestrev = int(oldestrevline.rev)
+            found = False
+            prehistoric_rev = None
+            for rev in page.getRevList():
+                if found:
+                    prehistoric_rev = rev
+                    break
+                elif rev == oldestrev:
+                    found = True
+
+            if prehistoric_rev:
+                html_link = wikiutil.link_tag(request,
+                                  wikiutil.quoteWikinameURL(pagename) 
+                                  + "?action=diff&rev1=%d&rev2=%d" % (prehistoric_rev, latestrev),
+                                  img, formatter=macro.formatter)
+                #request.write("- DIFF between %d and %d<br>\n" % (prehistoric_rev, latestrev))
+ 
+        if not html_link:
+            # There wasn't anything to diff (probably just attachment changes)
+            # so just link to the page.
+            html_link = wikiutil.link_tag(request, wikiutil.quoteWikinameURL(pagename),
+                                          img, formatter=macro.formatter)
+            
+        #request.write("- MOD<br>\n")
+    #request.write("<br>\n")
+
     # print name of page, with a link to it
     force_split = len(page.page_name) > _MAX_PAGENAME_LENGTH
     
@@ -323,7 +358,9 @@
             this_day = day
 
         if ignore_pages.has_key(line.pagename):
-            continue
+            # Don't ignore pages just because we've already seen a change
+            #continue
+            pass
         
         # end listing by default if user has a bookmark and we reached it
         if not max_days and not hilite:
