GNU bug report logs - #55420
[PATCH 0/2] Add a function to parse emacs elisp's package header

Previous Next

Package: guix-patches;

Reported by: Fredrik Salomonsson <plattfot <at> posteo.net>

Date: Sat, 14 May 2022 23:01:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 55420 <at> debbugs.gnu.org (full text, mbox):

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: 55420 <at> debbugs.gnu.org
Cc: Fredrik Salomonsson <plattfot <at> posteo.net>
Subject: [PATCH 2/2] guix: emacs-utils: Add emacs-header-parse.
Date: Sat, 14 May 2022 23:05:08 +0000
* guix/build/emacs-utils.scm (emacs-header-parse): New procedure.
---
 guix/build/emacs-utils.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 8d40b9e139..76d9464806 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -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))
 
-- 
2.36.0





This bug report was last modified 3 years and 52 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.