build: emacs-utils: Add 'emacs-generate-autoloads'.

* guix/build/emacs-utils.scm (emacs-generate-autoloads): New procedure.
This commit is contained in:
Alex Kost 2014-12-01 20:21:08 +03:00
parent 12f2490aa3
commit 0b08600ca5
1 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -20,6 +21,7 @@
#:export (%emacs
emacs-batch-eval
emacs-batch-edit-file
emacs-generate-autoloads
emacs-substitute-sexps
emacs-substitute-variables))
@ -47,6 +49,14 @@
(format #f "--eval=~S" expr)))
(error "emacs-batch-edit-file failed!" file expr)))
(define (emacs-generate-autoloads name directory)
"Generate autoloads for Emacs package NAME placed in DIRECTORY."
(let* ((file (string-append directory "/" name "-autoloads.el"))
(expr `(let ((backup-inhibited t)
(generated-autoload-file ,file))
(update-directory-autoloads ,directory))))
(emacs-batch-eval expr)))
(define-syntax emacs-substitute-sexps
(syntax-rules ()
"Substitute the S-expression immediately following the first occurrence of