Function: grep-file-at-point

grep-file-at-point is a byte-compiled function defined in grep.el.gz.

Signature

(grep-file-at-point POINT)

Documentation

Return the name of the file at POINT a grep-mode buffer.

The returned file name is relative.

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/grep.el.gz
(defun grep-file-at-point (point)
  "Return the name of the file at POINT a `grep-mode' buffer.
The returned file name is relative."
  (when-let ((msg (get-text-property point 'compilation-message))
             (loc (compilation--message->loc msg)))
    (caar (compilation--loc->file-struct loc))))