groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Allowing user also to check if a line starts with horizontal


From: Werner LEMBERG
Subject: Re: [Groff] Allowing user also to check if a line starts with horizontal space
Date: Sat, 14 Feb 2009 15:54:03 +0100 (CET)

> It should be enough to just check that the line (otherwise not
> empty) begins with at least one space.

I've implemented this now.  From groff.texinfo:


 -- Request: .lsm macro
 -- Register: \n[lsn]
 -- Register: \n[lss]
     Set a leading spaces trap.  `gtroff' executes MACRO when it
     encounters leading spaces in an input line; the implicit line break
     which normally happens in this case is suppressed.  A line
     consisting of spaces only, however, is treated as an empty line,
     possibly subject to an empty line macro set with the `blm' request.

     Leading spaces are removed from the input line before calling the
     leading spaces macro.  The number of removed spaces is stored in
     register `lsn'; the horizontal space which would be emitted if
     there was no leading space macro is stored in register `lss'.
     Note that `lsn' and `lss' are available even if no leading space
     macro has been set.


Enjoy!


    Werner




reply via email to

[Prev in Thread] Current Thread [Next in Thread]