From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH 3/3] emacs: Add "Source" field to 'guix-info' buffers. Date: Sun, 09 Nov 2014 21:48:30 +0300 Message-ID: <878ujkb475.fsf@gmail.com> References: <87egtcbwd0.fsf@gmail.com> <87lhnktgh7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnXXV-0005Y5-Ju for guix-devel@gnu.org; Sun, 09 Nov 2014 13:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnXXM-00006a-Gz for guix-devel@gnu.org; Sun, 09 Nov 2014 13:48:41 -0500 In-Reply-To: <87lhnktgh7.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 09 Nov 2014 18:45:56 +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.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s (2014-11-09 20:45 +0300) wrote: > Alex Kost skribis: > >> This patch adds URL of a package source and 2 buttons ("Show" and >> "Download") to an =E2=80=98info=E2=80=99 buffer (see the attached screen= shot). >> >> Pushing the "Show" button displays a store path of the package source. >> Pushing the "Download" button has the same meaning as =E2=80=9Cguix buil= d -S =E2=80=A6=E2=80=9D. > > This is very cool! > > I had in mind a slightly simpler user interface: just a =E2=80=9CView sou= rce=E2=80=9D > button. The thing would build (package-source-derivation p), > effectively downloading it if it=E2=80=99s not already present, and openi= ng it > in dired. I don't think opening in dired should be a default (although I made =E2=80=98guix-package-info-find-source-p=E2=80=99 variable +for you+ for th= is case) because there may be a big compressed tarball that a user wouldn't like to uncompress with emacs tar-mode. I think displaying a link is the preferable variant as a user can open the file or copy its path if he wants. Also you suggest to make =E2=80=9CView source=E2=80=9D synchronous: build a= source derivation, download it and open in dired. Did I understand it right? As this process may take a long time (for big sources or for git checkouts if a user doesn't have a necessary git infrastructure), I think it should be evaluated asynchronously in a REPL and it's not possible (at least not easy) to define what value was returned by a REPL command, so no way to define what file to open in dired. Also what if I want to define whether there is a source in the store or not? (And I don't want to download it if it's not there.) With your variant of a single =E2=80=9CView source=E2=80=9D button it would not be po= ssible, as the source that doesn't exist in the store will be downloaded unconditionally. > With the interface you propose, things might be slightly confusing: > sometimes clicking on =E2=80=9CDownload=E2=80=9D will do nothing (because= the source is > already there), sometime =E2=80=9CShow=E2=80=9D will work without =E2=80= =9CDownload=E2=80=9D, sometimes > not, etc. Also it takes up quite a bit of space. Sorry, I didn't get it. What space do you mean? > WDYT? Pushing a =E2=80=9CDownload=E2=80=9D button will always do something: it wi= ll run some command in a REPL and will always display a store path in the end. And =C2=ABHey, USER, what did you expect from a =E2=80=9CDownload=E2=80=9D butt= on if the source is already downloaded?=C2=BB But if you find it confusing what about the following variant: initially there will be only =E2=80=9CShow=E2=80=9D button and when you press it, =E2= =80=9CDownload=E2=80=9D button appears only if the source does not exist in the store. After a successful downloading, it disappears again. --=20 Alex