[bug#55420,2/2] guix: emacs-utils: Add emacs-header-parse.
Commit Message
* guix/build/emacs-utils.scm (emacs-header-parse): New procedure.
---
guix/build/emacs-utils.scm | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
Fredrik Salomonsson <plattfot@posteo.net> skribis:
> * guix/build/emacs-utils.scm (emacs-header-parse): New procedure.
LGTM!
Could you send a v2 of these patches?
Thanks in advance,
Ludo’.
@@ -32,6 +32,7 @@ (define-module (guix build emacs-utils)
emacs-batch-script
emacs-generate-autoloads
emacs-byte-compile-directory
+ emacs-header-parse
as-display
emacs-substitute-sexps
@@ -97,6 +98,14 @@ (define* (emacs-byte-compile-directory dir)
(byte-recompile-directory (file-name-as-directory ,dir) 0 1))))
(emacs-batch-eval expr)))
+(define (emacs-header-parse section file)
+ "Parse the header SECTION in FILE and return it as a string."
+ (emacs-batch-script
+ `(progn
+ (require 'lisp-mnt)
+ (find-file ,file)
+ (princ (lm-header ,section)))))
+
(define as-display ;syntactic keyword for 'emacs-substitute-sexps'
'(as display))