From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [ANN] Emacs-Guix 0.3.4 Date: Sat, 30 Dec 2017 23:51:59 +0300 Message-ID: <87o9mgos5s.fsf@gmail.com> References: <878tdm38qu.fsf@gmail.com> <87bmihtono.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVO6q-0003fl-64 for help-guix@gnu.org; Sat, 30 Dec 2017 15:52:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVO6n-0006Dd-5H for help-guix@gnu.org; Sat, 30 Dec 2017 15:52:00 -0500 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:43507) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eVO6m-0006Be-TP for help-guix@gnu.org; Sat, 30 Dec 2017 15:51:57 -0500 Received: by mail-lf0-x22d.google.com with SMTP id o26so36725916lfc.10 for ; Sat, 30 Dec 2017 12:51:56 -0800 (PST) In-Reply-To: <87bmihtono.fsf@gmail.com> (Oleg Pykhalov's message of "Fri, 29 Dec 2017 20:44:11 +0300") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Oleg Pykhalov Cc: help-guix@gnu.org Oleg Pykhalov (2017-12-29 20:44 +0300) wrote: > Hello Alex, Guix > > Alex Kost writes: > >> Hello, Emacs-Guix (Emacs interface for GNU Guix) version 0.3.4 has been >> released. It may be installed with "guix package -i emacs-guix". >> >> The main new features are: > > By the way, 'guix-edit' supports a new behavior: > > Read symbol at point and if it is a package name, return it. If it > is not a package name or if current command has a prefix argument, > read the name from minibuffer. > > (from 'guix-read-package-name-at-point' documentation string). Oh, right, I forgot about it, sorry :-) (this feature is also the Oleg's idea) >> 1. "M-x guix-hash": it prompts for a file, calculates its hash and puts >> it into kill-ring (i.e., you can insert it with "C-y"). If it is >> called on a directory, it ignores VCS files (like "guix hash >> --recursive --exclude-vcs"). Also it supports dired-mode. Thanks to >> ng0 for the idea of this command! > > I like this, but as I undertand it works only with files or directories > locally. Yes, it is the analog of "guix hash", so it works with local files only. > Could we do something like: > > (defun guix-download (url) > (interactive "sDownload URL: ") > (insert (shell-command-to-string (concat "guix download " > url > " 2>/dev/null" > "| tail -n 1" > "| tr -d '\n'")))) > > which will download a thing and paste a hash at the cursor position. I wouldn't like to have such a wrapper for a shell command as using "Guix REPL" would be faster. Although the main problem is: what you suggest is a *synchronous* command, and downloading files may take a long time, so Emacs will become unresponsive until the file will be downloaded and its hash will be calculated. > We have a 'guix-devel-download-package-source', but it basically the > same as a shell command 'guix download PACKAGE' which requires to copy > hash manually. What we probably want is to get a hash into Emacs > kill-ring as guix-hash does. I don't see how this can be done. Is it OK for you that this downloading will happen synchronously? Or do you have ideas how it can be implemented otherwise? -- Alex