This patch implements new configuration variables for defending
against too much quoted material in a follow-up article. Over the years,
I have screwed up a number of times, posting too much quoted material,
mostly due to getting distracted and forgetting about the part of the
followup that is off-screen.
I included a utility for renumbering the sections in manual.txt
and regenearting the TOC.
I sent the patch upstream.
From 2cb6f0febecfb5b7d0eca7e30af303b11bee7b26 Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <
kaz@kylheku.com>
Date: Thu, 24 Aug 2023 22:00:02 -0700
Subject: [PATCH 1/2] Implement rejection of too much quoted material.
* src/post.c (Slrn_Reject_Excess_Quoting,
Slrn_Min_Original_Percentage): New config variables.
(prepare_body): Calculate the number of original and
quoted lines, then check against minimum original
percentage, if configured.
* src/post.h (Slrn_Reject_Excess_Quoting,
Slrn_Min_Original_Percentage): Declared.
* src/startup.c (Slrn_Int_Variables): Registering
new config variables as "reject_excess_quoting"
and "min_original_percentage".
* doc/manual.txt: Documented. There is a slight change
in format: in the table of contents, there are now blank
lines before top-level section headings even if they
are preceded by other top-level section headings.
* doc/manual-renumber.txr: TXR script for regenerating
the manual with renumbered sections.
---
doc/manual-renumber.txr | 77 +++++++++
doc/manual.txt | 370 ++++++++++++++++++++++++----------------
src/post.c | 40 ++++-
src/post.h | 2 +
src/startup.c | 2 +
5 files changed, 340 insertions(+), 151 deletions(-)
create mode 100644 doc/manual-renumber.txr
diff --git a/doc/manual-renumber.txr b/doc/manual-renumber.txr
new file mode 100644
index 0000000..5b54437
--- /dev/null
+++ b/doc/manual-renumber.txr
@@ -0,0 +1,77 @@
+@; Script to renumber sections of manual.txt and generate TOC.
+@;
+@; Requires TXR (
https://nongnu.org/txr).
+@;
+@; Copyright 2023 Kaz Kylheku <
kaz@kylheku.com>
+@; See slrn ../COPYING file for copying info.
+@;
+@; How to use:
+@;
+@; 1. Do not manually edit the table of contents.
+@;
+@; 2. Add your new sections under some dummy section numbers which have the +@; right depth. Observe the exact formatting rules.
+@;
+@; 3. Run this:
+@;
+@; txr manual-renumber manual.txt > temp.txt
+@;
+