unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Alex Kost <alezost@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 3/3] emacs: Add "Source" field to 'guix-info' buffers.
Date: Tue, 11 Nov 2014 20:57:34 +0100	[thread overview]
Message-ID: <87bnodh5n5.fsf@gnu.org> (raw)
In-Reply-To: <877fz14kjx.fsf@gmail.com> (Alex Kost's message of "Tue, 11 Nov 2014 22:13:54 +0300")

Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2014-11-11 02:29 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> skribis:
>>
>>> Ludovic Courtès (2014-11-10 01:43 +0300) wrote:
>
> [...]
>
>>>>>> With the interface you propose, things might be slightly confusing:
>>>>>> sometimes clicking on “Download” will do nothing (because the source is
>>>>>> already there), sometime “Show” will work without “Download”, sometimes
>>>>>> not, etc.  Also it takes up quite a bit of space.
>>>>>
>>>>> Sorry, I didn't get it.  What space do you mean?
>>>>
>>>> I meant visual space in the user interface; visual clutter.
>>>
>>> Is that "too much information is bad"?  Do you suggest to remove
>>> something?
>>
>> I think a single button is clearer than two buttons plus a label, but
>> that’s OK here since we can’t really do just one button.
>
> What can be done is: if a source is not in the store after pressing a
> “Show” button, a user may be asked whether he wants to download it or
> not.  I think it should be less confusing (the modified patch is
> attached).  WDYT?

Yep, sounds good!

>> There’s still the possibility that (1) the source is there, so no
>> “Download” button, (2) the source is GC’d, and (3) there’s still no
>> “Download” button and trying to access the source fails gracelessly.
>>
>> That’s probably not very common in practice, and easily fixed by hitting
>> ‘g’, so maybe it’s not worth worrying.  WDYT?
>
> Do you mean a user deleted the source (with "guix gc") when a “package
> info” buffer was displayed?  Sure such cases are not (and I think cannot
> be) handled.  It's the same as if:
>
> 1) a user has a list of installed packages,
>
> 2) installs another package somewhere outside (e.g., in a shell with
> "guix package -i"),
>
> 3) and wonders why the list is not up-to-date.
>
> Of course it is not up-to-date!  He needs to revert a buffer after that.

It’s not really comparable, because GC is always something that can
happen concurrently (one may choose to run it from cron, for instance.)
But let’s ignore this possibility for the present case.  :-)

>>> +(define (package-source-names package)
>>> +  "Return a list of source names (URLs) of the PACKAGE."
>>> +  (let ((source (package-source package)))
>>> +    (and (origin? source)
>>> +         (filter-map (lambda (uri)
>>> +                       (cond ((string? uri)
>>> +                              uri)
>>> +                             ((git-reference? uri)
>>> +                              (git-reference-url uri))
>>> +                             (else #f)))
>>> +                     (list-maybe (origin-uri source))))))
>>
>> The #f case above just leads to degraded display, not breakage, right?
>> (I’m asking because of the other things beyond string? and
>> git-reference?.)
>
> Yes, there _would_ be just "Source: –", but it will not happen because
> there are no other things beyond a string URL and a git-reference URL.

There’s also ‘svn-reference’ (not currently used), and possibly other
things.

The point is that this part will have to be updated anytime new origin
methods are added.

> From 733c5276bcb9ded008e9c0a4dbe2e5fb6561b5eb Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Sun, 9 Nov 2014 11:03:39 +0300
> Subject: [PATCH] emacs: Add "Source" field to 'guix-info' buffers.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Suggested by Ludovic Courtès.
>
> * emacs/guix-info.el (guix-info-insert-methods, guix-info-displayed-params):
>   Add 'source' parameter.
>   (guix-package-info-source): New face.
>   (guix-package-source): New button type.
>   (guix-package-info-auto-find-source, guix-package-info-auto-download-source,
>   guix-package-info-download-buffer): New variables.
>   (guix-package-info-show-source, guix-package-info-insert-source-url,
>   guix-package-info-insert-source, guix-package-info-download-source,
>   guix-package-info-redisplay-after-download): New procedures.
> * emacs/guix-base.el (guix-param-titles): Add 'source' parameter.
>   (guix-operation-prompt): Add 'prompt' argument.
>   (guix-after-source-download-hook): New variable.
>   (guix-package-source-path, guix-package-source-build-derivation): New
>   procedures.
> * emacs/guix-main.scm (%package-param-alist): Add 'source' parameter.
>   (package-source-names, package-source-derivation->store-path,
>   package-source-path, package-source-build-derivation): New procedures.

I think we’re all set now, no?  :-)

Thanks,
Ludo’.

  reply	other threads:[~2014-11-11 19:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-09  8:40 [PATCH 3/3] emacs: Add "Source" field to 'guix-info' buffers Alex Kost
2014-11-09 17:45 ` Ludovic Courtès
2014-11-09 18:48   ` Alex Kost
2014-11-09 22:43     ` Ludovic Courtès
2014-11-10 13:18       ` Alex Kost
2014-11-10 23:29         ` Ludovic Courtès
2014-11-11 19:13           ` Alex Kost
2014-11-11 19:57             ` Ludovic Courtès [this message]
2014-11-12  6:56               ` Alex Kost
2014-11-12  9:55                 ` Ludovic Courtès

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87bnodh5n5.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    /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/guix.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).