Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The meek are contesting the will.


computers / news.software.nntp / [PATCH]: SLRN: check against excess quoting.

SubjectAuthor
o [PATCH]: SLRN: check against excess quoting.Kaz Kylheku

1
[PATCH]: SLRN: check against excess quoting.

<20230828124643.407@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2065&group=news.software.nntp#2065

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: news.software.nntp
Subject: [PATCH]: SLRN: check against excess quoting.
Date: Mon, 28 Aug 2023 19:54:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 1159
Message-ID: <20230828124643.407@kylheku.com>
Injection-Date: Mon, 28 Aug 2023 19:54:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="10c6d898fd3a93281822b96d674293f3";
logging-data="1943710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ituMeucikQNPoYSCP6ngMxCgB4z/3W7I="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:Fu2a1Cs2iXxqE+OQXCy9FYdvAJA=
 by: Kaz Kylheku - Mon, 28 Aug 2023 19:54 UTC

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
+@;
+@; Now temp.txt has the renumbered manual with regenerated TOC.
+@;
+@; 4. Check it:
+@;
+@; diff -u manual.txt temp.txt
+@;
+@; 5. If happy:
+@;
+@; mv temp.txt manual.txt
+@;
+@; 6. If unhappy, fix manual.txt or this script.
+@;
+@(collect)
+@preamble
+@(until)
+ Table of Contents
+ +@(end)
+@(skip)
+ ______________________________________________________________________
+ +@(collect :vars (depth line title))
+ @{sec /(\d+\.)+/} @title
+@ (bind depth @(count #\. sec))
+@ (collect)
+@line
+@ (until)
+ @/\d+/.@nil
+@ (end)
+@(end)
+@(bind renum
+ @(let* ((prevnum '()))
+ (collect-each ((d depth))
+ (let ((renum (if (> d (len prevnum))
+ ^(,*prevnum 1)
+ (let* ((pd (pred d)))
+ ^(,*[prevnum 0..pd] ,(succ [prevnum pd]))))))
+ (set prevnum renum)))))
+@(output)
+@ (repeat)
+@ preamble
+@ (end)
+ Table of Contents
+@ (repeat)
+@ (caseq (len renum)
+ (1 `\n @renum. @title`)
+ (2 ` @{renum "."} @title`)
+ (3 ` @{renum "."} @title`))
+@ (end)
+ ______________________________________________________________________
+ +
+@ (repeat)
+ @{renum "."}. @title
+@ (repeat)
+@ line
+@ (end)
+@(end)
+@(end)
diff --git a/doc/manual.txt b/doc/manual.txt
index 9f74e3b..af8d9a2 100644
--- a/doc/manual.txt
+++ b/doc/manual.txt
@@ -20,7 +20,9 @@
2.1 A brief introduction to the built-in S-Lang prompt
3. Command line switches
+ 4. Environment variables
+ 5. The slrn configuration file
5.1 Basics
5.2 Preprocessing of configuration files
@@ -119,79 +121,81 @@
6.61 metamail_command
6.62 mime_charset
6.63 min_high_score
- 6.64 mouse
- 6.65 netiquette_warnings
- 6.66 new_subject_breaks_threads
- 6.67 no_autosave
- 6.68 no_backups
- 6.69 non_Xbrowser
- 6.70 organization
- 6.71 overview_date_format
- 6.72 post_editor_command
- 6.73 post_object
- 6.74 postpone_directory
- 6.75 prefer_head
- 6.76 printer_name
- 6.77 process_verbatim_marks
- 6.78 query_next_article
- 6.79 query_next_group
- 6.80 query_read_group_cutoff
- 6.81 quote_string
- 6.82 read_active
- 6.83 realname
- 6.84 reject_long_lines
- 6.85 reply_custom_headers
- 6.86 reply_string
- 6.87 replyto
- 6.88 save_directory
- 6.89 save_posts
- 6.90 save_replies
- 6.91 score_editor_command
- 6.92 scorefile
- 6.93 scroll_by_page
- 6.94 sendmail_command
- 6.95 server_object
- 6.96 show_article
- 6.97 show_thread_subject
- 6.98 signature
- 6.99 signoff_string
- 6.100 simulate_graphic_chars
- 6.101 smart_quote
- 6.102 sorting_method
- 6.103 spoiler_char
- 6.104 spoiler_display_mode
- 6.105 spool_active_file
- 6.106 spool_activetimes_file
- 6.107 spool_check_up_on_nov
- 6.108 spool_inn_root
- 6.109 spool_newsgroups_file
- 6.110 spool_nov_file
- 6.111 spool_nov_root
- 6.112 spool_overview_file
- 6.113 spool_root
- 6.114 supersedes_custom_headers
- 6.115 top_status_line
- 6.116 uncollapse_threads
- 6.117 unsubscribe_new_groups
- 6.118 use_blink
- 6.119 use_color
- 6.120 use_flow_control
- 6.121 use_grouplens
- 6.122 use_header_numbers
- 6.123 use_localtime
- 6.124 use_metamail
- 6.125 use_mime
- 6.126 use_recommended_msg_id
- 6.127 use_slrnpull
- 6.128 use_tilde
- 6.129 use_tmpdir
- 6.130 use_uudeview
- 6.131 username
- 6.132 warn_followup_to
- 6.133 wrap_flags
- 6.134 wrap_method
- 6.135 write_newsrc_flags
- 6.136 Xbrowser
+ 6.64 min_original_percentage
+ 6.65 mouse
+ 6.66 netiquette_warnings
+ 6.67 new_subject_breaks_threads
+ 6.68 no_autosave
+ 6.69 no_backups
+ 6.70 non_Xbrowser
+ 6.71 organization
+ 6.72 overview_date_format
+ 6.73 post_editor_command
+ 6.74 post_object
+ 6.75 postpone_directory
+ 6.76 prefer_head
+ 6.77 printer_name
+ 6.78 process_verbatim_marks
+ 6.79 query_next_article
+ 6.80 query_next_group
+ 6.81 query_read_group_cutoff
+ 6.82 quote_string
+ 6.83 read_active
+ 6.84 realname
+ 6.85 reject_excess_quoting
+ 6.86 reject_long_lines
+ 6.87 reply_custom_headers
+ 6.88 reply_string
+ 6.89 replyto
+ 6.90 save_directory
+ 6.91 save_posts
+ 6.92 save_replies
+ 6.93 score_editor_command
+ 6.94 scorefile
+ 6.95 scroll_by_page
+ 6.96 sendmail_command
+ 6.97 server_object
+ 6.98 show_article
+ 6.99 show_thread_subject
+ 6.100 signature
+ 6.101 signoff_string
+ 6.102 simulate_graphic_chars
+ 6.103 smart_quote
+ 6.104 sorting_method
+ 6.105 spoiler_char
+ 6.106 spoiler_display_mode
+ 6.107 spool_active_file
+ 6.108 spool_activetimes_file
+ 6.109 spool_check_up_on_nov
+ 6.110 spool_inn_root
+ 6.111 spool_newsgroups_file
+ 6.112 spool_nov_file
+ 6.113 spool_nov_root
+ 6.114 spool_overview_file
+ 6.115 spool_root
+ 6.116 supersedes_custom_headers
+ 6.117 top_status_line
+ 6.118 uncollapse_threads
+ 6.119 unsubscribe_new_groups
+ 6.120 use_blink
+ 6.121 use_color
+ 6.122 use_flow_control
+ 6.123 use_grouplens
+ 6.124 use_header_numbers
+ 6.125 use_localtime
+ 6.126 use_metamail
+ 6.127 use_mime
+ 6.128 use_recommended_msg_id
+ 6.129 use_slrnpull
+ 6.130 use_tilde
+ 6.131 use_tmpdir
+ 6.132 use_uudeview
+ 6.133 username
+ 6.134 warn_followup_to
+ 6.135 wrap_flags
+ 6.136 wrap_method
+ 6.137 write_newsrc_flags
+ 6.138 Xbrowser
7. Interactive functions
7.1 group functions
@@ -329,9 +333,9 @@
7.3.15 self_insert
7.3.16 trim
7.3.17 up
- ______________________________________________________________________
+
1. Introduction
slrn (``S-Lang read news'') is a newsreader, i.e. a program that
@@ -2534,7 +2538,56 @@

Click here to read the complete article

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor