Function: tex--thing-at-point

tex--thing-at-point is a byte-compiled function defined in tex-mode.el.gz.

Signature

(tex--thing-at-point)

Documentation

Demarcate thing-at-point for the TeX xref backend.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/tex-mode.el.gz
;; The detection of `_' and `:' is a primitive method for determining
;; whether point is on an expl3 construct.  It may fail in some
;; instances.
(defun tex--thing-at-point ()
  "Demarcate `thing-at-point' for the TeX `xref' backend."
  (let ((bounds (tex--bounds-of-symbol-at-point)))
    (when bounds
      (let ((texsym (buffer-substring-no-properties (car bounds) (cdr bounds))))
        (if (and (not (string-match-p "reference" (symbol-name this-command)))
                 (seq-contains-p texsym ?_)
                 (seq-contains-p texsym ?:))
            (seq-take texsym (seq-position texsym ?:))
          texsym)))))