diff options
| author | Dmitry Gutov | 2015-08-10 04:30:33 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2015-08-10 04:30:33 +0300 |
| commit | d39f33cf37b8c352e3ca6839eb2b8e01cb8103a8 (patch) | |
| tree | d3ce6b302622b67ad52fdab0168e1b3ce1a203b6 | |
| parent | 6f9b233448448adaf894b1586d4508c3d8573aba (diff) | |
| download | emacs-d39f33cf37b8c352e3ca6839eb2b8e01cb8103a8.tar.gz emacs-d39f33cf37b8c352e3ca6839eb2b8e01cb8103a8.zip | |
; Fix xref--show-location, after regression in ee50e62
| -rw-r--r-- | lisp/progmodes/xref.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 418997796d6..68f6cfffd2a 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -430,16 +430,17 @@ Used for temporary buffers.") | |||
| 430 | (when (and restore (not (eq (car restore) 'same))) | 430 | (when (and restore (not (eq (car restore) 'same))) |
| 431 | (push (cons buf win) xref--display-history)))) | 431 | (push (cons buf win) xref--display-history)))) |
| 432 | 432 | ||
| 433 | (defun xref--display-position (pos other-window xref-buf) | 433 | (defun xref--display-position (pos other-window buf) |
| 434 | ;; Show the location, but don't hijack focus. | 434 | ;; Show the location, but don't hijack focus. |
| 435 | (with-selected-window (display-buffer (current-buffer) other-window) | 435 | (let ((xref-buf (current-buffer))) |
| 436 | (xref--goto-char pos) | 436 | (with-selected-window (display-buffer buf other-window) |
| 437 | (run-hooks 'xref-after-jump-hook) | 437 | (xref--goto-char pos) |
| 438 | (let ((buf (current-buffer)) | 438 | (run-hooks 'xref-after-jump-hook) |
| 439 | (win (selected-window))) | 439 | (let ((buf (current-buffer)) |
| 440 | (with-current-buffer xref-buf | 440 | (win (selected-window))) |
| 441 | (setq-local other-window-scroll-buffer buf) | 441 | (with-current-buffer xref-buf |
| 442 | (xref--save-to-history buf win))))) | 442 | (setq-local other-window-scroll-buffer buf) |
| 443 | (xref--save-to-history buf win)))))) | ||
| 443 | 444 | ||
| 444 | (defun xref--show-location (location) | 445 | (defun xref--show-location (location) |
| 445 | (condition-case err | 446 | (condition-case err |
| @@ -450,8 +451,8 @@ Used for temporary buffers.") | |||
| 450 | (unless (memq buf bl) | 451 | (unless (memq buf bl) |
| 451 | ;; Newly created. | 452 | ;; Newly created. |
| 452 | (add-hook 'buffer-list-update-hook #'xref--mark-selected nil t) | 453 | (add-hook 'buffer-list-update-hook #'xref--mark-selected nil t) |
| 453 | (push buf xref--temporary-buffers))) | 454 | (push buf xref--temporary-buffers)) |
| 454 | (xref--display-position (point) t (current-buffer))) | 455 | (xref--display-position marker t buf))) |
| 455 | (user-error (message (error-message-string err))))) | 456 | (user-error (message (error-message-string err))))) |
| 456 | 457 | ||
| 457 | (defun xref-show-location-at-point () | 458 | (defun xref-show-location-at-point () |