Function: TeX-error-overview-goto-source

TeX-error-overview-goto-source is an interactive and byte-compiled function defined in tex.el.

Signature

(TeX-error-overview-goto-source &optional BUTTON)

Documentation

Go to the error point in the source.

If optional argument BUTTON is non-nil, go to source associated to the selected error.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX-error-overview-goto-source (&optional button)
  "Go to the error point in the source.
If optional argument BUTTON is non-nil, go to source associated
to the selected error."
  (interactive)
  (let ((index (if button (button-get button 'id) (tabulated-list-get-id)))
        item window)
    (if index
        (progn
          ;; Select the source frame/window, if still live.
          (if (TeX-error-overview-setup)
              (if (frame-live-p TeX-error-overview-orig-frame)
                  (select-frame TeX-error-overview-orig-frame)
                (error "You have deleted a vital frame---\
please restart TeX error overview"))
            (if (window-live-p TeX-error-overview-orig-window)
                (select-window TeX-error-overview-orig-window)
              (error "You have deleted a vital window---\
please restart TeX error overview")))
          ;; Get the error details.
          (with-current-buffer TeX-error-overview-active-buffer
            (setq item (nth index TeX-error-list)
                  TeX-error-last-visited index))
          ;; Find the error and display the help.
          (with-current-buffer TeX-command-buffer
            ;; Find the error and display the help.
            (apply #'TeX-find-display-help item))
          ;; Return to the error overview.
          (if (TeX-error-overview-setup)
              (select-frame TeX-error-overview-frame)
            (if (setq window
                      (get-buffer-window TeX-error-overview-buffer-name))
                ;; If error overview window is visible just select it.
                (select-window window)
              ;; Otherwise, split the help window and display the error overview
              ;; near to it.  This should be the only reason for the error
              ;; overview window not being still visible after the beginning of
              ;; the function.
              (select-window
               (get-buffer-window (cond
                                   ((eq TeX-display-help 'expert)
                                    TeX-error-overview-active-buffer)
                                   (TeX-display-help  "*TeX Help*"))))
              (if (window-splittable-p (selected-window) t)
                  (split-window-horizontally)
                (split-window-vertically))
              (switch-to-buffer TeX-error-overview-buffer-name))))
      (message "No more errors.")
      (beep))))