I have had to do some work on theming comments for a while now and have hit some serious limitations with the comments module. It is very hard to change how comments are displayed, 5.0 has some improvements, but there are still a few issues. Here is my newest one:
I want to render comments flat (without threads, in date order) but I want to add a link to the comment that this comment is in reply to. However, I cannot actually tell whether the parent comment will be displayed on the page. This will only be an issue ina few rare occasions, but, it will still mean that someone will click a link that says "This comment is a reply to ...", but it will go nowhere.
The problem is that each comment is rendered as it is retrieved from the database. We need to change this t be a two pass process, with each comment loaded into an array and then the whole array passed to a themeable function that will render them all.
Comments
There are other issues that
There are other issues that arise as a result of this process of theming comments as they are retrieved: there is no way you can get any information about other comments (well, not without extra database work.)
I added my "In reply to" link, but found that it was often a little difficult to know which comment we should be looking at, so, I wanted to change the link to "in reply to 'comment title'", but, no, there is no way to access information on the other comments. The only way to achieve this would be to create a static variable to store all the comment data after I load them again.