unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 33992@debbugs.gnu.org
Cc: "joão távora" <joaotavora@gmail.com>, "dmitry gutov" <dgutov@yandex.ru>
Subject: bug#33992: 27.0.50; xref-find-definitions wastes too much space
Date: Sun, 06 Jan 2019 01:43:35 +0200	[thread overview]
Message-ID: <87muoe7jrs.fsf@mail.linkov.net> (raw)

[-- 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)

             reply	other threads:[~2019-01-05 23:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-05 23:43 Juri Linkov [this message]
2019-01-06 11:03 ` bug#33992: 27.0.50; xref-find-definitions wastes too much space 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87muoe7jrs.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=33992@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).