Function: xref--show-location

xref--show-location is a byte-compiled function defined in xref.el.gz.

Signature

(xref--show-location LOCATION &optional SELECT)

Documentation

Help xref-show-xref and xref-goto-xref do their job.

Go to LOCATION and if SELECT is non-nil select its window. If SELECT is quit, also quit the *xref* window.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/xref.el.gz
(defun xref--show-location (location &optional select)
  "Help `xref-show-xref' and `xref-goto-xref' do their job.
Go to LOCATION and if SELECT is non-nil select its window.
If SELECT is `quit', also quit the *xref* window."
  (condition-case err
      (let* ((marker (xref-location-marker location))
             (buf (marker-buffer marker))
             (xref-buffer (current-buffer)))
        (cond (select
               (if (eq select 'quit) (quit-window nil nil))
               (let* ((old-frame (selected-frame))
                      (window (with-current-buffer xref-buffer
                                (xref--show-pos-in-buf marker buf)))
                      (frame (window-frame window)))
                 ;; If we chose another frame, make sure it gets input
                 ;; focus.
                 (unless (eq frame old-frame)
                   (select-frame-set-input-focus frame))
                 (select-window window)))
              (t
               (save-selected-window
                 (xref--with-dedicated-window
                  (xref--show-pos-in-buf marker buf))))))
    (user-error (message (error-message-string err)))))