summary refs log tree commit diff
path: root/gnu/packages/emacs.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-09-01 10:10:36 +0200
committerLudovic Courtès <ludo@gnu.org>2015-09-01 14:18:38 +0200
commit1defd8cd2e4efe3fa2c5532d6e560dfc37e44820 (patch)
treeb46cd22b15c21ad73d17a51aaa66788d8eb7dffa /gnu/packages/emacs.scm
parent761d6fd9c16801a13d1abe0a6951e793144ae791 (diff)
downloadguix-1defd8cd2e4efe3fa2c5532d6e560dfc37e44820.tar.gz
gnu: Add emacs-let-alist.
* gnu/packages/emacs.scm (let-alist): New variable.
Diffstat (limited to 'gnu/packages/emacs.scm')
-rw-r--r--gnu/packages/emacs.scm47
1 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index b0a8b08dbe..7bb302c49f 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -487,6 +487,53 @@ support for Git-SVN.")
 programs.")
     (license license:gpl3+)))
 
+(define-public let-alist
+  (package
+    (name "emacs-let-alist")
+    (version "1.0.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://elpa.gnu.org/packages/let-alist-"
+                                  version ".el"))
+              (sha256
+               (base32
+                "07312bvvyz86lf64vdkxg2l1wgfjl25ljdjwlf1bdzj01c4hm88x"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils)
+                  (guix build emacs-utils))
+
+       #:builder (begin
+                   (use-modules (guix build emacs-utils)
+                                (guix build utils))
+
+                   (let* ((out     (assoc-ref %outputs "out"))
+                          (lispdir (string-append out
+                                                  "/share/emacs/site-lisp/"
+                                                  "guix.d/let-alist-"
+                                                  ,version))
+                          (emacs   (assoc-ref %build-inputs "emacs")))
+
+                     (mkdir-p lispdir)
+                     (copy-file (assoc-ref %build-inputs "source")
+                                (string-append lispdir "/let-alist.el"))
+
+                     (setenv "PATH" (string-append emacs "/bin"))
+                     (emacs-byte-compile-directory lispdir)
+                     #t))))
+    (native-inputs `(("emacs" ,emacs-no-x)))
+    (home-page "http://elpa.gnu.org/packages/let-alist.html")
+    (synopsis "Easily let-bind values of an assoc-list by their names")
+    (description
+     "This package offers a single Emacs Lisp macro, @code{let-alist}.  This
+macro takes a first argument, whose value must be an alist (association list),
+and a body.
+
+The macro expands to a let form containing the body, where each dotted symbol
+inside body is let-bound to their cdrs in the alist.  Only those present in
+the body are let-bound and this search is done at compile time.")
+    (license license:gpl3+)))
+
 
 ;;;
 ;;; Web browsing.