[Top][All Lists]
[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
- [Groff] Allowing user also to check if a line starts with horizontal space, Dorai Sitaram, 2009/02/03
- Re: [Groff] Allowing user also to check if a line starts with horizontal space, Werner LEMBERG, 2009/02/03
- Re: [Groff] Allowing user also to check if a line starts with horizontal space, Dorai Sitaram, 2009/02/04
- Re: [Groff] Allowing user also to check if a line starts with horizontal space, Werner LEMBERG, 2009/02/10
- Re: [Groff] Allowing user also to check if a line starts with horizontal space, Dorai Sitaram, 2009/02/10
- Re: [Groff] Allowing user also to check if a line starts with horizontal space, Werner LEMBERG, 2009/02/10
- Re: [Groff] Allowing user also to check if a line starts with horizontal space,
Werner LEMBERG <=
- Re: [Groff] Allowing user also to check if a line starts with horizontal space, Dorai Sitaram, 2009/02/15
- Re: [Groff] Allowing user also to check if a line starts with horizontal space, Werner LEMBERG, 2009/02/15
- Re: [Groff] Allowing user also to check if a line starts with ho, Ted Harding, 2009/02/15