[Emacs] Override xref function AFTER xref loaded

This commit is contained in:
Ivan Malison 2016-11-07 22:50:16 -08:00
parent d5e7f3d8ef
commit 3221c24383
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -1140,19 +1140,21 @@ programming mode.
#+END_SRC #+END_SRC
*** Handle xrefs annoying dedicated window garbage *** Handle xrefs annoying dedicated window garbage
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun xref--show-pos-in-buf (pos buf select) (use-package xref
(let ((xref-buf (current-buffer)) :config
win) (defun xref--show-pos-in-buf (pos buf select)
(with-selected-window (let ((xref-buf (current-buffer))
(display-buffer buf) win)
(xref--goto-char pos) (with-selected-window
(run-hooks 'xref-after-jump-hook) (display-buffer buf)
(let ((buf (current-buffer))) (xref--goto-char pos)
(setq win (selected-window)) (run-hooks 'xref-after-jump-hook)
(with-current-buffer xref-buf (let ((buf (current-buffer)))
(setq-local other-window-scroll-buffer buf)))) (setq win (selected-window))
(when select (with-current-buffer xref-buf
(select-window win)))) (setq-local other-window-scroll-buffer buf))))
(when select
(select-window win)))))
#+END_SRC #+END_SRC
*** display-buffer-alist *** display-buffer-alist
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp