Function: TeX-source-correlate-mode

TeX-source-correlate-mode is an interactive and byte-compiled function defined in tex.el.

Signature

(TeX-source-correlate-mode &optional ARG)

Documentation

Minor mode for forward and inverse search.

If enabled, the viewer can be advised to show the output page corresponding to the point in the source and vice versa.

The method to be used can be controlled with the variable TeX-source-correlate-method. Currently source specials or SyncTeX are recognized.

This is a global minor mode. If called interactively, toggle the Tex-Source-Correlate mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=TeX-source-correlate-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

Key Bindings

Aliases

tex-source-correlate-mode TeX-source-specials-mode (obsolete since 11.86)

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(define-minor-mode TeX-source-correlate-mode
  "Minor mode for forward and inverse search.

If enabled, the viewer can be advised to show the output page
corresponding to the point in the source and vice versa.

The method to be used can be controlled with the variable
`TeX-source-correlate-method'.  Currently source specials or
SyncTeX are recognized."
  :group 'TeX-view
  ;; Since this is a global minor mode and we don't want to require
  ;; tex.el when the mode variable is set, the mode function is called
  ;; explicitly (if necessary) in `TeX-mode'.  We do it there because
  ;; otherwise `kill-all-local-variables' would reset
  ;; `TeX-source-correlate-output-page-function' which is
  ;; buffer-local.
  :global t
  (set-keymap-parent TeX-mode-map (if TeX-source-correlate-mode
                                      TeX-source-correlate-map
                                    text-mode-map))
  (TeX-set-mode-name 'TeX-source-correlate-mode t t)
  (setq TeX-source-correlate-start-server-flag TeX-source-correlate-mode)
  ;; Register Emacs for the SyncSource DBUS signal emitted by
  ;; Evince-compatible viewers.
  (dolist (de-app '(("gnome" "evince") ("mate" "atril") ("x" "reader")))
    (when (TeX-evince-dbus-p (car de-app) (cadr de-app))
      (dbus-register-signal
       :session nil (format "/org/%s/%s/Window/0" (car de-app) (cadr de-app))
       (format "org.%s.%s.Window" (car de-app) (cadr de-app))
       "SyncSource"
       #'TeX-source-correlate-sync-source))))