From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Guix search, colors and INSIDE_EMACS Date: Mon, 24 Feb 2020 21:54:04 +0100 Message-ID: <874kvfg103.fsf@gnu.org> References: <87blqeml4w.fsf@ambrevar.xyz> <87tv46qqlf.fsf@elephly.net> <87d0aul354.fsf@ambrevar.xyz> <87pneuqhyo.fsf@elephly.net> <871rr8hwmv.fsf@ambrevar.xyz> <877e0pvdrs.fsf@ambrevar.xyz> <871rqxvdkd.fsf@ambrevar.xyz> <87d0adtzwg.fsf@ambrevar.xyz> <871rqkj6pw.fsf@gnu.org> <875zfwc4up.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:49762) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Kk1-0003Ym-1o for guix-devel@gnu.org; Mon, 24 Feb 2020 15:54:14 -0500 In-Reply-To: <875zfwc4up.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Mon, 24 Feb 2020 17:44:30 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Pierre Neidhardt Cc: Guix Devel Hi Pierre, I=E2=80=99m happy to discuss it further (to some extent at least, because t= here are other patches waiting for us to be reviewed :-)), but first, as I wrote in another message, I think the topic was not consensual and thus the series wasn=E2=80=99t ready to be pushed. Pierre Neidhardt skribis: > Ludovic Court=C3=A8s writes: > >>> - Leave colors when INSIDE_EMACS is set. >> >> Like Ricardo wrote before, this is not desirable for shell-mode. Also, >> all or most GNU command-line tools behave that way. > > There might be a misunderstanding because M-x shell supports ANSI > terminal colors explicitly. Why disable them then? > > Many command line tools print colors properly in M-x shell. I think > it's a misfeature to disable them in Emacs; I don't see any benefits. I understand the Eshell use case. The shell-mode use case is one I=E2=80= =99m interested in keeping as-is, that is: disable colors when INSIDE_EMACS, just like Coreutils, GNU grep, etc. do. >>> - Disable pager hint and display all search results when INSIDE_EMACS i= s set. >> >> I have a preference for something that doesn=E2=80=99t fill the screen, >> especially since the last answers (those that remain visible without >> scrolling) are the least relevant. Emacs makes it easier to scroll up >> and search, but still. >> >> Thoughts? > > I find that printing just 1 result to be of little use in general. > So between printing all results and just 1, I have a preference for > printing all results. But there are other solutions, see below. It=E2=80=99s not printing one result; it=E2=80=99s printing as many results= as can fit on the screen. > Note that `less` does not work well neither in Eshell nor in M-x shell. > Which is what started this discussion ;) > > Another option for M-x shell is to do > > guix search foo | cat > > which gives us the same result as the patch I've sent, with more typing :( > > Eshell has a "smart-scrolling" mode (the point stays at the first prompt > until validated). > > For M-x shell, going to the first result is just one keypress away. I understand all this. However, we=E2=80=99re not optimizing just for Eshe= ll and shell-mode; in fact, I=E2=80=99d argue that Emacs users should just use Emacs-Guix (we need to add M-x guix-search, actually!). For regular terminals, I think the two options that work well are: 1. Print (by default) as much as fits on the screen. 2. Automatically start a pager. I went with option #1, which was submitted at . The suggestion actually came from Bruno Haible: . Just to say that there=E2=80=99s already been some thought put into it, and= we have to carry the baggage of these past discussions now! > Another option would be to reverse the order of the result: print the > most relevant result last, so that neither Eshell nor M-x shell have to > scroll back. I think UIs generally print the most relevant result first. It wouldn=E2= =80=99t feel right to me to reverse it. Thanks! Ludo=E2=80=99.