Function: tagref--enable-in-buffer

tagref--enable-in-buffer is a natively compiled function defined in tagref.el.

Signature

(tagref--enable-in-buffer)

Documentation

Enable tagref features in the current buffer if in an enabled project.

Source Code

;; Defined in /nix/store/mnch55hf9yszlb4dvfqhbqf0840v41qh-emacs-packages-deps/share/emacs/site-lisp/tagref.el
;;;; Minor Mode

(defun tagref--enable-in-buffer ()
  "Enable tagref features in the current buffer if in an enabled project."
  (when (and (tagref--in-enabled-project-p)
             ;; Only enable in programming/text modes to avoid slowing
             ;; down search buffers and other special buffers
             (derived-mode-p 'prog-mode 'text-mode 'conf-mode))
    (setq tagref-mode t)
    (tagref--enable-font-lock)
    ;; Add completion and xref hooks
    (add-hook 'completion-at-point-functions #'tagref-completion-at-point -90 t)
    (add-hook 'xref-backend-functions #'tagref--xref-backend nil t)))