GNU bug report logs - #77387
[PATCH 0/2] man-db: Better parsing of man macros.

Previous Next

Package: guix-patches;

Reported by: Sergey Trofimov <sarg <at> sarg.org.ru>

Date: Sun, 30 Mar 2025 14:27:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sergey Trofimov <sarg <at> sarg.org.ru>
To: 77387 <at> debbugs.gnu.org
Cc: Sergey Trofimov <sarg <at> sarg.org.ru>, Sergey Trofimov <sarg <at> sarg.org.ru>, Ludovic Courtès <ludo <at> gnu.org>, Christopher Baines <guix <at> cbaines.net>, Josselin Poiret <dev <at> jpoiret.xyz>, Mathieu Othacehe <othacehe <at> gnu.org>, Simon Tournier <zimon.toutoune <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: [bug#77387] [PATCH v2 2/2] man-db: Support mdoc-formatted man pages.
Date: Wed,  9 Apr 2025 14:46:41 +0200
* guix/man-db.scm (man-page->entry): Extract man name and section from
.Dt macro.

Change-Id: I02dc99d73dceecdb077315805025efad9a650e91
---
 guix/man-db.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/guix/man-db.scm b/guix/man-db.scm
index 1259658f52..59723fb336 100644
--- a/guix/man-db.scm
+++ b/guix/man-db.scm
@@ -227,10 +227,13 @@ (define* (man-page->entry file #:optional (resolve identity))
                   ;; man 7 groff groff_mdoc groff_man
                   ;; look for metadata in macro invocations (lines starting with .)
                   (match (and (string-prefix? "." line) (man-macro-tokenize line))
-                    ((".TH" name (= string->number section) _ ...)
+                    ;; "Title Header" or "Document title"
+                    (((or ".TH" ".Dt") name (= string->number section) _ ...)
                      (loop name section synopsis kind))
+                    ;; "Section Header"
                     ((".SH" (or "NAME" "\"NAME\""))
                      (loop name section (read-synopsis port) kind))
+                    ;; include source
                     ((".so" link)
                      (match (and=> (resolve link)
                                    (cut man-page->entry <> resolve))
-- 
2.49.0





This bug report was last modified 92 days ago.

Previous Next


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