unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33992: 27.0.50; xref-find-definitions wastes too much space
@ 2019-01-05 23:43 Juri Linkov
  2019-01-06 11:03 ` João Távora
  0 siblings, 1 reply; 16+ messages in thread
From: Juri Linkov @ 2019-01-05 23:43 UTC (permalink / raw)
  To: 33992; +Cc: joão távora, dmitry gutov

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

Tags: patch
Severity: wishlist
X-Debbugs-CC: João Távora <joaotavora@gmail.com>, Dmitry Gutov <dgutov@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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: display-action-alist.patch --]
[-- Type: text/x-diff, Size: 1778 bytes --]

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)

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-06-10  0:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-05 23:43 bug#33992: 27.0.50; xref-find-definitions wastes too much space Juri Linkov
2019-01-06 11:03 ` João Távora
2019-03-20 21:37   ` Juri Linkov
2019-03-20 23:23     ` João Távora
2019-04-04  0:02     ` Dmitry Gutov
2019-04-04 20:49       ` Juri Linkov
2019-04-04 23:06         ` Dmitry Gutov
2019-04-05  9:44           ` Felician Nemeth
2019-04-05 23:20             ` Dmitry Gutov
2019-04-06 21:08             ` Juri Linkov
2019-04-06 21:03           ` Juri Linkov
2019-05-02 23:05             ` Dmitry Gutov
2019-05-15 20:57               ` Juri Linkov
2019-05-15 22:37                 ` Dmitry Gutov
2019-05-28 20:35                   ` Juri Linkov
2019-06-10  0:35                     ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).