From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Synacek Subject: Re: hint: Run `guix search ... | less' to view all the results Date: Mon, 27 Apr 2020 10:38:40 +0200 Message-ID: References: <20200427012635.GA4379@LionPure> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000007860f05a441a5eb" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:52004) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzIM-0006JM-L5 for guix-devel@gnu.org; Mon, 27 Apr 2020 04:39:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSzIA-0002XZ-8v for guix-devel@gnu.org; Mon, 27 Apr 2020 04:39:17 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:45160 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jSzI9-0002WT-NH for guix-devel@gnu.org; Mon, 27 Apr 2020 04:39:05 -0400 Received: by mail-lf1-f72.google.com with SMTP id b22so7188707lfa.18 for ; Mon, 27 Apr 2020 01:38:53 -0700 (PDT) In-Reply-To: <20200427012635.GA4379@LionPure> 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: Bengt Richter Cc: Guix Devel --00000000000007860f05a441a5eb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 27, 2020 at 4:02 AM Bengt Richter wrote: > Hi zimoun, Jan, > > On +2020-04-26 11:38:01 +0200, zimoun wrote: > > Dear, > > > > On Sun, 26 Apr 2020 at 10:35, Jan Synacek wrote: > > > > > Seriously? Are you seriously forcing your users to either run emacs > (or at least > > > to set the env variable) or use pipes to get the entire search result= ? > > > > It is "known" that Guix should respect the PAGER variable [1,2] and it > > is already a feature request [3]. > > > > [1] https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00039.html > > [2] https://lists.gnu.org/archive/html/help-guix/2020-02/msg00150.html > > [3] https://lists.gnu.org/archive/html/help-guix/2020-02/msg00154.html > > > > > > > That's just... backwards. Also, it feels like as if the author of tha= t > code sort > > > of assumed that whoever runs the command is stupid enough not to be > able to deal > > > with long output. I'm sure that it wasn't meant like that. > > > > The manual recommands to use "guix search" in combination with > > 'recsels' (see [4] '--search' paragraph). > > > > Therefore, the current philosophy of searching is: > > > > 1) guix search | recsel -P name,synopsis | grep > > > 2) guix show > > > > I agree we could discuss that... as it was started for example see > > this thread [5]. > > > > [4] https://guix.gnu.org/manual/devel/en/guix.html#Invoking-guix-packag= e > > [5] https://lists.gnu.org/archive/html/guix-devel/2019-12/msg00141.html > > > > > > > Pretty please, fix this. Don't force your users into usage patterns > that might > > > be completely foreign to them. Don't truncate output from programs by > default. > > > > I had been assuming it had just been allowed to scroll off > screen due to unimpeded output, as IIUC Jan wants. Is it > actually truncated? > Yes, it is truncated in the sense of it doesn't show all the output, unless you use a pipe, redirect or set the env variable. If I run 'guix package -A', it outputs all the available packages without truncating anything and without giving me "helpful" hints. And that's currently 13201 lines on my system. That's how I expect commands to behave and that has been pretty much the normal thing to do since forever. I believe in KISS for primitives, and I think the less they > look at how they are being used the better for their design. > Otherwise the implementation is implicitly getting ad hoc > inputs from the environment, and incrementally it will grow > messy. > > At the higher level, I think systems can be too eager to > help, which can be really annoying to an advanced user, but > really helpful to a noob. > In this particular case, I consider myself as an advanced user and yes, it's annoying. As I have already mentioned, I don't consider guix to be aimed at "noobs". You would have to define what noob means here. If we consider a noob to be someone who doesn't know how to use pipes or redirections, then, as I have already mentioned, I don't believe it's the target audience of the guix project. At least not for now. Currently, it actually takes a pretty advanced linux user to use it. So maybe Jan could be satisfied by a preference setting > (USER_LEVEL expert) in that regard. Many apps have such > features, E.g. emacs will want to take you into a tutorial > until you tell it to stop pestering you. > This actually made me laugh, thanks for that! I'm not sure if it was meant to be a joke or not, but I take it as you meant it. What you actually suggest is: 1) I run 'guix package -s ...' which gives me the first few results and a "helpful" hint that I should use pipes or emacs to get all of it. 2) I get annoyed and happen to know about this USER_LEVEL configuration option that I can use. 3) I set USER_LEVEL=3Dexpert and get the output that= I should have gotten in the first place. If that's what you meant, then, please no, don't do that. While we're at it, let me also give my opinion about supporting PAGER. If it means that if PAGER is set, use it, otherwise don't page, then that's perfectly valid and, in my opinion, how PAGER support is supposed to work. If it means that *unless* something is set *not to use* a pager as some tools currently do (I can only think of some of the systemd tools off top of my head), use pager by default, then that's also backwards. But it's still much better than truncating output by default. Regards, --=20 Jan Synacek Software Engineer, Red Hat --00000000000007860f05a441a5eb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Apr 27, 2020 at 4:02 AM Bengt Richter <<= a href=3D"mailto:bokr@bokr.com">bokr@bokr.com> wrote:
Hi zimoun, Jan,

On +2020-04-26 11:38:01 +0200, zimoun wrote:
> Dear,
>
> On Sun, 26 Apr 2020 at 10:35, Jan Synacek <jsynacek@redhat.com> wrote:
>
> > Seriously? Are you seriously forcing your users to either run ema= cs (or at least
> > to set the env variable) or use pipes to get the entire search re= sult?
>
> It is "known" that Guix should respect the PAGER variable [1= ,2] and it
> is already a feature request [3].
>
> [1] https://lists.gnu.org/ar= chive/html/guix-devel/2020-02/msg00039.html
> [2] https://lists.gnu.org/arc= hive/html/help-guix/2020-02/msg00150.html
> [3] https://lists.gnu.org/arc= hive/html/help-guix/2020-02/msg00154.html
>
>
> > That's just... backwards. Also, it feels like as if the autho= r of that code sort
> > of assumed that whoever runs the command is stupid enough not to = be able to deal
> > with long output. I'm sure that it wasn't meant like that= .
>
> The manual recommands to use "guix search" in combination wi= th
> 'recsels' (see [4] '--search' paragraph).
>
> Therefore, the current philosophy of searching is:
>
>=C2=A0 =C2=A01) guix search <regexps> | recsel -P name,synopsis |= grep <other-regexps>
>=C2=A0 =C2=A02) guix show <your-interest>
>
> I agree we could discuss that... as it was started for example see
> this thread [5].
>
> [4] https://guix.gnu.org/ma= nual/devel/en/guix.html#Invoking-guix-package
> [5] https://lists.gnu.org/ar= chive/html/guix-devel/2019-12/msg00141.html
>
>
> > Pretty please, fix this. Don't force your users into usage pa= tterns that might
> > be completely foreign to them. Don't truncate output from pro= grams by default.
>

I had been assuming it had just been allowed to scroll off
screen due to unimpeded output, as IIUC Jan wants. Is it
actually truncated?

Yes, it is truncated in= the sense of it doesn't show all the output, unless you use a pipe, re= direct or set the env variable. If I run 'guix package -A', it outp= uts all the available packages without truncating anything and without givi= ng me "helpful" hints. And that's currently 13201 lines on my= system. That's how I expect commands to behave and that has been prett= y much the normal thing to do since forever.

=
I believe in KISS for primitives, and I think the less they
look at how they are being used the better for their design.
Otherwise the implementation is implicitly getting ad hoc
inputs from the environment, and incrementally it will grow
messy.

At the higher level, I think systems can be too eager to
help, which can be really annoying to an advanced user, but
really helpful to a noob.

In this particula= r case, I consider myself as an advanced user and yes, it's annoying.
=
As I have already mentioned, I don't consider guix to be aimed at= "noobs". You would have to define what noob means here. If we co= nsider a noob to be someone who doesn't know how to use pipes or redire= ctions, then, as I have already mentioned, I don't believe it's the= target audience of the guix project. At least not for now. Currently, it a= ctually takes a pretty advanced linux user to use it.

So maybe Jan could be satisfied by a preference setting
(USER_LEVEL expert) in that regard. Many apps have such
features, E.g. emacs will want to take you into a tutorial
until you tell it to stop pestering you.

Th= is actually made me laugh, thanks for that! I'm not sure if it was mean= t to be a joke or not, but I take it as you meant it. What you actually sug= gest is: 1) I run 'guix package -s ...' which gives me the first fe= w results and a "helpful" hint that I should use pipes or emacs t= o get all of it. 2) I get annoyed and happen to know about this USER_LEVEL = configuration option that I can use. 3) I set USER_LEVEL=3Dexpert and get t= he output that I should have gotten in the first place.
If that's what= you meant, then, please no, don't do that.
=C2=A0
While we're at it, let me also give my opinion about supporting PAGER= . If it means that if PAGER is set, use it, otherwise don't page, then = that's perfectly valid and, in my opinion, how PAGER support is suppose= d to work. If it means that *unless* something is set *not to use* a pager = as some tools currently do (I can only think of some of the systemd tools o= ff top of my head), use pager by default, then that's also backwards. B= ut it's still much better than truncating output by default.
<= /div>
Regards,
--
Jan Synacek
Software Engineer, Red Hat
--00000000000007860f05a441a5eb--