[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master d39f33c 2/2: ; Fix xref--show-location, after regre
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master d39f33c 2/2: ; Fix xref--show-location, after regression in ee50e62 |
Date: |
Mon, 10 Aug 2015 01:30:54 +0000 |
branch: master
commit d39f33cf37b8c352e3ca6839eb2b8e01cb8103a8
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
; Fix xref--show-location, after regression in ee50e62
---
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 4189977..68f6cff 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -430,16 +430,17 @@ Used for temporary buffers.")
(when (and restore (not (eq (car restore) 'same)))
(push (cons buf win) xref--display-history))))
-(defun xref--display-position (pos other-window xref-buf)
+(defun xref--display-position (pos other-window buf)
;; Show the location, but don't hijack focus.
- (with-selected-window (display-buffer (current-buffer) other-window)
- (xref--goto-char pos)
- (run-hooks 'xref-after-jump-hook)
- (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)))))
+ (let ((xref-buf (current-buffer)))
+ (with-selected-window (display-buffer buf other-window)
+ (xref--goto-char pos)
+ (run-hooks 'xref-after-jump-hook)
+ (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)
(condition-case err
@@ -450,8 +451,8 @@ Used for temporary buffers.")
(unless (memq buf bl)
;; Newly created.
(add-hook 'buffer-list-update-hook #'xref--mark-selected nil t)
- (push buf xref--temporary-buffers)))
- (xref--display-position (point) t (current-buffer)))
+ (push buf xref--temporary-buffers))
+ (xref--display-position marker t buf)))
(user-error (message (error-message-string err)))))
(defun xref-show-location-at-point ()