sgt/halibut
19 years agoForgot to set a file position on characters being returned from
simon [Fri, 20 Aug 2004 09:20:38 +0000 (09:20 +0000)]
Forgot to set a file position on characters being returned from
macro expansions.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4489 cda61777-01e9-0310-a592-d414129be87e

19 years agoRemove a \#{FIXME} comment in \cfg{paper-chapter-top-space}; the checkin
jacob [Mon, 9 Aug 2004 21:09:28 +0000 (21:09 +0000)]
Remove a \#{FIXME} comment in \cfg{paper-chapter-top-space}; the checkin
of bk_paper.c 1.29 [r4330] appears to have fixed this.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4432 cda61777-01e9-0310-a592-d414129be87e

19 years ago`make release' tweak to prevent tarball containing trailing NULs (fix from
jacob [Mon, 9 Aug 2004 17:09:40 +0000 (17:09 +0000)]
`make release' tweak to prevent tarball containing trailing NULs (fix from
putty/mkunxarc.sh) - apparently this upsets some older gzips (1.2.4).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4431 cda61777-01e9-0310-a592-d414129be87e

19 years agoExplicitly bless in the documentation, and fix in the man backend,
simon [Fri, 6 Aug 2004 12:17:56 +0000 (12:17 +0000)]
Explicitly bless in the documentation, and fix in the man backend,
the practice of using \dt and \dd in anything other than the obvious
interleaving.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4417 cda61777-01e9-0310-a592-d414129be87e

19 years agoMake sure (paragraph)->private_data is defined in all cases, on general
jacob [Fri, 6 Aug 2004 01:34:58 +0000 (01:34 +0000)]
Make sure (paragraph)->private_data is defined in all cases, on general
principles (it may be unnecessary). Perhaps we should do this for
(word)->private_data too.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4412 cda61777-01e9-0310-a592-d414129be87e

19 years agoFix crash in Info backend: if a \[Kk] to a \B or \n was followed in a
jacob [Fri, 6 Aug 2004 01:33:10 +0000 (01:33 +0000)]
Fix crash in Info backend: if a \[Kk] to a \B or \n was followed in a
paragraph by another \[Kk], Bad Things would happen.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4411 cda61777-01e9-0310-a592-d414129be87e

19 years agodup_word_list() does the right thing if passed NULL (on general principles)
jacob [Fri, 6 Aug 2004 00:31:35 +0000 (00:31 +0000)]
dup_word_list() does the right thing if passed NULL (on general principles)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4410 cda61777-01e9-0310-a592-d414129be87e

19 years agoFix for an uninitialised structure member spotted by valgrind (probably didn't
jacob [Wed, 4 Aug 2004 16:44:38 +0000 (16:44 +0000)]
Fix for an uninitialised structure member spotted by valgrind (probably didn't
have any real effect).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4401 cda61777-01e9-0310-a592-d414129be87e

19 years agoExplicit bounds checking on the bmp[] array.
simon [Wed, 4 Aug 2004 16:27:28 +0000 (16:27 +0000)]
Explicit bounds checking on the bmp[] array.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4400 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd an explicit cast to prevent a compiler warning.
simon [Wed, 4 Aug 2004 16:26:02 +0000 (16:26 +0000)]
Add an explicit cast to prevent a compiler warning.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4399 cda61777-01e9-0310-a592-d414129be87e

19 years agoColin spotted a sizeof/lenof confusion which we think has been
simon [Wed, 4 Aug 2004 16:25:06 +0000 (16:25 +0000)]
Colin spotted a sizeof/lenof confusion which we think has been
causing segfaults on strange architectures.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4398 cda61777-01e9-0310-a592-d414129be87e

19 years agoMore careful context hash calculation which doesn't depend on size
simon [Fri, 30 Jul 2004 13:21:40 +0000 (13:21 +0000)]
More careful context hash calculation which doesn't depend on size
of `unsigned long'. Should help Debian build problems (bug#259504).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4377 cda61777-01e9-0310-a592-d414129be87e

19 years agoDivision by zero (which criminally failed to give rise to any kind
simon [Sat, 17 Jul 2004 15:47:22 +0000 (15:47 +0000)]
Division by zero (which criminally failed to give rise to any kind
of signal!) was causing massive misplacement of the single line of
text on a one-line page in PS and PDF.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4330 cda61777-01e9-0310-a592-d414129be87e

19 years agoCut-and-paste error was preventing PS and PDF filename config
simon [Sat, 17 Jul 2004 15:29:16 +0000 (15:29 +0000)]
Cut-and-paste error was preventing PS and PDF filename config
options from being processed in some circumstances.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4329 cda61777-01e9-0310-a592-d414129be87e

19 years agoTweak for \cq (probably unnecessary)
jacob [Fri, 16 Jul 2004 12:54:59 +0000 (12:54 +0000)]
Tweak for \cq (probably unnecessary)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4328 cda61777-01e9-0310-a592-d414129be87e

19 years agoRight; I'm finally sick of typing \q{\cw{foo}}, so I've invented a
simon [Fri, 16 Jul 2004 11:54:04 +0000 (11:54 +0000)]
Right; I'm finally sick of typing \q{\cw{foo}}, so I've invented a
shorthand command \cq{foo}.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4327 cda61777-01e9-0310-a592-d414129be87e

19 years agoFailed to initialise state.curr_topic early enough, causing
simon [Tue, 13 Jul 2004 08:40:20 +0000 (08:40 +0000)]
Failed to initialise state.curr_topic early enough, causing
uninitialised-memory references and a segfault. Quite why this never
happened when I tested it at home, I have no idea!

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4326 cda61777-01e9-0310-a592-d414129be87e

19 years agoApparently (according to a user) WinZip complains of `trailing
simon [Mon, 5 Jul 2004 14:23:03 +0000 (14:23 +0000)]
Apparently (according to a user) WinZip complains of `trailing
garbage' when handling a GNU tar archive. Using the -o flag when
building the tar file creates an archive which the user said WinZip
had no trouble with, and GNU tar seems just as happy with that, so
`make release' now uses -o.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4323 cda61777-01e9-0310-a592-d414129be87e

19 years agoAvoid generating an index section if there actually is no index.
simon [Fri, 2 Jul 2004 18:45:05 +0000 (18:45 +0000)]
Avoid generating an index section if there actually is no index.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4321 cda61777-01e9-0310-a592-d414129be87e

19 years agoSort out error handling everywhere a charset name is converted into
simon [Sun, 27 Jun 2004 13:18:32 +0000 (13:18 +0000)]
Sort out error handling everywhere a charset name is converted into
an integer charset ID.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4317 cda61777-01e9-0310-a592-d414129be87e

19 years agoFree up all the data we allocated during the HTML backend.
simon [Sun, 27 Jun 2004 13:04:24 +0000 (13:04 +0000)]
Free up all the data we allocated during the HTML backend.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4316 cda61777-01e9-0310-a592-d414129be87e

19 years agoSupport non-breaking spaces.
simon [Sun, 27 Jun 2004 12:47:04 +0000 (12:47 +0000)]
Support non-breaking spaces.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4315 cda61777-01e9-0310-a592-d414129be87e

19 years agoConfig directives for all the extra configurable things in the new
simon [Sun, 27 Jun 2004 12:38:19 +0000 (12:38 +0000)]
Config directives for all the extra configurable things in the new
HTML backend.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4314 cda61777-01e9-0310-a592-d414129be87e

19 years agoFix up the restrict_charset and output_charset configuration for the
simon [Sun, 27 Jun 2004 12:23:38 +0000 (12:23 +0000)]
Fix up the restrict_charset and output_charset configuration for the
HTML backend. After an argument with James in which it transpired
that we each thought it was absolutely obvious which one
\cfg{html-charset} ought to map to, and each of us was thinking of a
different one, I've decided that this implies it _isn't_ obvious,
and hence there is no single \cfg{html-charset} directive at all.
Instead, we have \cfg{html-restrict-charset} and \cfg{html-output-
charset}, and any naive user who `just wants to change character
set' is just going to have to RTFM and figure out which one they
mean.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4313 cda61777-01e9-0310-a592-d414129be87e

19 years agonit: s/case-sensitive/case-insensitive/ in comment about nasty indexing
jacob [Mon, 21 Jun 2004 00:28:44 +0000 (00:28 +0000)]
nit: s/case-sensitive/case-insensitive/ in comment about nasty indexing
hack.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4311 cda61777-01e9-0310-a592-d414129be87e

19 years agoVarious HTML backend cleanups.
simon [Sun, 20 Jun 2004 13:44:30 +0000 (13:44 +0000)]
Various HTML backend cleanups.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4308 cda61777-01e9-0310-a592-d414129be87e

19 years agoIntroduce a configurable option to select the HTML flavour. Also
simon [Sun, 20 Jun 2004 13:11:34 +0000 (13:11 +0000)]
Introduce a configurable option to select the HTML flavour. Also
fiddle with various small aspects of the output so that it actually
validates in all supported flavours.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4307 cda61777-01e9-0310-a592-d414129be87e

19 years agoImprove the naming of fragment IDs for numbered list elements and
simon [Sun, 20 Jun 2004 12:20:44 +0000 (12:20 +0000)]
Improve the naming of fragment IDs for numbered list elements and
bibliography entries.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4305 cda61777-01e9-0310-a592-d414129be87e

19 years agoMinimal documentation of all the new paper backend \cfg{} directives.
jacob [Sun, 20 Jun 2004 00:01:42 +0000 (00:01 +0000)]
Minimal documentation of all the new paper backend \cfg{} directives.

Contains many FIXMEs, both for incomplete documentation and incomplete
code.

Couple of other minor tweaks elsewhere.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4304 cda61777-01e9-0310-a592-d414129be87e

19 years agoWe seem to have ended up with duplicate documentation of --man. Gone.
jacob [Sat, 19 Jun 2004 20:26:41 +0000 (20:26 +0000)]
We seem to have ended up with duplicate documentation of --man. Gone.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4303 cda61777-01e9-0310-a592-d414129be87e

19 years agoEnsure that every \cfg{} directive documented so far has appropriate \IM
jacob [Sat, 19 Jun 2004 17:54:33 +0000 (17:54 +0000)]
Ensure that every \cfg{} directive documented so far has appropriate \IM
directives.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4302 cda61777-01e9-0310-a592-d414129be87e

19 years agoFairly wholesale reorganisation of the \cfg{} documentation for the text,
jacob [Sat, 19 Jun 2004 17:40:25 +0000 (17:40 +0000)]
Fairly wholesale reorganisation of the \cfg{} documentation for the text,
WinHelp, man, and info backends, and organisation into sections (now that
we have rather more directives documented). I've not changed the actual
text much if at all.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4301 cda61777-01e9-0310-a592-d414129be87e

19 years agoIn the text backend, multiple characters can now be used for underlining.
jacob [Sat, 19 Jun 2004 17:11:37 +0000 (17:11 +0000)]
In the text backend, multiple characters can now be used for underlining.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4300 cda61777-01e9-0310-a592-d414129be87e

19 years agoThe Unicode OVERLINE in the text backend documentation was probably supposed
jacob [Sat, 19 Jun 2004 17:08:59 +0000 (17:08 +0000)]
The Unicode OVERLINE in the text backend documentation was probably supposed
to be quoted.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4299 cda61777-01e9-0310-a592-d414129be87e

19 years agoNote that \cfg{quotes} and friends apply to the output in its entirety and
jacob [Sat, 19 Jun 2004 17:05:40 +0000 (17:05 +0000)]
Note that \cfg{quotes} and friends apply to the output in its entirety and
can't be changed partway through. Also, add a cross-reference from \q{}.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4298 cda61777-01e9-0310-a592-d414129be87e

19 years agoNote that no index is generated by the text backend.
jacob [Sat, 19 Jun 2004 17:04:51 +0000 (17:04 +0000)]
Note that no index is generated by the text backend.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4297 cda61777-01e9-0310-a592-d414129be87e

19 years agoMinor correction to --ps and --pdf descriptions.
jacob [Sat, 19 Jun 2004 16:35:14 +0000 (16:35 +0000)]
Minor correction to --ps and --pdf descriptions.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4296 cda61777-01e9-0310-a592-d414129be87e

19 years agoInitial rough documentation of some of the newer \cfg{} directives, namely:
jacob [Sat, 19 Jun 2004 16:10:16 +0000 (16:10 +0000)]
Initial rough documentation of some of the newer \cfg{} directives, namely:
 - \cfg{quotes}
 - text, info, man, and winhelp backends:
   - charset
   - quotes and bullets
   - various WinHelp miscellanea
Could stand some rearrangement and expansion, plus I've yet to address the
paper or HTML backends.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4295 cda61777-01e9-0310-a592-d414129be87e

19 years agoModerately nasty workaround for the fact that Windows Help's index
simon [Sat, 19 Jun 2004 16:04:39 +0000 (16:04 +0000)]
Moderately nasty workaround for the fact that Windows Help's index
mechanism is case-insensitive with respect to sorting the list of
index entries. We now append nonbreaking spaces to the ends of some
index terms to ensure they are considered distinct. (Nasty, but it
seems to work.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4294 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd a batch of assertions to ensure no more index terms fail to have
simon [Sat, 19 Jun 2004 15:04:07 +0000 (15:04 +0000)]
Add a batch of assertions to ensure no more index terms fail to have
their anchors generated. Index bugs of this type can be terribly
subtle and go unnoticed for ages; I'm lucky Jacob spotted the first
one of the type, but I'm now going to be careful to avoid any
further ones.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4293 cda61777-01e9-0310-a592-d414129be87e

19 years agoI had somehow managed to leave index entry anchors out of section
simon [Sat, 19 Jun 2004 14:55:35 +0000 (14:55 +0000)]
I had somehow managed to leave index entry anchors out of section
titles. Ahem.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4292 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd a clash-checking mechanism to ensure we never generate the same
simon [Sat, 19 Jun 2004 14:44:47 +0000 (14:44 +0000)]
Add a clash-checking mechanism to ensure we never generate the same
fragment name twice for any reason.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4291 cda61777-01e9-0310-a592-d414129be87e

19 years agoSupport \I\c, \I\cw. (Haven't bothered with \I\e since the emphasis may as
jacob [Sat, 19 Jun 2004 13:27:52 +0000 (13:27 +0000)]
Support \I\c, \I\cw. (Haven't bothered with \I\e since the emphasis may as
well outweigh the "invisibility".)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4290 cda61777-01e9-0310-a592-d414129be87e

19 years agos/text-quotes/man-quotes/. Damn cut and paste. Thanks Jacob.
simon [Wed, 16 Jun 2004 09:43:28 +0000 (09:43 +0000)]
s/text-quotes/man-quotes/. Damn cut and paste. Thanks Jacob.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4288 cda61777-01e9-0310-a592-d414129be87e

19 years agoThe Halibut manual contained at least one instance of two index
simon [Sun, 13 Jun 2004 14:57:25 +0000 (14:57 +0000)]
The Halibut manual contained at least one instance of two index
terms (intentionally) differing only in case, which were being
silently folded into one by the case-insensitive index tag
comparison. Halibut now warns in this situation (but then folds them
anyway, which I think is better than silently generating an index
containing many case-distinct forms of the same word - I imagine
it's very easy to do that by mistake). The manual has been fixed to
explicitly define distinct keywords (in the case I spotted and in
five other cases picked up by the new warning!), and also documents
this issue and how to work with it.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4279 cda61777-01e9-0310-a592-d414129be87e

19 years agoEr, don't forget to document the disallowing of \q within \c. Ahem.
simon [Sat, 12 Jun 2004 21:57:29 +0000 (21:57 +0000)]
Er, don't forget to document the disallowing of \q within \c. Ahem.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4278 cda61777-01e9-0310-a592-d414129be87e

19 years agoEnforce that \q may not be used anywhere within \c. It shouldn't be
simon [Sat, 12 Jun 2004 21:53:26 +0000 (21:53 +0000)]
Enforce that \q may not be used anywhere within \c. It shouldn't be
necessary since the whole point of \c should be that the user wants
to exercise exact control over the glyphs used, and forbidding it
has the useful effect of relieving some backends of having to make
difficult decisions: it means the text backend doesn't have to nest
two pairs of identical quotes, and the paper backends don't have to
downgrade their quote characters if (as is perfectly plausible) the
fixed-pitch font doesn't support the same range as the body text
fonts.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4277 cda61777-01e9-0310-a592-d414129be87e

19 years agoSwitch the memory allocation macros from the Halibut ones
simon [Sat, 12 Jun 2004 20:31:03 +0000 (20:31 +0000)]
Switch the memory allocation macros from the Halibut ones
(mknew/mknewa/resize) to the PuTTY ones (snew/snewn/sresize). snewn
and mknewa have their arguments opposite ways round; this may make
the change initially painful but in the long term will free me of a
nasty context switch every time I move between codebases. Also
sresize takes an explicit type operand which is used to cast the
return value from realloc, thus enforcing that it must be correct,
and arranging that if anyone tries to compile Halibut with a C++
compiler there should be a lot less pain.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4276 cda61777-01e9-0310-a592-d414129be87e

19 years agoInitial checkin of the shiny new rewritten-from-scratch HTML back
simon [Sat, 12 Jun 2004 20:09:40 +0000 (20:09 +0000)]
Initial checkin of the shiny new rewritten-from-scratch HTML back
end. There's a lot more _potentiality_ for new features than there
are actual new features just yet, but future highlights include:
configurable flavour of HTML (3.2, 4, XHTML Transitional or Strict),
proper character set support (this is half way there already), and
more flexible allocation of sections between multiple HTML files.
Meanwhile, immediate benefits include correct handling of special
characters within `author' and `description' strings, omission of
the filename part in hyperlinks within the same HTML file (in
particular, this means a single output file is now totally
independent of its filename), and hyperlinks to the index from the
top-level contents page (I'm amazed nobody has complained at the
lack of this yet!). There are no doubt some shiny new bugs as well,
but I'll never find them unless people start using the thing...

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4275 cda61777-01e9-0310-a592-d414129be87e

19 years agorjk's `make install' patch.
simon [Wed, 2 Jun 2004 19:40:49 +0000 (19:40 +0000)]
rjk's `make install' patch.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4267 cda61777-01e9-0310-a592-d414129be87e

19 years agoStop the PDF backend from crashing if no outline elements appear. It
simon [Sun, 23 May 2004 14:00:27 +0000 (14:00 +0000)]
Stop the PDF backend from crashing if no outline elements appear. It
still doesn't _work_ properly if there aren't any contents entries,
but it's a start.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4250 cda61777-01e9-0310-a592-d414129be87e

19 years agoAll measurements in the paper backend are now configurable, as are
simon [Sun, 23 May 2004 13:55:59 +0000 (13:55 +0000)]
All measurements in the paper backend are now configurable, as are
bullet and quote characters.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4249 cda61777-01e9-0310-a592-d414129be87e

19 years agoCharacter-set-isation and configurability in the WinHelp backend.
simon [Sun, 23 May 2004 13:20:27 +0000 (13:20 +0000)]
Character-set-isation and configurability in the WinHelp backend.
Newly configurable things are: bullet and quote characters as usual,
the ": " that goes between a section number and its title, the "."
coming after numbered-list item numbers, and the text "Title page"
that appears at the top of the .cnt file.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4248 cda61777-01e9-0310-a592-d414129be87e

19 years agoConfigurable bullet and quote characters for the man backend.
simon [Sun, 23 May 2004 11:43:36 +0000 (11:43 +0000)]
Configurable bullet and quote characters for the man backend.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4247 cda61777-01e9-0310-a592-d414129be87e

20 years agoKurt Jung points out that nav menus ought to be WHLP_PARA_SCROLL,
simon [Sun, 16 May 2004 14:18:24 +0000 (14:18 +0000)]
Kurt Jung points out that nav menus ought to be WHLP_PARA_SCROLL,
not _NONSCROLL.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4228 cda61777-01e9-0310-a592-d414129be87e

20 years agopara_Title was confusing the XHTML backend and preventing it from
simon [Tue, 4 May 2004 23:17:43 +0000 (23:17 +0000)]
para_Title was confusing the XHTML backend and preventing it from
printing preambles. Not quite sure how I missed that one!

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4201 cda61777-01e9-0310-a592-d414129be87e

20 years agoWindows Help backend was only accepting \cfg{winhelp-filename} if it
simon [Mon, 3 May 2004 11:39:01 +0000 (11:39 +0000)]
Windows Help backend was only accepting \cfg{winhelp-filename} if it
had a parent pointer (owing to putting the test inside the wrong if
block). This meant that the fake config directive added by
--winhelp=foo.hlp worked fine, but the one at the top of PuTTY's
first doc file didn't. Fixed.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4190 cda61777-01e9-0310-a592-d414129be87e

20 years agoHandle paragraph comments with no space (e.g. "\#waffle"), since these seem
jacob [Wed, 28 Apr 2004 17:34:54 +0000 (17:34 +0000)]
Handle paragraph comments with no space (e.g. "\#waffle"), since these seem
to be permitted (and are used in the PuTTY manual)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4164 cda61777-01e9-0310-a592-d414129be87e

20 years agoGeneral configurability upgrade for the info back end.
simon [Fri, 23 Apr 2004 18:23:05 +0000 (18:23 +0000)]
General configurability upgrade for the info back end.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4131 cda61777-01e9-0310-a592-d414129be87e

20 years agoAhem; that only didn't cause a segfault by sheer luck.
simon [Fri, 23 Apr 2004 17:49:37 +0000 (17:49 +0000)]
Ahem; that only didn't cause a segfault by sheer luck.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4130 cda61777-01e9-0310-a592-d414129be87e

20 years agoOh, and now the text backend warns about too-long code lines, I'd
simon [Fri, 23 Apr 2004 17:20:48 +0000 (17:20 +0000)]
Oh, and now the text backend warns about too-long code lines, I'd
better remove the one too-long code line in the manual :-)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4129 cda61777-01e9-0310-a592-d414129be87e

20 years agoEnhance the text backend to support configurable quote characters,
simon [Fri, 23 Apr 2004 17:20:07 +0000 (17:20 +0000)]
Enhance the text backend to support configurable quote characters,
configurable emphasis characters, various other configurable bits
which have been marked FIXME in the code for a while, and also to
warn when a code paragraph line is too long (because that was the
only other thing labelled FIXME). Fallback options are implemented,
and defaults set accordingly. A UTF-8 text output file now looks
like proper UTF-8.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4128 cda61777-01e9-0310-a592-d414129be87e

20 years agoRewrite ustrftime(), so that (a) it uses wcsftime() where available,
simon [Thu, 22 Apr 2004 18:25:46 +0000 (18:25 +0000)]
Rewrite ustrftime(), so that (a) it uses wcsftime() where available,
and (b) it doesn't trip over strange Unicode characters in the
format string.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4120 cda61777-01e9-0310-a592-d414129be87e

20 years agoUse wcscoll(), if available, when sorting index terms. (In a
simon [Thu, 22 Apr 2004 18:18:44 +0000 (18:18 +0000)]
Use wcscoll(), if available, when sorting index terms. (In a
somewhat roundabout and arse-backwards sort of way, due to some
other properties of the sort that I rather wanted to maintain. But I
hope it should still do some good.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4119 cda61777-01e9-0310-a592-d414129be87e

20 years agoUse iswalpha and towlower if they're available.
simon [Thu, 22 Apr 2004 18:12:22 +0000 (18:12 +0000)]
Use iswalpha and towlower if they're available.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4118 cda61777-01e9-0310-a592-d414129be87e

20 years agoInstead of traversing a list of paragraphs, mark_attr_ends() now
simon [Thu, 22 Apr 2004 18:01:31 +0000 (18:01 +0000)]
Instead of traversing a list of paragraphs, mark_attr_ends() now
merely traverses a list of words, and main() takes responsibility
for applying it to each paragraph in the document. This is so that
it can _also_ be applied to the display form of each index entry,
which Jacob spotted wasn't previously being done.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4117 cda61777-01e9-0310-a592-d414129be87e

20 years agobk_text and bk_info both need to know the on-screen width of
simon [Thu, 22 Apr 2004 17:47:28 +0000 (17:47 +0000)]
bk_text and bk_info both need to know the on-screen width of
characters in order to wrap and align them properly. Therefore, they
should be using wcwidth(). So here are a couple of wrappers on
wcwidth(), one which filters out the Unicode characters not
representable in the target charset, and one which converts _from_ a
charset to Unicode before calling wcwidth(). bk_text and bk_info
should now align correctly even in the face of unsupported
characters and Japanese.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4116 cda61777-01e9-0310-a592-d414129be87e

20 years agoSupport the locale-supplied character set where appropriate. It's
simon [Thu, 22 Apr 2004 17:27:05 +0000 (17:27 +0000)]
Support the locale-supplied character set where appropriate. It's
used for converting command-line -C directives into Unicode; it's
used for outputting Unicode strings to stderr in error messages; and
it's used as the default character set for input files (although I'd
be inclined to recommend everyone use \cfg{input-charset} in all
their source files to ensure their portability).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4114 cda61777-01e9-0310-a592-d414129be87e

20 years agoCharset support for the man page backend (\cfg{man-charset}).
simon [Wed, 21 Apr 2004 18:37:12 +0000 (18:37 +0000)]
Charset support for the man page backend (\cfg{man-charset}).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4112 cda61777-01e9-0310-a592-d414129be87e

20 years agoCharset support for the info backend (\cfg{info-charset}). (This
simon [Wed, 21 Apr 2004 18:07:26 +0000 (18:07 +0000)]
Charset support for the info backend (\cfg{info-charset}). (This
checkin touches other files because a function in bk_text.c turned
out to be of more general use so I moved it out into ustring.c.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4111 cda61777-01e9-0310-a592-d414129be87e

20 years agoDon't forget to mention the default setting for \cfg{input-charset}.
simon [Tue, 20 Apr 2004 21:21:15 +0000 (21:21 +0000)]
Don't forget to mention the default setting for \cfg{input-charset}.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4106 cda61777-01e9-0310-a592-d414129be87e

20 years agoAcroread's PDF cut and paste appears to depend on the order in which
simon [Tue, 20 Apr 2004 19:24:29 +0000 (19:24 +0000)]
Acroread's PDF cut and paste appears to depend on the order in which
text fragments appear in the page graphics stream. Therefore, I
should take care to display the leaders _before_ the page number in
each contents entry.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4105 cda61777-01e9-0310-a592-d414129be87e

20 years agoAdd some tests of Unicode in the PDF document outline.
simon [Tue, 20 Apr 2004 19:20:55 +0000 (19:20 +0000)]
Add some tests of Unicode in the PDF document outline.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4104 cda61777-01e9-0310-a592-d414129be87e

20 years agoAhem. Fix stupid string handling error in new command-line config
simon [Tue, 20 Apr 2004 19:09:46 +0000 (19:09 +0000)]
Ahem. Fix stupid string handling error in new command-line config
mechanism.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4103 cda61777-01e9-0310-a592-d414129be87e

20 years agoThe Windows Help backend now uses libcharset to the maximum extent
simon [Tue, 20 Apr 2004 19:06:10 +0000 (19:06 +0000)]
The Windows Help backend now uses libcharset to the maximum extent
it can. (Which isn't much, since I currently don't know how to
indicate that a help file is encoded in anything other than Win1252,
and so the only use I found for libcharset was to replace the
previous pathetic 8859-1 conversion so that extra things like the
trademark sign are supported.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4102 cda61777-01e9-0310-a592-d414129be87e

20 years agoPDF outline headings, it turns out, should be encoded using either
simon [Tue, 20 Apr 2004 18:54:36 +0000 (18:54 +0000)]
PDF outline headings, it turns out, should be encoded using either
PDFDocEncoding or UTF-16BE. (The PDF specification's index is
terribly bad; I looked under various obvious things such as
`character set' and `string literal' with no success, and I didn't
manage to find out what character set metadata string literals were
intended to be interpreted in until I discovered from another source
that the encoding was called PDFDocEncoding, and _then_ I was able
to look that up in the index. They should have been using Halibut! :-)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4101 cda61777-01e9-0310-a592-d414129be87e

20 years agoText backend is now charset-enabled: the entire text file is built
simon [Tue, 20 Apr 2004 18:27:33 +0000 (18:27 +0000)]
Text backend is now charset-enabled: the entire text file is built
from the ground up in Unicode, and a single charset conversion pass
is done over the data as it's output.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4100 cda61777-01e9-0310-a592-d414129be87e

20 years agoAdd some tests of input charset switching.
simon [Tue, 20 Apr 2004 18:26:55 +0000 (18:26 +0000)]
Add some tests of input charset switching.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4099 cda61777-01e9-0310-a592-d414129be87e

20 years agoForgot to add *.ps and *.pdf to the `make clean' list!
simon [Tue, 20 Apr 2004 17:52:01 +0000 (17:52 +0000)]
Forgot to add *.ps and *.pdf to the `make clean' list!

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4098 cda61777-01e9-0310-a592-d414129be87e

20 years agoInfrastructure changes for character set support. ustrtoa,
simon [Tue, 20 Apr 2004 17:50:41 +0000 (17:50 +0000)]
Infrastructure changes for character set support. ustrtoa,
ustrfroma, utoa_dup and ufroma_dup now take a charset parameter, and
also have a variety of subtly distinct forms. Also, when a \cfg
directive is seen in the input file, the precise octet strings for
each parameter are kept in their original form as well as being
translated into Unicode, so that when they represent filenames they
can be used verbatim.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4097 cda61777-01e9-0310-a592-d414129be87e

20 years agoSupport for \cfg{input-charset}. Input files can now be in ASCII,
simon [Mon, 19 Apr 2004 17:09:49 +0000 (17:09 +0000)]
Support for \cfg{input-charset}. Input files can now be in ASCII,
8859-*, UTF-8, or a variety of more fun encodings including various
multibyte ones.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4095 cda61777-01e9-0310-a592-d414129be87e

20 years agoBetter robustness when backends encounter a Unicode character not
simon [Mon, 19 Apr 2004 17:09:12 +0000 (17:09 +0000)]
Better robustness when backends encounter a Unicode character not
representable in the output character set.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4094 cda61777-01e9-0310-a592-d414129be87e

20 years agoLink libcharset into Halibut. (This involved faffing with
simon [Sat, 17 Apr 2004 11:44:49 +0000 (11:44 +0000)]
Link libcharset into Halibut. (This involved faffing with
CVSROOT/modules, so anyone with a checked-out copy of Halibut will
unfortunately need to do `cvs co' again.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4088 cda61777-01e9-0310-a592-d414129be87e

20 years agoInclude libcharset into both the Timber and Halibut checkouts.
simon [Sat, 17 Apr 2004 08:04:45 +0000 (08:04 +0000)]
Include libcharset into both the Timber and Halibut checkouts.
Unfortunately this means people will have to do `cvs co' again to
get this update, but that appears to be the price I pay for being
able to conveniently share a single source base in this way.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4086 cda61777-01e9-0310-a592-d414129be87e

20 years agoAdd a TODO entry.
simon [Fri, 16 Apr 2004 11:20:30 +0000 (11:20 +0000)]
Add a TODO entry.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4084 cda61777-01e9-0310-a592-d414129be87e

20 years agoCompacted PS and PDF output files by removing redundant reiterations
simon [Fri, 16 Apr 2004 10:56:31 +0000 (10:56 +0000)]
Compacted PS and PDF output files by removing redundant reiterations
of the same font and position designations. Reduced the size of the
Halibut manual PDF to less than half what it started out as, and the
PS one to more like a third of its original size.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4083 cda61777-01e9-0310-a592-d414129be87e

20 years agoStandardise on using double quotes in HTML attributes. It turns out
simon [Thu, 15 Apr 2004 18:25:17 +0000 (18:25 +0000)]
Standardise on using double quotes in HTML attributes. It turns out
that the GNOME help browser is perfectly happy with Halibut's HTML
_except_ that it doesn't approve of single quotes in places such as
<a href='here'>.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4082 cda61777-01e9-0310-a592-d414129be87e

20 years agoSupport the \W{...}\i\c{...} combination used in the NASM manual.
simon [Thu, 15 Apr 2004 14:21:10 +0000 (14:21 +0000)]
Support the \W{...}\i\c{...} combination used in the NASM manual.
Halibut is now capable of reading the old NASM manual with only
minor modifications, and probably doing a much better job of
formatting it than rdsrc.pl ever did. (Certainly much _faster_!)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4081 cda61777-01e9-0310-a592-d414129be87e

20 years agoPrevent a tight loop. Oops.
simon [Thu, 15 Apr 2004 14:12:37 +0000 (14:12 +0000)]
Prevent a tight loop. Oops.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4080 cda61777-01e9-0310-a592-d414129be87e

20 years agoPut the document's version IDs into comments in the PS and PDF
simon [Thu, 15 Apr 2004 08:50:04 +0000 (08:50 +0000)]
Put the document's version IDs into comments in the PS and PDF
output files.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4079 cda61777-01e9-0310-a592-d414129be87e

20 years agoAhem. If an indexable term appears in a section heading, the index
simon [Thu, 15 Apr 2004 08:37:39 +0000 (08:37 +0000)]
Ahem. If an indexable term appears in a section heading, the index
should not also point to a page in the contents! :-)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4078 cda61777-01e9-0310-a592-d414129be87e

20 years agoAdministrivia: update a TODO and a .cvsignore.
simon [Wed, 14 Apr 2004 22:34:55 +0000 (22:34 +0000)]
Administrivia: update a TODO and a .cvsignore.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4077 cda61777-01e9-0310-a592-d414129be87e

20 years agoAfter printing out the PDF manual and reading it through, here's a
simon [Wed, 14 Apr 2004 22:34:21 +0000 (22:34 +0000)]
After printing out the PDF manual and reading it through, here's a
collection of minor edits for clarity, and also quite a few intended
to keep down the length of lines in code paragraphs (because Courier
is not just a thoroughly ugly font but is also WAY TOO WIDE).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4076 cda61777-01e9-0310-a592-d414129be87e

20 years ago... oh, except that minimal documentation might be helpful.
simon [Wed, 14 Apr 2004 18:14:41 +0000 (18:14 +0000)]
... oh, except that minimal documentation might be helpful.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4075 cda61777-01e9-0310-a592-d414129be87e

20 years agoDisplay the page numbers on every page. Right. I think this is now
simon [Wed, 14 Apr 2004 18:04:24 +0000 (18:04 +0000)]
Display the page numbers on every page. Right. I think this is now
basically usable, and certainly it entirely includes the level of
functionality which was provided by our ancestor Perl script. So I
think I'll stop coding frantically and have a rest!

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4074 cda61777-01e9-0310-a592-d414129be87e

20 years agoAnd now the page numbers in the index are PDF cross-references too.
simon [Wed, 14 Apr 2004 17:48:37 +0000 (17:48 +0000)]
And now the page numbers in the index are PDF cross-references too.
Funny, I thought that would be as hard again as the main index
processing, and it turned out to be nearly trivial.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4073 cda61777-01e9-0310-a592-d414129be87e

20 years agoImplemented an index. Good _grief_, that was hard work to get all
simon [Wed, 14 Apr 2004 17:33:15 +0000 (17:33 +0000)]
Implemented an index. Good _grief_, that was hard work to get all
the fine details right.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4072 cda61777-01e9-0310-a592-d414129be87e

20 years agoTypo during restructuring caused all code paragraphs to be
simon [Wed, 14 Apr 2004 13:24:39 +0000 (13:24 +0000)]
Typo during restructuring caused all code paragraphs to be
permanently bold. Fixed.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4071 cda61777-01e9-0310-a592-d414129be87e

20 years agoThe contents section now contains PDF cross-references.
simon [Wed, 14 Apr 2004 13:23:06 +0000 (13:23 +0000)]
The contents section now contains PDF cross-references.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4070 cda61777-01e9-0310-a592-d414129be87e

20 years agoSupport for a contents section.
simon [Wed, 14 Apr 2004 13:14:12 +0000 (13:14 +0000)]
Support for a contents section.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4069 cda61777-01e9-0310-a592-d414129be87e