Function: ibtypes::grep-single-file

ibtypes::grep-single-file is a byte-compiled function defined in hibtypes.el.

Signature

(ibtypes::grep-single-file)

Documentation

Jump to the source line from a single file, line-numbered grep msg.

Such grep msgs start with the line number followed by a colon. The buffer may contain the file searched prior to any such line or it may not, e.g. {M-!} in which case hpath:get-grep-filename will extract a best guess from the command-history(var)/command-history(fun).

Avoid this situation and force prefixing each line with the filename by including the -H option.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hibtypes.el
(defib grep-single-file ()
  "Jump to the source line from a single file, line-numbered grep msg.
Such grep msgs start with the line number followed by a colon.  The buffer
may contain the file searched prior to any such line or it may not,
e.g. {M-!} in which case `hpath:get-grep-filename' will extract a best
guess from the `command-history'.

Avoid this situation and force prefixing each line with the filename by
including the -H option."
  (let ((file-and-line (hpath:get-grep-filename)))
    (when file-and-line
      (ibut:label-set (concat (file-name-nondirectory (nth 0 file-and-line))
			      ":" (nth 1 file-and-line))
                      (line-beginning-position) (line-end-position))
      (apply #'hact 'hib-link-to-file-line file-and-line))))