aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* Change the mansearch() interface to use the mlinks table in the databaseIngo Schwarze2013-12-274-15/+66
| | | | | | and return a list of names with sections, used by apropos(1) for display. While here, improve uniformity of the interface by allocating the file name dynamically, just like the names list and the description.
* Save the MLINK name into the database, too;Ingo Schwarze2013-12-271-3/+5
| | | | apropos(1) will need it to display its results.
* Write more than one mlink per mpage to the database.Ingo Schwarze2013-12-271-8/+11
| | | | Not yet used by apropos(1).
* Allow saving more than one mlink per mpage in the mlinks ohash.Ingo Schwarze2013-12-271-24/+1
| | | | | | We are still only using one of them for now. Actually, we are now using a different one, but the order the mlinks are found is random anyway.
* Enable the framework code to allow more than one mlink per mpage.Ingo Schwarze2013-12-271-3/+4
| | | | Not used yet.
* Clean up the interface of mlink_add().Ingo Schwarze2013-12-271-70/+67
| | | | | Consistently use "fsec" and "fform" for info derived from the file name. No functional change.
* Another step on the way to clear naming, this time regarding mlinks:Ingo Schwarze2013-12-271-77/+37
| | | | | | | | * rename global ohash filenames to mlinks * rename ofadd() to mlink_add() * fold fileadd() and inoadd() into mlink_add() * fold filecheck() into mpages_merge() Still no functional change.
* Split struct mlink out of struct mpage.Ingo Schwarze2013-12-271-83/+124
| | | | Still a 1:1 relation, no functional change yet.
* Add an additional mlinks table to the database, redundant for now,Ingo Schwarze2013-12-272-25/+56
| | | | | | both because it contains nothing but a subset of the data of the existing mpages table and because the relationship of mpage and mlink entries is still 1:1. But all that will eventually change.
* Drop the mpages_list, use the existing mpages ohash for iteration.Ingo Schwarze2013-12-261-24/+28
| | | | | No functional change except that the order of database entries changes, which doesn't matter anyway.
* The name "id" is terrible for a struct.Ingo Schwarze2013-12-261-15/+15
| | | | | Make this more searchable by calling it "inodev". No functional change.
* To better support MLINKS, we will have to split the "docs" databaseIngo Schwarze2013-12-261-179/+184
| | | | | | | | table into two tables, on for actual files on disk, one for (often multiple) directory entries pointing to them. That implies splitting struct of into two structs, to be called "mpage" and "mlink", respectively. As a preparation, globally rename "of" and "inos" to "mpage". No functional change.
* Stop parsing man(7) input when we found all we were searching for,Ingo Schwarze2013-12-261-2/+5
| | | | such that we don't trigger an assertion on a duplicate NAME section.
* Rework the documentation of Spaces, using the Ossanna/Kernighan/RitterIngo Schwarze2013-12-261-22/+22
| | | | | | | | | | | | | | | | Heirloom Nroff/Troff User's Manual at the authoritative reference. Part of our text was outright wrong. Also, refrain from advertising the paddable non-breaking space `\~' in the DESCRIPTION, for three reasons: For nroff mode, -Tascii, and fixed width fonts in general, it makes no difference, so keep the discussion simple. Compared to `\ ', '\~' is of questionable portability. And if you want to keep words together, it is also more usual that you don't want padding to intervene either. Finally, drop the `\c' escape sequence (interrupt text processing) which is not a special character but an input processing instruction akin to the \<newline> escape sequence.
* merge from VERSION_1_12Ingo Schwarze2013-12-261-21/+29
|
* I have no idea how it happened that \B, \H, \h, \L, and \l gotIngo Schwarze2013-12-261-8/+6
| | | | | | | | | | | mapped to ESCAPE_NUMBERED (which is for \N and only for \N), that made no sense at all. Properly remap them to ESCAPE_IGNORE. While here, move \B and \w from the group taking number arguments to the group taking string arguments; right now, that doesn't imply any functional change, but if we ever go ahead and implement a parser for roff(7) numerical expressions, it will suddenly start to matter, and cause confusion.
* The roff language really has two groups of basic building blocks:Ingo Schwarze2013-12-261-9/+255
| | | | | | | Requests and escape sequences. Consequently, supplement the REQUEST REFERENCE by an ESCAPE SEQUENCE REFERENCE, such that people no longer need to guess or experiment what mandoc(1) implements, what it parses and ignores, and what it doesn't handle at all.
* Parse and ignore the roff(7) escape sequences \d (move half line down)Ingo Schwarze2013-12-251-1/+9
| | | | und \u (move half line up). Found by bentley@ in some DocBook crap.
* Implement .Fo/.Fa/.Fc indentation and break handling for -Tman.Ingo Schwarze2013-12-251-4/+9
|
* Oops, .Fa never breaks the output line in the middle of any of itsIngo Schwarze2013-12-251-3/+2
| | | | | | arguments, not even outside SYNOPSIS mode. Quite surprising as .Fn does break the line in the middle of its arguments outside SYNOPSIS mode, and only doesn't do that in SYNOPSIS mode. Wonders of groff...
* Garbage collect two local variables each used only one single time.Ingo Schwarze2013-12-251-7/+5
|
* In the SYNOPSIS, implement hanging indentation for .FoIngo Schwarze2013-12-252-16/+24
| | | | | | and avoid output line breaks inside .Fa arguments. This reduces groff-mandoc differences in OpenBSD base by more than 8%. Patch from Franco Fichtner <franco at lastsummer dot de> (DragonFly).
* Support .St -xsh4.2, the System Interfaces part of the original SingleIngo Schwarze2013-12-252-4/+7
| | | | | | | | UNIX Specification. As this one appears to be used in the wild and we already have -xpg4.2 and even -xsh5, it makes sense to add this one. Note that calling the original SUS XPG4.2 appears to be more common than calling it SUSv1, so it's ok that we don't have .St -susv1. From Sascha Wildner <saw at online dot de> (DragonFly) via Franco Fichtner.
* s/[Nn]ull/NUL/ in comments where appropriate;Ingo Schwarze2013-12-254-11/+12
| | | | suggested by Thomas Klausner <wiz @ NetBSD dot org>.
* Do not break output lines in .Fn function arguments in SYNOPSIS mode.Ingo Schwarze2013-12-254-5/+28
| | | | | Following an idea from Franco Fichtner, but implemented more cleanly. This reduces groff-mandoc-differences in OpenBSD base by a fantastic 7.5%.
* Delete the unused flag TERMP_IGNDELIMIngo Schwarze2013-12-243-25/+13
| | | | | and the empty callback termp_igndelim_pre(). Sort the remaining termp flags.
* Implement SYNOPSIS .Fn indentation for -Tman.Ingo Schwarze2013-12-241-2/+5
|
* It turns out SYNOPSIS mode does not imply .Bk in general,Ingo Schwarze2013-12-244-42/+31
| | | | | | but only within .Nm blocks. Simplify the code accordingly. Triggered by research done by Franco Fichtner.
* When deciding whether two consecutive macros are on the same input line,Ingo Schwarze2013-12-246-15/+22
| | | | | | | | we have to compare the line where the first one *ends* (not where it begins) to the line where the second one starts. This fixes the bug that .Bk allowed output line breaks right after block macros spanning more than one input line, even when the next macro follows on the same line.
* Implement a long-standing desideratum,Ingo Schwarze2013-12-232-5/+32
| | | | | | hanging indentation for .Fn in SYNOPSIS mode, exploiting the new trailspace feature by deliberately *NOT* using it.
* Polishing the worms in my favourite can, term_flushln().Ingo Schwarze2013-12-224-33/+53
| | | | | | | | | | | The TERMP_TWOSPACE flag i introduced in August 2009 was idiosyncratic and served only a very narrow purpose. Replace it by a more intuitive and more general termp attribute "trailspace", to be used together with TERMP_NOBREAK, to request a minimum amount of whitespace at the end of the current column. Adapt all code to the new interface. No functional change intended; code reviews to confirm that are welcome *eg*.
* Fix end-of-sentence spacing after the DragonFly text production macro.Ingo Schwarze2013-12-221-2/+2
| | | | Patch from Franco Fichtner <franco at lastsummer dot de>.
* Implement end-of-sentence spacing at the end of man(7) macro lines.Ingo Schwarze2013-12-221-1/+10
| | | | Patch from Franco Fichtner <franco at lastsummer dot de> (DragonFly).
* Document the alternative syntax \C'uXXXX' for Unicode characters.Ingo Schwarze2013-12-221-5/+5
| | | | Forgotten when committing mandoc.c rev. 1.70.
* In quoted macro arguments, double quotes can be quoted by doubling them.Ingo Schwarze2013-12-152-7/+14
| | | | | | | | | For a long time, we handle this in roff(7) and man(7) macros. Now add correct handling for the mdoc(7) case, too. Closely based on a patch by Tsugutomo dot ENAMI at jp dot sony dot com, see http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=48438 received via Thomas Klausner (wiz@), slightly tweaked by me.
* bentley@ looked at sbcl(1) and found new tasks for us...Ingo Schwarze2013-12-151-1/+10
|
* The "value" argument to the roff(7) .nr requests ends right beforeIngo Schwarze2013-12-154-16/+32
| | | | | | | | the first non-digit character. While here, implement and document an optional sign, requesting increment or decrement, as documented in the Ossanna/Kernighan/Ritter troff manual and supported by groff. Reported by bentley@ on discuss@.
* My audit of mandoc revealed one missing (unsigned char) castIngo Schwarze2013-11-211-2/+2
| | | | | in an isspace() argument containing arbitrary char data. Thanks to deraadt@ for triggering the audit.
* In the parser, when closing an explicit block that is not open,Ingo Schwarze2013-11-112-6/+10
| | | | | | | | close below-subsection implicit scopes that may still be open. In the formatter, make sure indentation is reset when leaving a scope, not only when entering the next one. Improves the formatting of gpg(1); issue reported by jca on ports.
* Ignore blank lines right after .SH and .SS.Ingo Schwarze2013-11-101-6/+12
| | | | Improves the rendering of gpg(1); issue reported by jca on ports.
* Support the alternative syntax \C'uXXXX' for Unicode characters.Ingo Schwarze2013-11-101-2/+5
| | | | | | | | | | It is already documented in the Heirloom troff manual, and groff handles it as well. Bug reported by Bjarni Ingi Gislason <bjarniig at rhi dot hi dot is> on <bug-groff at gnu dot org>. Well, admittedly, that bug was reported against groff, but mandoc was even more broken than groff with respect to this syntax...
* clarify that \[uXXXX] wants uppercase hex digitsIngo Schwarze2013-11-101-3/+8
|
* missing features: line length and italic correctionIngo Schwarze2013-11-101-1/+7
|
* While answering a question asked by espie@, i noticed that .Fd is notIngo Schwarze2013-11-021-9/+30
| | | | | completely obsolete, but still somewhat useful for listing preprocessor directives, in particular in the SYNOPSIS.
* The man(7) language has no syntax to specify architectures, but itIngo Schwarze2013-10-271-11/+12
| | | | | | | | | | can still be used to write architecture-specific manuals, of course. So just derive the architecture a man(7) manual belongs to from the directory where it is located and refrain from warning about each and every architecture-specific man(7) manual found. While here, delete some trailing whitespace in the neighbourhood.
* The code in ofmerge() only tried the source parsers if at least oneIngo Schwarze2013-10-271-2/+2
| | | | | | | | | | | | | | | | | | | of the path (/man1/ .. /man9/) or the file name suffix (*.1 .. *.9) indicated a source manual. That missed source manuals with unusual names in unusual locations. Instead, as the existing comment right above already suggests, try the source parsers unless both the path and the file name suffix unambiguously indicate a preformatted manual (/cat*/*.0). This change is not expensive in practice because no real-world system will have large numbers of preformatted pages outside /cat*/*.0. The only way to make information loss even less probable would be to try the source parsers on all files, even /cat*/*.0, which wouldn't buy us much because no real-world system will call source manuals /cat*/*.0, but it will be expensive in practice, because many real-world systems have large numbers of preformatted pages called /cat*/*.0.
* delete duplicate NULL check and polish style;Ingo Schwarze2013-10-271-6/+6
| | | | no functional change
* Parse and ignore .hw (hyphenation points in words); this is safe becauseIngo Schwarze2013-10-222-3/+8
| | | | | | we don't do hyphenation anyway, so there is no point in throwing an ERROR when encountering .hw. Real-world usage of the request found by naddy@ in sysutils/dwdiff(1).
* There are three kinds of input lines: text lines, macros takingIngo Schwarze2013-10-214-107/+175
| | | | | | | | | | | | | | | positional arguments (like Dt Fn Xr) and macros taking text as arguments (like Nd Sh Em %T An). In the past, even the latter put each word of their arguments into its own MDOC_TEXT node; instead, concatenate arguments unless delimiters, keeps or spacing mode prevent that. Regarding mandoc(1), this is internal refactoring, no output change intended. Regarding mandocdb(8), this fixes yet another regression introduced when switching from DB to SQLite: The ability to search for strings crossing word boundaries was lost and is hereby restored. At the same time, database sizes and build times are both reduced by a bit more than 5% each.
* Fix another regression introduced when switching from DB to SQLite:Ingo Schwarze2013-10-201-29/+72
| | | | The ~ operator has to do regular expression search, not globbing.