Variable: thing-at-point-provider-alist

thing-at-point-provider-alist is a variable defined in thingatpt.el.gz.

Value

nil

Documentation

Alist of providers for returning a "thing" at point.

This variable can be set globally, or appended to buffer-locally by modes, to provide functions that will return a "thing" at point. The first provider for the "thing" that returns a non-nil value wins.

For instance, a major mode could say:

(setq-local thing-at-point-provider-alist
            (append thing-at-point-provider-alist
                    '((url . my-mode--url-at-point))))

to provide a way to get an url at point in that mode. The provider functions are called with no parameters at the point in question.

"things" include symbol, list, sexp, defun, filename,
existing-filename, url, email, uuid, word, sentence, whitespace, line, and page.

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/thingatpt.el.gz
(defvar thing-at-point-provider-alist nil
  "Alist of providers for returning a \"thing\" at point.
This variable can be set globally, or appended to buffer-locally
by modes, to provide functions that will return a \"thing\" at
point.  The first provider for the \"thing\" that returns a
non-nil value wins.

For instance, a major mode could say:

\(setq-local thing-at-point-provider-alist
            (append thing-at-point-provider-alist
                    \\='((url . my-mode--url-at-point))))

to provide a way to get an `url' at point in that mode.  The
provider functions are called with no parameters at the point in
question.

\"things\" include `symbol', `list', `sexp', `defun', `filename',
`existing-filename', `url', `email', `uuid', `word', `sentence',
`whitespace', `line', and `page'.")