[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/xref f82a6f2 3/5: xref--next-line: Try to preserve
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] scratch/xref f82a6f2 3/5: xref--next-line: Try to preserve the window configuration |
Date: |
Fri, 19 Dec 2014 07:47:06 +0000 |
branch: scratch/xref
commit f82a6f2639469807d3d3f51fdb72c9ab483051f8
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
xref--next-line: Try to preserve the window configuration
Could be controversial, but I like being able to look at the options,
maybe browse through some of them, and then press `q' to return to the
original window configuration.
`sit-for' could be interrupted for a process output, though. Maybe
using pre-command-hook would be better.
---
lisp/progmodes/xref.el | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 399f15a..c759d52 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -304,7 +304,9 @@ WINDOW controls how the buffer is displayed:
(defun xref--next-line (backward)
(let ((loc (xref--search-property 'xref-location backward)))
(when loc
- (xref--show-location loc))))
+ (save-window-excursion
+ (xref--show-location loc)
+ (sit-for most-positive-fixnum)))))
(defun xref-next-line ()
"Move to the next xref and display its source in the other window."