GNU bug report logs -
#33992
27.0.50; xref-find-definitions wastes too much space
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sat, 5 Jan 2019 23:51:01 UTC
Severity: wishlist
Tags: patch
Found in version 27.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tags: patch
Severity: wishlist
X-Debbugs-CC: João Távora <joaotavora <at> gmail.com>, Dmitry Gutov <dgutov <at> yandex.ru>
As noted in bug#33870 the buffer produced by xref-find-definitions
(bound to ‘M-.’) has a transient nature like the *Completions* buffer.
Therefore it makes sense not to waste its space needlessly:
[display-action-alist.patch (text/x-diff, inline)]
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 87ce2299c5..169f49a348 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -782,7 +773,7 @@ xref--show-xref-buffer
(erase-buffer)
(xref--insert-xrefs xref-alist)
(xref--xref-buffer-mode)
- (pop-to-buffer (current-buffer))
+ (pop-to-buffer (current-buffer) (assoc-default 'display-action-alist alist))
(goto-char (point-min))
(setq xref--original-window (assoc-default 'window alist)
xref--original-window-intent (assoc-default 'display-action alist))
@@ -808,12 +799,15 @@ xref--show-xrefs
(cond
((and (not (cdr xrefs)) (not always-show-list))
(xref-push-marker-stack)
- (xref--pop-to-location (car xrefs) display-action))
+ (xref--pop-to-location (car xrefs) (unless (listp display-action) display-action)))
(t
(xref-push-marker-stack)
(funcall xref-show-xrefs-function xrefs
`((window . ,(selected-window))
- (display-action . ,display-action))))))
+ (display-action
+ . ,(unless (listp display-action) display-action))
+ (display-action-alist
+ . ,(when (listp display-action) display-action)))))))
(defun xref--prompt-p (command)
(or (eq xref-prompt-for-identifier t)
@@ -864,7 +858,7 @@ xref-find-definitions
Otherwise, display the list of the possible definitions in a
buffer where the user can select from the list."
(interactive (list (xref--read-identifier "Find definitions of: ")))
- (xref--find-definitions identifier nil))
+ (xref--find-definitions identifier '((display-buffer-maybe-below-selected))))
;;;###autoload
(defun xref-find-definitions-other-window (identifier)
This bug report was last modified 5 years and 347 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.