Variable: ghostel-file-detection-path-regex

ghostel-file-detection-path-regex is a customizable variable defined in ghostel-links.el.

Value

"[~[:alnum:]_.-]*/[^]   \n
:\"<>(){}[`']*[^]     \n
:\"<>(){}[`'.,;!?]"

Documentation

Regex matching the PATH portion of a file:line[:col] reference.

Ghostel adds the leading path-boundary anchor and the optional
:LINE[:COL] tail itself, so the value must contain neither.
The final character class excludes sentence punctuation so a path ending a sentence links without the trailing mark.

The match is resolved against default-directory and linkified only when that file exists. The default matches any path with at least one char after a /: absolute, ./, ~/, or bare relative like src/main.rs.

Every distinct match costs a file-exists-p per scan, so broadening the pattern (e.g. to bare file.go without a /) is expensive on slow or network filesystems. Avoid unbounded backtracking; the scan covers every changed region.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-links.el
(defcustom ghostel-file-detection-path-regex
  "[~[:alnum:]_.-]*/[^] \t\n\r:\"<>(){}[`']*[^] \t\n\r:\"<>(){}[`'.,;!?]"
  "Regex matching the PATH portion of a file:line[:col] reference.
Ghostel adds the leading path-boundary anchor and the optional
`:LINE[:COL]' tail itself, so the value must contain neither.
The final character class excludes sentence punctuation so a
path ending a sentence links without the trailing mark.

The match is resolved against `default-directory' and linkified only
when that file exists.  The default matches any path with at least one
char after a `/': absolute, `./', `~/', or bare relative like `src/main.rs'.

Every distinct match costs a `file-exists-p' per scan, so broadening
the pattern (e.g. to bare `file.go' without a `/') is expensive on
slow or network filesystems.  Avoid unbounded backtracking;
the scan covers every changed region."
  :type 'regexp
  :group 'ghostel)