]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
13 years agoWarn if equation `define' key is quoted (groff-ism).
Kristaps Dzonsons [Sun, 17 Jul 2011 12:52:54 +0000 (12:52 +0000)]
Warn if equation `define' key is quoted (groff-ism).

13 years agoAdd initial `define' support for eqn(7).
Kristaps Dzonsons [Sun, 17 Jul 2011 12:13:37 +0000 (12:13 +0000)]
Add initial `define' support for eqn(7).
This works by iterating over a simple list.  It's a slow, auditable
early implementation.  Data is read (the reading function will be
reused) then parsed, then the line re-run if remaining stuff exists.
Note this function isn't the same as mandoc_getarg(), as eqn(7) uses a
different system for reading quoted strings.
This doesn't actually use the defines.

13 years agoRemove prototype since moved into mandoc.h.
Kristaps Dzonsons [Sun, 17 Jul 2011 11:14:53 +0000 (11:14 +0000)]
Remove prototype since moved into mandoc.h.

13 years agoimprove documentation of .Bl -column .It Ta
Ingo Schwarze [Fri, 15 Jul 2011 20:40:32 +0000 (20:40 +0000)]
improve documentation of .Bl -column .It Ta
using feedback from kristaps@, ok jmc@

13 years agoBig step forward in bringing mandocdb in line with most makewhatis-type
Kristaps Dzonsons [Fri, 15 Jul 2011 17:59:29 +0000 (17:59 +0000)]
Big step forward in bringing mandocdb in line with most makewhatis-type
systems.

13 years agoFirst step of making mandocdb a true makewhatis/mandb replacement:
Kristaps Dzonsons [Fri, 15 Jul 2011 10:15:24 +0000 (10:15 +0000)]
First step of making mandocdb a true makewhatis/mandb replacement:
accept a set of directories on the command line ("manpaths") that are
recursed for files.  The databases are created in each manpath root.
This temporarily removes OP_UPDATE and OP_DELETE functionality, which
will be added back in.

13 years agoExpose mandoc_strdup() to the outside world.
Kristaps Dzonsons [Fri, 15 Jul 2011 10:14:12 +0000 (10:14 +0000)]
Expose mandoc_strdup() to the outside world.

13 years agoMove parts of mandocdb that "do stuff" to the databases into their own
Kristaps Dzonsons [Fri, 15 Jul 2011 09:06:23 +0000 (09:06 +0000)]
Move parts of mandocdb that "do stuff" to the databases into their own
functions.  This will make it easier to call repeatedly (for different
directoreis) as must be done with the new interfaces being developed.

13 years agoApparently these weren't removed properly...
Kristaps Dzonsons [Thu, 14 Jul 2011 17:32:53 +0000 (17:32 +0000)]
Apparently these weren't removed properly...

13 years agomove mandocdb(1) to mandocdb(8)
Ingo Schwarze [Thu, 14 Jul 2011 14:36:37 +0000 (14:36 +0000)]
move mandocdb(1) to mandocdb(8)
"please make this change" kristaps@

13 years agoRename makewhatis [back] into mandocdb. This is to maintain consistency
Kristaps Dzonsons [Thu, 14 Jul 2011 10:57:02 +0000 (10:57 +0000)]
Rename makewhatis [back] into mandocdb.  This is to maintain consistency
with OpenBSD, which is sandboxing the code for merge.  It makes sense
because it doesn't really make a `makewhatis' file in the traditional
sense, so it may be confusing.

13 years agoHave equation be allocated with mparse. Will be needed for logging of
Kristaps Dzonsons [Tue, 12 Jul 2011 21:32:43 +0000 (21:32 +0000)]
Have equation be allocated with mparse.  Will be needed for logging of
messages.

13 years agoRe-ordered logic in makewhatis to iterate over the index file only once.
Kristaps Dzonsons [Tue, 12 Jul 2011 15:26:35 +0000 (15:26 +0000)]
Re-ordered logic in makewhatis to iterate over the index file only once.
This is much more efficient.

13 years agoSmall HTML compatibility fix. VERSION_1_11_4
Kristaps Dzonsons [Tue, 12 Jul 2011 10:04:36 +0000 (10:04 +0000)]
Small HTML compatibility fix.

13 years agoFixed some uninitialised values found during lint check.
Kristaps Dzonsons [Tue, 12 Jul 2011 10:03:02 +0000 (10:03 +0000)]
Fixed some uninitialised values found during lint check.

13 years agoNote version 1.11.4 bits. Here we go!
Kristaps Dzonsons [Tue, 12 Jul 2011 08:27:45 +0000 (08:27 +0000)]
Note version 1.11.4 bits.  Here we go!

13 years agoFairly straightforward patch adding basic update (-u) and remove (-r)
Kristaps Dzonsons [Mon, 11 Jul 2011 21:56:06 +0000 (21:56 +0000)]
Fairly straightforward patch adding basic update (-u) and remove (-r)
functionality to makewhatis.  This is somewhat expensive (requiring the
index file to be trawled multiple times), but it's a good start.

13 years agoUse mandoc.1's error codes (we use them internally).
Kristaps Dzonsons [Mon, 11 Jul 2011 09:44:07 +0000 (09:44 +0000)]
Use mandoc.1's error codes (we use them internally).

13 years agoNote we're no longer using temporary files.
Kristaps Dzonsons [Mon, 11 Jul 2011 09:40:49 +0000 (09:40 +0000)]
Note we're no longer using temporary files.

13 years agoDon't use a temporary buffer (unless people yell to have it back in),
Kristaps Dzonsons [Mon, 11 Jul 2011 09:36:15 +0000 (09:36 +0000)]
Don't use a temporary buffer (unless people yell to have it back in),
and clean up the parse process a bit.  No big changes.

13 years agoBe more specific about `Dv', `Er', and `Ev'.
Kristaps Dzonsons [Mon, 11 Jul 2011 08:45:02 +0000 (08:45 +0000)]
Be more specific about `Dv', `Er', and `Ev'.

13 years agoMake sure constants in mandoc.3 use the `Dv' macro.
Kristaps Dzonsons [Mon, 11 Jul 2011 08:43:27 +0000 (08:43 +0000)]
Make sure constants in mandoc.3 use the `Dv' macro.

13 years agoHave descriptions for -man documents in makewhatis be properly collected.
Kristaps Dzonsons [Sun, 10 Jul 2011 13:03:31 +0000 (13:03 +0000)]
Have descriptions for -man documents in makewhatis be properly collected.

13 years agoSpaces must be preserved in -T[x]html literal mode.
Kristaps Dzonsons [Sat, 9 Jul 2011 10:26:57 +0000 (10:26 +0000)]
Spaces must be preserved in -T[x]html literal mode.

13 years agoClarify the role of `RS' in man(7) and also fix a bogus cross-reference.
Kristaps Dzonsons [Fri, 8 Jul 2011 09:35:06 +0000 (09:35 +0000)]
Clarify the role of `RS' in man(7) and also fix a bogus cross-reference.

13 years agoMake sure that `br' and `sp' don't emit space before the initial `SH' in
Kristaps Dzonsons [Fri, 8 Jul 2011 09:34:06 +0000 (09:34 +0000)]
Make sure that `br' and `sp' don't emit space before the initial `SH' in
-man.  This actually seems to be what groff does.  Sort-of.  Anyway,
it's required to get perlpod pages rendered nicely, so until perlpod
stops producing shit, do it.  Ok schwarze@.

13 years agoFix two issues: the first, where a `.\}' wasn't being interpreted as a
Kristaps Dzonsons [Fri, 8 Jul 2011 09:28:33 +0000 (09:28 +0000)]
Fix two issues: the first, where a `.\}' wasn't being interpreted as a
proper macro in some conditions, resulting in strange parse errors.  The
second, where `\}' was being re-written as `\&'.  Instead, we re-write
this as two spaces OR nothing at all, if at the end of line.  This isn't
exactly what groff does (who knows...) but is a much safer and better
way than how I was doing it before.

13 years agoFix handling of the `\c' escape in -T[x]html.
Kristaps Dzonsons [Thu, 7 Jul 2011 14:34:11 +0000 (14:34 +0000)]
Fix handling of the `\c' escape in -T[x]html.

13 years agoConsiderably fix up -man -T[x]html's handling of verbatim spaces (`nf'),
Kristaps Dzonsons [Thu, 7 Jul 2011 13:54:36 +0000 (13:54 +0000)]
Considerably fix up -man -T[x]html's handling of verbatim spaces (`nf'),
which before were being handled erratically.

13 years agoClean up how -man -T[x]html handles TP, IP, and HP (dd lists and
Kristaps Dzonsons [Thu, 7 Jul 2011 13:26:25 +0000 (13:26 +0000)]
Clean up how -man -T[x]html handles TP, IP, and HP (dd lists and
indented paragraph macros, respectively).  This cleans up code and also
cleans up the output quite a lot.

13 years agoSimplify chars.c---there's really no need for extra code to reorder the
Kristaps Dzonsons [Thu, 7 Jul 2011 06:41:50 +0000 (06:41 +0000)]
Simplify chars.c---there's really no need for extra code to reorder the
hash chain or an extra function for checking matches.

13 years agoNote the strange `if'+newline issue raised by schwarze@.
Kristaps Dzonsons [Thu, 7 Jul 2011 06:34:13 +0000 (06:34 +0000)]
Note the strange `if'+newline issue raised by schwarze@.

13 years agoFix a bug in the -man parser where deleting nodes (such as `PP' or `LP'
Kristaps Dzonsons [Thu, 7 Jul 2011 05:42:32 +0000 (05:42 +0000)]
Fix a bug in the -man parser where deleting nodes (such as `PP' or `LP'
in certain situations) caused the next macros to be assigned as siblings
instead of child nodes to the original parent.  Noticed and ok by
schwarze@.

13 years agoInstall sources with mode 0644. Noted by Jack Nagel. Ok schwarze@.
Kristaps Dzonsons [Mon, 4 Jul 2011 12:02:57 +0000 (12:02 +0000)]
Install sources with mode 0644.  Noted by Jack Nagel.  Ok schwarze@.

13 years agoThe bufcat() function in -T[x]html was eating one byte off the end of its
Kristaps Dzonsons [Mon, 4 Jul 2011 09:42:38 +0000 (09:42 +0000)]
The bufcat() function in -T[x]html was eating one byte off the end of its
concatenated string.  This for some reason hasn't been found before now... ?
Anyway, fixed, and make the IDs created again be correctly prefixed by a
letter as per the HTML spec.

13 years agoFix a TODO noted by schwarze@, originally by Christian Weisgerber:
Kristaps Dzonsons [Sun, 3 Jul 2011 22:57:32 +0000 (22:57 +0000)]
Fix a TODO noted by schwarze@, originally by Christian Weisgerber:
literal mode (`nf') is ended by SH (and, it turns out, SS as well).
Noted the updated behaviour in man.7 as well.

13 years agotwo new bugs reported by naddy@:
Ingo Schwarze [Sun, 3 Jul 2011 22:40:10 +0000 (22:40 +0000)]
two new bugs reported by naddy@:
 - .\} breaks
 - .SH implies .fi

13 years agoWe obviously need man.h and mdoc.h installed as mentioned in mandoc.3.
Kristaps Dzonsons [Sun, 3 Jul 2011 20:54:41 +0000 (20:54 +0000)]
We obviously need man.h and mdoc.h installed as mentioned in mandoc.3.

13 years agoAdded `Er' in ERRORS scan to makewhatis.
Kristaps Dzonsons [Fri, 1 Jul 2011 13:46:39 +0000 (13:46 +0000)]
Added `Er' in ERRORS scan to makewhatis.

13 years agoAdded search for `Ev' environment variables in ENVIRONMENT section.
Kristaps Dzonsons [Fri, 1 Jul 2011 12:02:44 +0000 (12:02 +0000)]
Added search for `Ev' environment variables in ENVIRONMENT section.

13 years agoAllow `Nd' scarfed data to allow for non-text nodes as the first node, as well.
Kristaps Dzonsons [Fri, 1 Jul 2011 10:46:32 +0000 (10:46 +0000)]
Allow `Nd' scarfed data to allow for non-text nodes as the first node, as well.

13 years agoAdd some notes to index.sgml. This does not signal a release.
Kristaps Dzonsons [Fri, 1 Jul 2011 10:20:26 +0000 (10:20 +0000)]
Add some notes to index.sgml.  This does not signal a release.

13 years agoMake scan for text tokens in a line recursive. This is really only for
Kristaps Dzonsons [Fri, 1 Jul 2011 10:17:24 +0000 (10:17 +0000)]
Make scan for text tokens in a line recursive.  This is really only for
the benefit of `Nd', which is the only [to date] node that can consist
of sub-nodes.

13 years agoAdd path reference (`Pa' in FILES section).
Kristaps Dzonsons [Fri, 1 Jul 2011 09:11:35 +0000 (09:11 +0000)]
Add path reference (`Pa' in FILES section).

13 years agoOuch: predefined strings moved into roff.c weren't being reinitalised
Kristaps Dzonsons [Thu, 30 Jun 2011 08:05:13 +0000 (08:05 +0000)]
Ouch: predefined strings moved into roff.c weren't being reinitalised
after the first parse.  Do this, but note there are more efficient ways
just waiting for a table of macros.

13 years agoFirst fix how `sp 1' doesn't imply `1v' (it now does) and that 1
Kristaps Dzonsons [Wed, 29 Jun 2011 15:38:09 +0000 (15:38 +0000)]
First fix how `sp 1' doesn't imply `1v' (it now does) and that 1
followed by non-digits, e.g. `1g', really means `1'.  Next, fix some
spacing issues where `sp' was invoked in -man after sections or
subsections.  Make sure this behaviour is mirrored in -Thtml.

13 years agoAdd cross-reference records to makewhatis.
Kristaps Dzonsons [Sat, 25 Jun 2011 13:19:25 +0000 (13:19 +0000)]
Add cross-reference records to makewhatis.

13 years agoAdd more documentation for libmandoc.
Kristaps Dzonsons [Wed, 22 Jun 2011 22:10:02 +0000 (22:10 +0000)]
Add more documentation for libmandoc.

13 years agoClean up makewhatis.c a little bit and add verbosity (-v).
Kristaps Dzonsons [Wed, 22 Jun 2011 10:36:36 +0000 (10:36 +0000)]
Clean up makewhatis.c a little bit and add verbosity (-v).

13 years agoMake sure hash is initialised to NULL and remove an unused variable.
Kristaps Dzonsons [Wed, 22 Jun 2011 09:10:36 +0000 (09:10 +0000)]
Make sure hash is initialised to NULL and remove an unused variable.

13 years agoTry again to get the transfer from hash to btree working. This time
Kristaps Dzonsons [Wed, 22 Jun 2011 09:00:14 +0000 (09:00 +0000)]
Try again to get the transfer from hash to btree working.  This time
just closing and re-opening the database, as deleting records with
(*hash->del) either in the scan loop or after it causes uncertain
behaviour (left-over keys, mystery keys, etc.).  This finally does the
Right Thing (tm).

13 years agoFix broken transfer from hashtable to btree for makewhatis.c.
Kristaps Dzonsons [Tue, 21 Jun 2011 23:37:27 +0000 (23:37 +0000)]
Fix broken transfer from hashtable to btree for makewhatis.c.

13 years agoNote mandoc-cgi -> mandoc-tools.
Kristaps Dzonsons [Tue, 21 Jun 2011 14:51:54 +0000 (14:51 +0000)]
Note mandoc-cgi -> mandoc-tools.

13 years agoLet descriptions (bit-mask 0x100) also be mined for text. This doubles
Kristaps Dzonsons [Tue, 21 Jun 2011 14:16:05 +0000 (14:16 +0000)]
Let descriptions (bit-mask 0x100) also be mined for text.  This doubles
the database size (one record for each file), but it's critical
information.

13 years agoHave descriptions also use struct buf. This completes the internal
Kristaps Dzonsons [Tue, 21 Jun 2011 13:54:05 +0000 (13:54 +0000)]
Have descriptions also use struct buf.   This completes the internal
migration to in-memory hashing and passing buffers instead of DBTs.

13 years agoDon't let empty strings into the makewhatis keyword database.
Kristaps Dzonsons [Tue, 21 Jun 2011 13:13:15 +0000 (13:13 +0000)]
Don't let empty strings into the makewhatis keyword database.

13 years agoMake sure makewhatis.1 is documenting the correct bit-fields.
Kristaps Dzonsons [Tue, 21 Jun 2011 13:09:19 +0000 (13:09 +0000)]
Make sure makewhatis.1 is documenting the correct bit-fields.

13 years agoBig change to makewhatis: use an in-memory hashtable to collapse
Kristaps Dzonsons [Tue, 21 Jun 2011 13:05:14 +0000 (13:05 +0000)]
Big change to makewhatis: use an in-memory hashtable to collapse
multiple types of the same name (e.g., "foo" being a manual name,
utility name, etc.) into a single bitmask'd region.  This considerably
reduces the size of the keyword database.

13 years agoMake -T[x]html in -man also be aware of the vertical-space issues in the
Kristaps Dzonsons [Sat, 18 Jun 2011 20:34:08 +0000 (20:34 +0000)]
Make -T[x]html in -man also be aware of the vertical-space issues in the
last few commits.

13 years agoFix two TODOs with one check-in. Both of these relate to vertical space
Kristaps Dzonsons [Sat, 18 Jun 2011 17:58:48 +0000 (17:58 +0000)]
Fix two TODOs with one check-in.  Both of these relate to vertical space
before paragraphs and/or within `RS' blocks.

13 years agoAllow RS/RE blocks to nest. This requires first the syntax tree to
Kristaps Dzonsons [Sat, 18 Jun 2011 17:36:52 +0000 (17:36 +0000)]
Allow RS/RE blocks to nest.  This requires first the syntax tree to
accomodate for the fix, then for the front-ends.  -T[x]html accepted the
syntax tree natively, but -Tascii had to use relative offsets.  It's
quite a simple fix.

From a TODO by {dcoppa,dsoares}@openbsd.

13 years agoAdd back in a check that the leading `-' exists for arguments. This
Kristaps Dzonsons [Sat, 18 Jun 2011 16:53:27 +0000 (16:53 +0000)]
Add back in a check that the leading `-' exists for arguments.  This
mysteriously disappeared in 1.14.  No idea why.  While here, remove an
unnecessary header and order the function prototypes.

13 years agoClean-up: remove a function only called once.
Kristaps Dzonsons [Sat, 18 Jun 2011 16:29:38 +0000 (16:29 +0000)]
Clean-up: remove a function only called once.

13 years agoFix an assertion failure raised by the following interesting scenario: a
Kristaps Dzonsons [Sat, 18 Jun 2011 16:18:04 +0000 (16:18 +0000)]
Fix an assertion failure raised by the following interesting scenario: a
auto-opened `It' (i.e., a column list with a free-text first line) with
leading spaces in the line triggering assertion when searching for
arguments.

This led to a fix giving a nice performance speed-ups (a few percent,
with some quick trials): the search for flags immediately exits if the
macro has no flags, instead of having to first parse the leading word
then look it up.  I also cleaned up the argv parsing stuff a little bit
and added more documentation.

This comes from a TODO by joerg@.

13 years agoHave -T[x]html print out the link target for `Lk' if no link title is
Kristaps Dzonsons [Thu, 16 Jun 2011 22:21:28 +0000 (22:21 +0000)]
Have -T[x]html print out the link target for `Lk' if no link title is
provided.  From a patch by Tim van der Molen.

13 years agoAdd note about crash on invalid found in the NetBSD tree
Joerg Sonnenberger [Sun, 12 Jun 2011 12:13:27 +0000 (12:13 +0000)]
Add note about crash on invalid found in the NetBSD tree

13 years ago.Nm in-line/block issues reported by uqs@
Ingo Schwarze [Sat, 11 Jun 2011 15:41:35 +0000 (15:41 +0000)]
.Nm in-line/block issues reported by uqs@

13 years agoFix some bad bits in the mandoc manual: `Xr' instead of `Sx', unescaped
Kristaps Dzonsons [Mon, 30 May 2011 07:24:15 +0000 (07:24 +0000)]
Fix some bad bits in the mandoc manual: `Xr' instead of `Sx', unescaped
stuff that should be escaped, and a style matter or two.  Pointed out by
Jason McIntyre, thanks!

13 years agoRemove untrue CAVEAT in makewhatis.1.
Kristaps Dzonsons [Thu, 26 May 2011 23:01:26 +0000 (23:01 +0000)]
Remove untrue CAVEAT in makewhatis.1.

13 years agoVersion 1.11.3. Here we go! VERSION_1_11_3
Kristaps Dzonsons [Thu, 26 May 2011 21:23:50 +0000 (21:23 +0000)]
Version 1.11.3.  Here we go!

13 years agoSome small lint checks in preconv. Also add it to the default lint rule.
Kristaps Dzonsons [Thu, 26 May 2011 21:13:07 +0000 (21:13 +0000)]
Some small lint checks in preconv.  Also add it to the default lint rule.

13 years agoOpenBSD needs sys/types for mmap... oops...
Kristaps Dzonsons [Thu, 26 May 2011 21:02:05 +0000 (21:02 +0000)]
OpenBSD needs sys/types for mmap... oops...

13 years agoAt least in theory, this patch lets us compile on Windows (which does
Kristaps Dzonsons [Thu, 26 May 2011 20:36:21 +0000 (20:36 +0000)]
At least in theory, this patch lets us compile on Windows (which does
not have mmap(), from what I can tell).

13 years agoMore updates to www. A version's on its way...
Kristaps Dzonsons [Thu, 26 May 2011 20:23:01 +0000 (20:23 +0000)]
More updates to www.  A version's on its way...

13 years agoHave preconv install with mandoc.
Kristaps Dzonsons [Thu, 26 May 2011 20:22:42 +0000 (20:22 +0000)]
Have preconv install with mandoc.

13 years agoSlightly clean up verbiage in coding tags.
Kristaps Dzonsons [Thu, 26 May 2011 14:45:04 +0000 (14:45 +0000)]
Slightly clean up verbiage in coding tags.

13 years agopreconv is now on encoding-recognition parity with groff. This last
Kristaps Dzonsons [Thu, 26 May 2011 14:43:07 +0000 (14:43 +0000)]
preconv is now on encoding-recognition parity with groff.  This last
commit adds parsing of "File Variables" in the first two lines in order
to grok the encoding.  This completes groff's recognition sequence (-e,
BOM, File variables, -D, default).  I've also cleaned up the manual to
indicate this and for some general readability.

preconv is now compiled by default in the Makefile.

13 years agoThe \*q predef certainly doesn't map to \"! Fix this.
Kristaps Dzonsons [Thu, 26 May 2011 14:30:28 +0000 (14:30 +0000)]
The \*q predef certainly doesn't map to \"!  Fix this.

13 years agoAdd notes about preconv.1 in the www and change some wording in the
Kristaps Dzonsons [Thu, 26 May 2011 12:14:46 +0000 (12:14 +0000)]
Add notes about preconv.1 in the www and change some wording in the
manual regarding its output and `Nd' sentence.

13 years agoSignificantly improve preconv. Allow it to recode UTF-8 characters into
Kristaps Dzonsons [Thu, 26 May 2011 12:01:14 +0000 (12:01 +0000)]
Significantly improve preconv.  Allow it to recode UTF-8 characters into
the \[uNNNN] strings (taking into account big-endian archs).  Also allow
it to determine from the BOM whether it's a UTF-8 file.  Also add the
initial manual.  This has been tested over a random selection of UTF-8
documents, as

 % preconv -e utf-8 foo.1 | ./mandoc -Tlocale

where -Tlocale is allowed (-DUSE_WCHAR).

Note that we're still missing the "type" indicator that preconv accepts.

13 years agoIf a predefined string is missing, emit a warning and make it an empty
Kristaps Dzonsons [Thu, 26 May 2011 11:58:25 +0000 (11:58 +0000)]
If a predefined string is missing, emit a warning and make it an empty
string instead of passing it along to libmdoc/libman (where it'll be
printed verbatim, now).  This is what groff seems to do, too (of course
without a warning).

13 years agoNoticed that our skeleton mdoc.7 had lower-case `Dt'. Fixed and added
Kristaps Dzonsons [Thu, 26 May 2011 09:26:16 +0000 (09:26 +0000)]
Noticed that our skeleton mdoc.7 had lower-case `Dt'.  Fixed and added
some language for clarity.

13 years agoIt's annoying that we don't have preconv, so throw together a quick
Kristaps Dzonsons [Thu, 26 May 2011 00:30:11 +0000 (00:30 +0000)]
It's annoying that we don't have preconv, so throw together a quick
version and let it grow in-tree.  Right now, this only supports the
Latin-1 and US-ASCII encoding.  I'll do UTF-8 next.  It's
call-compatible with GNU's preconv although I don't do fancy stuff like
BOM or header check.  This will come.  I used read.c's file-grokking
code.

13 years agoDocument that spec2cp never returns 0.
Kristaps Dzonsons [Tue, 24 May 2011 21:41:11 +0000 (21:41 +0000)]
Document that spec2cp never returns 0.

13 years agoUse the correct Unicode value for the zero-width space, which means that
Kristaps Dzonsons [Tue, 24 May 2011 21:40:14 +0000 (21:40 +0000)]
Use the correct Unicode value for the zero-width space, which means that
spec2cp never needs to fall through to spec2str.  Then clean out html.c
of its unnecessary print_res() function.

13 years agoRemove all references to ESCAPE_PREDEF, which is now not exposed passed
Kristaps Dzonsons [Tue, 24 May 2011 21:31:23 +0000 (21:31 +0000)]
Remove all references to ESCAPE_PREDEF, which is now not exposed passed
the libroff point.  This clears up a nice chunk of code.

13 years agoRemove predefined strings from the chars.in file, as they're now local
Kristaps Dzonsons [Tue, 24 May 2011 21:24:16 +0000 (21:24 +0000)]
Remove predefined strings from the chars.in file, as they're now local
to predefs.in.  This also makes "BOTH" entries directly into CHAR.  The
res2str and spec2str are now effectively the same function.

13 years agoMost important move in getting predefined strings entirely contained
Kristaps Dzonsons [Tue, 24 May 2011 21:18:06 +0000 (21:18 +0000)]
Most important move in getting predefined strings entirely contained
within roff.c.  These are now grokked from a table in the roff
allocation routine and rest in the newly-created predefs.in (for
consistency with chars.in).  This is a first implementation and will
likely be optimised along with the ds/de lookup table itself.

This allows mandoc-defined predefined strings to be correctly removed or
whatnot; earlier they couldn't.  What will follow is the stripping-away
of all predefined-string crud in the other parts of the system.

13 years agoHave conditional closure for both text and macro lines call through to
Kristaps Dzonsons [Tue, 24 May 2011 15:22:14 +0000 (15:22 +0000)]
Have conditional closure for both text and macro lines call through to
ccond().  Fix the text handler to behave like the macro handler
regarding escaped \}.  Make \} actually become a zero-width space, too,
and clean up the documentation in this regard.

13 years agoFix a TODO to the effect that `.if n \{\ foo .br \}' was failing due to
Kristaps Dzonsons [Tue, 24 May 2011 14:00:39 +0000 (14:00 +0000)]
Fix a TODO to the effect that `.if n \{\ foo .br \}' was failing due to
the `\}' not being directly after the `.br'.  Now we check for `\}' in
arbitrary parts of the line, and account for if it's escaped in funny
ways.

This behaviour diverges somewhat from groff in that the text at and
following the `\}' is lost, while groff keeps it (sort-of).  I'll add a
COMPATIBILITY note to this effect.

13 years agonested .RS/.RE is becoming more important
Ingo Schwarze [Sat, 21 May 2011 21:38:17 +0000 (21:38 +0000)]
nested .RS/.RE is becoming more important

13 years agoremove a sentence which isn;t true;
Ingo Schwarze [Sat, 21 May 2011 15:55:42 +0000 (15:55 +0000)]
remove a sentence which isn;t true;
from jmc@

13 years agoTurn on -Tutf8 in the frontend. Here we go!
Kristaps Dzonsons [Fri, 20 May 2011 15:51:18 +0000 (15:51 +0000)]
Turn on -Tutf8 in the frontend.  Here we go!

13 years agoFlip on -Tutf8 backend support. This forces the UTF-8 LC_CTYPE and does
Kristaps Dzonsons [Fri, 20 May 2011 15:48:22 +0000 (15:48 +0000)]
Flip on -Tutf8 backend support.  This forces the UTF-8 LC_CTYPE and does
little else.  Also remove the check for __STDC_ISO_10646__.  It turns
out that very few systems---even those that support it---actually
declare this and it's just causing problems instead of being useful.

13 years agoAllow non-ASCII terminal encodings to accept unicode values for the
Kristaps Dzonsons [Fri, 20 May 2011 15:44:55 +0000 (15:44 +0000)]
Allow non-ASCII terminal encodings to accept unicode values for the
special characters, if possible.  This is broken into a separate switch
statement for clarity.

13 years agoSome release notes (this isn't signalling an impending release; I just
Kristaps Dzonsons [Thu, 19 May 2011 16:02:01 +0000 (16:02 +0000)]
Some release notes (this isn't signalling an impending release; I just
want to get some notes in).

13 years agoIt seems that __STDC_ISO_10646__ isn't defined even where it can be
Kristaps Dzonsons [Thu, 19 May 2011 15:48:58 +0000 (15:48 +0000)]
It seems that __STDC_ISO_10646__ isn't defined even where it can be
defined, so remove the check for it and leave it up to people compiling
the software (DOWNSTREAM) to take care of this.  This will eventually
need to be fixed up with a proper non-10646 converter and so on, but
this is a simple start.  While here, strengthen then language in the
Makefile to this effect.

13 years agoMake any un-recognised font be considered a call for the Roman font.
Kristaps Dzonsons [Wed, 18 May 2011 23:59:08 +0000 (23:59 +0000)]
Make any un-recognised font be considered a call for the Roman font.
This makes sequences of \f[unknown] \fP not completely puke.  From a
TODO by schwarze@.

13 years agoAdd TODO entry for standalone `.' in tbl pages (pointed out by Yuri
Kristaps Dzonsons [Wed, 18 May 2011 09:45:21 +0000 (09:45 +0000)]
Add TODO entry for standalone `.' in tbl pages (pointed out by Yuri
Pankov).  Also fix typo in Makefile, same reporter.  Thanks!

13 years agoLocale support. I'm checking this in to clean up fall-out in-tree, but
Kristaps Dzonsons [Tue, 17 May 2011 22:32:45 +0000 (22:32 +0000)]
Locale support.  I'm checking this in to clean up fall-out in-tree, but
it looks pretty good.  Basically, the -Tlocale option propogates into
term_ascii.c, where we set locale-specific console call-backs IFF (1)
setlocale() works; (2) locale support is compiled in (see Makefile for
-DUSE_WCHAR); (3) the internal structure of wchar_t maps directly to
Unicode codepoints as defined by __STDC_ISO_10646__; and (4) the console
supports multi-byte characters.

To date, this configuration only supports GNU/Linux.  OpenBSD doesn't
export __STDC_ISO_10646__ although I'm told by stsp@openbsd.org that it
should (it has the correct map).  Apparently FreeBSD is the same way.
NetBSD?  Don't know.  Apple also supports this, but doesn't define the
macro.  Special-casing!

Benchmark: -Tlocale incurs less than 0.2 factor overhead when run
through several thousand manuals when UTF8 output is enabled.  Native
mode (whether directly -Tascii or through no locale or whatever) is
UNCHANGED: the function callbacks are the same as before.

Note.  If the underlying system does NOT support STDC_ISO_10646, there
is a "slow" version possible with iconv or other means of flipping from
a Unicode codepoint to a wchar_t.