From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33870: 27.0.50; xref-goto-xref not configurable Date: Thu, 03 Jan 2019 23:29:18 +0200 Organization: LINKOV.NET Message-ID: <878t011lch.fsf@mail.linkov.net> References: <87a7ktqqx7.fsf@mail.linkov.net> <9215183d-0a44-88b5-5b3c-d0da31f749ad@yandex.ru> <878t02egph.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1546551492 13214 195.159.176.226 (3 Jan 2019 21:38:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 Jan 2019 21:38:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33870@debbugs.gnu.org, Dmitry Gutov To: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 03 22:38:08 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from listsout.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfAgo-0003G8-Fb for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Jan 2019 22:38:06 +0100 Original-Received: from localhost ([127.0.0.1]:58048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfAiv-0008IY-FP for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Jan 2019 16:40:17 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfAin-0008I9-0m for bug-gnu-emacs@gnu.org; Thu, 03 Jan 2019 16:40:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfAig-0007s5-NR for bug-gnu-emacs@gnu.org; Thu, 03 Jan 2019 16:40:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfAig-0007ry-Hc for bug-gnu-emacs@gnu.org; Thu, 03 Jan 2019 16:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gfAig-00013S-8u for bug-gnu-emacs@gnu.org; Thu, 03 Jan 2019 16:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Jan 2019 21:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33870 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33870-submit@debbugs.gnu.org id=B33870.15465515423981 (code B ref 33870); Thu, 03 Jan 2019 21:40:02 +0000 Original-Received: (at 33870) by debbugs.gnu.org; 3 Jan 2019 21:39:02 +0000 Original-Received: from localhost ([127.0.0.1]:46028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfAhi-00011z-1t for submit@debbugs.gnu.org; Thu, 03 Jan 2019 16:39:02 -0500 Original-Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:4160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfAhf-00011g-Nm for 33870@debbugs.gnu.org; Thu, 03 Jan 2019 16:39:01 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EB5D912489A; Thu, 3 Jan 2019 21:38:57 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (unknown [100.96.33.121]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9C359124449; Thu, 3 Jan 2019 21:38:57 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 03 Jan 2019 21:38:57 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Descriptive-Desert: 342bdff12b1573bb_1546551537773_3849056338 X-MC-Loop-Signature: 1546551537773:403679471 X-MC-Ingress-Time: 1546551537773 Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id 5A8C2811B8; Thu, 3 Jan 2019 13:38:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=V8XcrQ DKUvhlb6XOIOsV1Z3k5f4=; b=fDN9vwzNxHcX4UA5nJHDPOhiDWcSnCMNmWQ4GH eQ8NRgCbfxsKyKn47egVB+0hX0aal57MRKRua0Let94GliM+DuR4X0atqV7qn9x7 0OvPa7wDt0SgMyRk4yhJKji6XR/vb5IFXWnlXJ25jzovG0oTTX7evs0yCGaPFzPu 1phHc= Original-Received: from mail.jurta.org (m91-129-109-141.cust.tele2.ee [91.129.109.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTPSA id 7E3897F5CC; Thu, 3 Jan 2019 13:38:54 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a35 In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Thu, 03 Jan 2019 14:24:15 +0000") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrudelgdelfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrddugedunecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrudeguddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehjohgrohhtrghvohhrrgesghhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154111 Archived-At: >> 1. simplifies =E2=80=98xref--show-pos-in-buf=E2=80=99 > > ... and considerably complexifies xref--show-xref-buffer (more on that > later) > >> while at the same time preserves the current behavior and respects >> user's customization of display actions; > > That's great! I realized now that it can be simplified more by replacing (with-selected-window (display-buffer buf action) with just (pop-to-buffer buf action) but I'm not sure about this change because it could change the current be= havior. >> 2. makes the xref buffer non-obtrusive like *Completions* >> in xref--show-xref-buffer; > > After a brief look, I'm not sure I like the UI change. "not sure" is > not an euphemism for "don't like", I'm ust not sold on the idea yet: > > * Certainly you don't mean non-obtrusive, you mean "less obtrusive" and > really it's "slightly less obtrusive". It does use potentially less > space and doesn't temporarily use one of your windows if you happen t= o > have several. I agree this is an good advantage. > > * But by using less space it is also less useful. You don't get to see= , > at a glance, a great deal of xrefs. And xrefs are different from > completions, they're closer to grep hits. You wouldn't put *grep* > hits in such a potentially tiny window, would you? > > Then again, perhaps you would, and the whole point of this patch is to > make the UI configurable. If so, I'd make the original UI the default, > or at least very very easy to bring back. I see what you mean. For a command like project-find-regexp I'd like the original UI as well, because most of the time there are many hits displayed in the xref window. But when xref-find-definitions pops up the xref window, usually it contains just 2 lines taking half of the scre= en where most space is uselessly empty. So it seems that project-find-regexp and most other xref-related commands are more like grep while xref-find-definitions is more like completions with a small number of lines. What do you think about allowing only xref-find-definitions to display a narrow xref window below the original window? >> - (display-buffer buf action)) >> + `(,(lambda (buf alist) >> + (window--display-buffer buf xref--original-wind= ow 'reuse alist))))))) >> > > Using internal "--" symbols from window.el is a temporary solution I > hope. Actually this function is not quite internal. It's intended to be used in display actions implemented by packages. >> - (pop-to-buffer (current-buffer)) >> + (pop-to-buffer >> + (current-buffer) >> + `((display-buffer--maybe-same-window >> + display-buffer-reuse-window >> + display-buffer--maybe-pop-up-frame >> + display-buffer-below-selected) >> + ,(if temp-buffer-resize-mode >> + '(window-height . resize-temp-buffer-window) >> + '(window-height . fit-window-to-buffer)) >> + ,(when temp-buffer-resize-mode >> + '(preserve-size . (nil . t))))) > > > Again, too many --, and seems like a lot of repetition from window.el. The distinction between internal and public window functions is quite fuz= zy. > Perhaps you want window.el to export a function that encapsulates > all/some of this cruft to pass as ACTION. Yes, creating a composite display action would be a good thing to do. > Naming that function would be the hardest problem (best I could do is > display-buffer-use-completions-like-window). Or when naming by not its usage but what it does: display-buffer-below-an= d-resize. > Or maybe put that function in xref.el. But as I said above, I think we > also need a function that brings back the current default. I propose to use the new function only for xref-find-definitions.