Subject: bug#8252: Please add a function to get files in *grep*

From: Lennart Borgman <[email-masked]>
Date: Mon, 14 Mar 2011 22:46:05 +0100

For example something like this (which I just added to
ourcomments-util.el in nXhtml) works now:

(defun grep-grepped-file (pt)
  "Return grepped file at PT in a `grep-mode' buffer.
The returned file name is relative."
  (let* ((msg (get-text-property (point) 'compilation-message))
         (loc (when msg (compilation--message->loc msg)))
         (file (when loc (caar (compilation--loc->file-struct loc)))))
    file))