unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 2/5] build: emacs-utils: Add 'emacs-byte-compile-directory'
@ 2015-06-21  8:29 Federico Beffa
  2015-06-21 20:40 ` Alex Kost
  0 siblings, 1 reply; 4+ messages in thread
From: Federico Beffa @ 2015-06-21  8:29 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 39 bytes --]

A new general utility for Emacs.

Fede

[-- Attachment #2: 0002-build-emacs-utils-Add-emacs-byte-compile-directory.patch --]
[-- Type: text/x-diff, Size: 1708 bytes --]

From d036941639ecffe8fb29dd9cc7ee9b5fe0e6b10c Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Tue, 16 Jun 2015 21:09:57 +0200
Subject: [PATCH 2/5] build: emacs-utils: Add 'emacs-byte-compile-directory'.

* guix/build/emacs-utils.scm (emacs-byte-compile-directory): New procedure.
---
 guix/build/emacs-utils.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 0cff28b..3ecccd9 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -22,6 +22,7 @@
             emacs-batch-eval
             emacs-batch-edit-file
             emacs-generate-autoloads
+            emacs-byte-compile-directory
             emacs-substitute-sexps
             emacs-substitute-variables))
 
@@ -57,6 +58,18 @@
                   (update-directory-autoloads ,directory))))
     (emacs-batch-eval expr)))
 
+(define* (emacs-byte-compile-directory dir #:optional (dependency-dirs '()))
+  "Byte compile all files in DIR and its sub-directories.  Before compiling
+the files, add DIR and all directories in DEPENDENCY-DIRS to 'load-path'."
+  (let ((expr `(progn
+                (add-to-list 'load-path ,dir)
+                (unless (null ,(if (null? dependency-dirs)
+                                   'nil
+                                   dependency-dirs))
+                  (setq load-path (append load-path ,dependency-dirs)))
+                (byte-recompile-directory (file-name-as-directory ,dir) 0))))
+    (emacs-batch-eval expr)))
+
 (define-syntax emacs-substitute-sexps
   (syntax-rules ()
     "Substitute the S-expression immediately following the first occurrence of
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-24 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-21  8:29 [PATCH 2/5] build: emacs-utils: Add 'emacs-byte-compile-directory' Federico Beffa
2015-06-21 20:40 ` Alex Kost
2015-06-24 16:13   ` Federico Beffa
2015-06-24 21:07     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).