bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 22/23] man/manlinks.sed: Drop unnecessary code.


From: G. Branden Robinson
Subject: [PATCH 22/23] man/manlinks.sed: Drop unnecessary code.
Date: Thu, 26 Dec 2024 21:36:59 -0600

It is no longer necessary to sift the "SYNOPSIS" section to find
additional topics for which we should generate links (or stub 'so'
pages) to the main page.

Tested by:
$ cat man/*.{1,1m,3x,5,7} | sed -f man/manlinks.sed > BEFORE
[apply this patch]
$ cat man/*.{1,1m,3x,5,7} | sed -f man/manlinks.sed > AFTER
$ cmp BEFORE AFTER && echo SAME
SAME
---
 man/manlinks.sed | 41 ++---------------------------------------
 1 file changed, 2 insertions(+), 39 deletions(-)

diff --git a/man/manlinks.sed b/man/manlinks.sed
index 011824481..7ac784bdb 100644
--- a/man/manlinks.sed
+++ b/man/manlinks.sed
@@ -31,9 +31,6 @@
 # listed in the "NAME" section, i.e., the names that we would like to use
 # as aliases for the manpage -T.Dickey
 #
-# workaround for manpages without a SYNOPSIS
-s/^\.\\"SH/.SH/
-#
 # eliminate formatting controls that get in the way
 /^'\\"/d
 /\.\\"/d
@@ -75,42 +72,8 @@ s/ /\
 /g
 }
 #
-# in ".SH SYNOPSIS"
-# For readability, the NAME section may not contain all function names, but we
-# still want to make aliases for those.  Do this by extracting names from the
-# list of function prototypes in the synopsis.
-#
-# Remove any line that does not contain a '(', since we only want functions. 
-# then strip off return-type of each function.
-#
-# Finally, remove the parameter list, which begins with a '('.
-/^\.SH_(SYNOPSIS/,/^\.SH_(DESCRIPTION/{
-/^\.ti/d
-/^[^(]*$/d
-# reduce
-#      .B "int add_wch( const cchar_t *\fIwch\fB );"
-# to
-#      add_wch( const cchar_t *\fIwch\fB );"
-s/^\([^ (]* [^ (]* [*]*\)//g
-s/^\([^ (]* [*]*\)//g
-# trim blanks in case we have
-#      void (*) (FORM *) field_init(const FORM *form);
-s/) (/)(/g
-# reduce stuff like
-#      void (*)(FORM *) field_init(const FORM *form);
-# to
-#      field_init(const FORM *form);
-s/^\(([^)]*)\)\(([^)]*)\)*[ ]*//g
-# rename marker temporarily
-s/\.SH_(/.SH_/
-# kill lines with ");", and trim off beginning of argument list.
-s/[()].*//
-# rename marker back
-s/\.SH_/.SH_(/
-}
-#
-# delete ".SH DESCRIPTION" and following lines
-/^\.SH_(DESCRIPTION/,${
+# delete remainder of document
+/^\.SH_([^N]/,${
 d
 }
 #
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]