Index: trac/ticket/web_ui.py
===================================================================
--- trac/ticket/web_ui.py	(revision 3390)
+++ trac/ticket/web_ui.py	(working copy)
@@ -328,7 +328,7 @@
                       'closed': ('closedticket', 'closed'),
                       'edit': ('editedticket', 'updated')}
 
-        def produce((id, t, author, type, summary), status, fields, comment):
+        def produce((id, t, author, type, summary), status, fields, comment, cid):
             if status == 'edit':
                 if 'ticket_details' in filters:
                     info = ''
@@ -352,6 +352,10 @@
             href = format == 'rss' and req.abs_href.ticket(id) or \
                                        req.href.ticket(id)
 
+            if cid:
+                cid = cid.split('.')[-1]
+                href += '#comment:' + cid
+
             if status == 'new':
                 message = summary
             else:
@@ -381,19 +385,20 @@
             for id,t,author,type,summary,field,oldvalue,newvalue in cursor:
                 if not previous_update or (id,t,author) != previous_update[:3]:
                     if previous_update:
-                        ev = produce(previous_update, status, fields, comment)
+                        ev = produce(previous_update, status, fields, comment, cid)
                         if ev:
                             yield ev
                     status, fields, comment = 'edit', {}, ''
                     previous_update = (id,t,author, type, summary)
                 if field == 'comment':
+                    cid = oldvalue
                     comment = newvalue
                 elif field == 'status' and newvalue in ('reopened', 'closed'):
                     status = newvalue
                 else:
                     fields[field] = newvalue
             if previous_update:
-                ev = produce(previous_update, status, fields, comment)
+                ev = produce(previous_update, status, fields, comment, cid)
                 if ev:
                     yield ev
             
@@ -403,7 +408,7 @@
                                "  FROM ticket WHERE time>=%s AND time<=%s",
                                (start, stop))
                 for row in cursor:
-                    yield produce(row, 'new', {}, None)
+                    yield produce(row, 'new', {}, None, None)
 
     # Internal methods
 

