From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCHES] Add (guix build emacs-utils) and some Emacs packages Date: Wed, 13 Aug 2014 17:52:42 +0200 Message-ID: <877g2c8jzp.fsf@gnu.org> References: <87y4utm4ju.fsf@netris.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]:35509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHar3-0003Rd-N0 for guix-devel@gnu.org; Wed, 13 Aug 2014 11:52:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHaqy-0007OO-RF for guix-devel@gnu.org; Wed, 13 Aug 2014 11:52:49 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:32982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHaqy-0007OJ-KI for guix-devel@gnu.org; Wed, 13 Aug 2014 11:52:44 -0400 In-Reply-To: <87y4utm4ju.fsf@netris.org> (mhw@netris.org's message of "Tue, 12 Aug 2014 23:50:13 -0400") 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: mhw@netris.org Cc: guix-devel@gnu.org mhw@netris.org skribis: > I've attached patches to add new packages for 'magit', 'paredit', > 'emacs-w3m', and 'emacs-wget'. While working on these packages, I found > that I needed a way to substitute multi-line s-expressions in the elisp > code, in order to replace initializers for variables. This looks very cool. I had started looking at EMMS and substitute-sexps and substitute-vars will be very helpful in such cases. > The approach I took was to create a new module (guix build emacs-utils) > containing utilities that use Emacs itself to perform the substitutions. > > What do you think? I think it=E2=80=99s great! Comments below: > +(define %emacs > + ;; The `emacs' command. > + (make-parameter "emacs")) It should be exported. > +(define-syntax emacs-substitute-vars Perhaps =E2=80=98emacs-substitute-variables=E2=80=99? (I try to avoid abbr= eviations in public names.) > + (let* ((emacs (string-append (assoc-ref %build-inputs "emacs") > + "/bin/emacs")) > + (source (assoc-ref %build-inputs "source")) > + (lisp-dir (string-append %output > + "/share/emacs/site-lisp")) > + (target (string-append lisp-dir "/paredit.el"))) I find it nicer when the RHSs of =E2=80=98let=E2=80=99 are aligned. > + (unless (zero? (system* > + emacs "--quick" "--batch" > + (format #f "--eval=3D~S" > + '(byte-compile-file "paredit.el")))) > + (error "failed to compile paredit.el!"))))))) Perhaps this calls for an =E2=80=98emacs-batch-eval=E2=80=99 procedure? > + (source (origin > + (method url-fetch) > + (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3m= -el_" > + version ".orig.tar.gz")) What about using http://emacs-w3m.namazu.org/emacs-w3m-1.4.4.tar.gz ? > + (synopsis "A simple web browser for emacs, based on w3m.") Just =E2=80=9CSimple Web browser for Emacs based on w3m=E2=80=9D, with no p= eriod. > + (synopsis "A simple file downloader for emacs, based on wget.") Likewise. Feel free to push with these changes. Thanks for all of this! Ludo=E2=80=99.