xref: Use other-window-scroll-buffer and user-error

* lisp/progmodes/xref.el (xref--display-position):
Set `other-window-scroll-buffer'.
(xref-goto-xref): Use `user-error'.
This commit is contained in:
Dmitry Gutov 2015-01-19 05:29:37 +02:00
parent 36bfd6947f
commit 9592a014df
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2015-01-19 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/xref.el (xref--display-position):
Set `other-window-scroll-buffer'.
(xref-goto-xref): Use `user-error'.
2015-01-19 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/xref.el (xref--display-history): New variable.

View file

@ -352,6 +352,7 @@ WINDOW controls how the buffer is displayed:
(let ((buf (current-buffer))
(win (selected-window)))
(with-current-buffer xref-buf
(setq-local other-window-scroll-buffer buf)
(xref--save-to-history buf win)))))
(defun xref--show-location (location)
@ -390,7 +391,7 @@ WINDOW controls how the buffer is displayed:
(interactive)
(back-to-indentation)
(let ((loc (or (xref--location-at-point)
(error "No reference at point")))
(user-error "No reference at point")))
(window xref--window))
(xref--quit)
(xref--pop-to-location loc window)))