l...@gnu.org (Ludovic Courtès) writes: > m...@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’s great! > > Comments below: > >> +(define %emacs >> + ;; The `emacs' command. >> + (make-parameter "emacs")) > > It should be exported.
Indeed! >> +(define-syntax emacs-substitute-vars > > Perhaps ‘emacs-substitute-variables’? (I try to avoid abbreviations 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 ‘let’ are aligned. Agreed. >> + (unless (zero? (system* >> + emacs "--quick" "--batch" >> + (format #f "--eval=~S" >> + '(byte-compile-file "paredit.el")))) >> + (error "failed to compile paredit.el!"))))))) > > Perhaps this calls for an ‘emacs-batch-eval’ procedure? Good idea. >> + (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 ? 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: 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 “Simple Web browser for Emacs based on w3m”, with no period. > >> + (synopsis "A simple file downloader for emacs, based on wget.") > > Likewise. Thanks, I'll post an updated patch soon. Mark