Ben Schmidt [Wed, 29 Feb 2012 16:34:29 +0000 (03:34 +1100)]
Add %thin% and %wide% width-reckoning modes.
Also fixes some problems relating to the indent when wrapping, ensuring the
indent isn't swallowed (even though it's whitespace), and that lines aren't
broken in it (even though it's whitespace; breaking in it causes an infinite
loop, as it's always replenished).
Ben Schmidt [Wed, 29 Feb 2012 16:33:53 +0000 (03:33 +1100)]
Make sure parts of lines aren't processed twice.
This ensures backslash escaping is not done twice, and that the one time it is
done it is effective (for break inhibition).
Ben Schmidt [Tue, 28 Feb 2012 13:46:35 +0000 (00:46 +1100)]
Add wrapping modes to facilitate wrapping non-English texts.
- Add %wordwrap%, %charwrap% and %userwrap% line-breaking modes.
- \<space> now means a non-breakable space, not a break opportunity.
- Introduce \/ to mark a break opportunity.
- Introduce \= to inhibit a break.
Ben Schmidt [Tue, 28 Feb 2012 13:03:46 +0000 (00:03 +1100)]
Fix backslash escaping mechanism.
Ensuring:
- double backslash can't effectively recurse and form part of another escape
sequence (because backslash is treated both in unistr.c and prepstdreply.c)
- other non-unicode escapes aren't ignored (because they are turned into
question marks in unistr.c)
- first lines of included files don't 'escape' escaping because they are
retrieved in begin_new_*() rather than get_processed_text_line().
- files intended to be included transparently aren't escaped, and upcoming
lines aren't doubly escaped
Ben Schmidt [Wed, 25 Jan 2012 11:34:57 +0000 (22:34 +1100)]
Add ability to subscribe to 'both' and avoid a deadlock when switching.
- 'both' means normal and digest versions simultaneously; information about
this feature is not included in the default list texts, but a few power users
find it helpful.
- Only take out locks when actually performing a subscription, not before
checking whether the address is already subscribed; we only really need it
when we are actually changing the file, and there is a potential deadlock
which could occur while waiting for unsubscription to complete as part of a
switch if the lock is taken earlier.
- Also moved code which sends unsubscription confirmations so that it only runs
once, after unsubsciption has been completed, not every time the address is
removed; this is only really important when 'both' is a realistic
subscription option, but it could avoid other double-sends as well.
Ben Schmidt [Tue, 24 Jan 2012 04:43:53 +0000 (15:43 +1100)]
Move subreason_strs and subtype_strs to subscriberfuncs.c.
They are needed by multiple executables, so can't go in a file with main(). It
is important to remember to link in subscriberfuncs.c whenever these variables
are used. Maybe write wrapper functions in future to enforce this as errors can
be hard to track down when this goes wrong.
Ben Schmidt [Mon, 23 Jan 2012 16:02:00 +0000 (03:02 +1100)]
Changes to how subscription and unsubscribe work.
- Make +unsubscribe remove the requester from all versions of the list.
- Make mlmmj-unsub default to removing the requester from all versions of the
list.
- Make mlmmj-sub and +subscribe[-digest|-nomail] switch existing subscriptions.
- Add a switch to bypass notifying the owner on subscribe/unsubscribe.
- Make type available in finish list texts.
Ben Schmidt [Mon, 23 Jan 2012 08:55:04 +0000 (19:55 +1100)]
Improvements to wrapping.
- Introduce \<space> to indicate line-break positions to enable sensible
wrapping of Chinese and similar text.
- Allow lines to be longer than the wrapping width if there are no spaces, as
generated email addresses (e.g. for moderation) won't work if split.
- Fix a bug where using a whole line while wrapping would turn wrapping off as
the saved (empty) remaining portion would be considered a blank line.
- Use int rather than size_t for line lengths; it's just easier, since we use
negatives for certain conditions, and it should be plenty big enough.
Ben Schmidt [Mon, 23 Jan 2012 02:06:45 +0000 (13:06 +1100)]
Use character names in man pages.
Groff currently by default uses latin1 for its input encoding and doesn't
support utf-8 at all [1], but Debian can and one day must use utf-8 [2, 3]. By
using character names [4] we sidestep the incompatibility.
[1] info groff -- gtroff Reference::Text::Input Encodings::
http://www.gnu.org/software/groff/manual/html_node/Input-Encodings.html
[2] http://www.debian.org/doc/debian-policy/ch-docs.html
[3] http://www.debian.org/doc/debian-policy/footnotes.html#f101
[4] man groff_char
http://manpages.debian.net/cgi-bin/man.cgi?query=groff_char&apropos=0&sektion=0&manpath=Debian+6.0+squeeze&format=html&locale=en
Ben Schmidt [Tue, 17 Jan 2012 00:20:38 +0000 (11:20 +1100)]
Add formatted substitutions that are lists.
These are %digestthreads%, %gatekeepers%, %listsubs%, %digestsubs%,
%nomailsubs%, %moderators% and %bouncenumbers%.
Ben Schmidt [Mon, 16 Jan 2012 14:26:45 +0000 (01:26 +1100)]
Rework the internals of list text substitution and add some substitutions.
This includes making some substitutions more widely available, too, and marking
some old ones as deprecated, too.
Ben Schmidt [Thu, 29 Dec 2011 13:20:21 +0000 (00:20 +1100)]
Improve algorithm for list text substitutions.
Now the string is processed character by character, so multiple substitutions
on a single line will work when substitutions do not actually take place, and
it is more efficient.