From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: [PATCHES] Add (guix build emacs-utils) and some Emacs packages Date: Wed, 13 Aug 2014 14:36:49 -0400 Message-ID: <87d2c4tewu.fsf@yeeloong.lan> References: <87y4utm4ju.fsf@netris.org> <877g2c8jzp.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]:49584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHdQq-0005pI-U0 for guix-devel@gnu.org; Wed, 13 Aug 2014 14:38:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHdQm-0003yI-0a for guix-devel@gnu.org; Wed, 13 Aug 2014 14:37:56 -0400 In-Reply-To: <877g2c8jzp.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 13 Aug 2014 17:52:42 +0200") 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 ludo@gnu.org (Ludovic Court=C3=A8s) writes: > 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. Indeed! >> +(define-syntax emacs-substitute-vars > > Perhaps =E2=80=98emacs-substitute-variables=E2=80=99? (I try to avoid ab= breviations in > public names.) Okay, sounds good. >> + (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. Agreed. >> + (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? Good idea. >> + (source (origin >> + (method url-fetch) >> + (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3= m-el_" >> + version ".orig.tar.gz")) > > What about using http://emacs-w3m.namazu.org/emacs-w3m-1.4.4.tar.gz ? Alas, it is nearly 10 years old, and does not work with Emacs 24. Attempts to compile it result in several occurrences of the following error message: =20=20=20=20=20=20 Emacs-w3m of this version does not support Emacs 24; try the development version >> + (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= period. > >> + (synopsis "A simple file downloader for emacs, based on wget.") > > Likewise. Thanks, I'll post an updated patch soon. Mark