Alter a form based on where it is called from
The following worked for me.

  if ($form_id == 'comment_node_CONTENT_TYPE_form') {
    $view = views_get_current_view();
    if ($view-&gt;current_display == 'block_1') {
      //Alter my form
    }
  }


I checked views_get_current_view function. Since it is using caching there is no harm in calling it again.