Re: Way for macro to know it's indentation in source?

Eric Blake <[email protected]> Mon, 8 May 2017 10:27:21 -0500
Newsgroups gmane.comp.gnu.m4.general
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 05/08/2017 10:00 AM, [email protected] wrote:
> Might there be a way for a macro to know the number of
> spaces to the left of itself on the line that the macro appears in the source?
> 
> --
> To preserve indentation , my work around is to pass in
> the number spaces that the macro output should be indented;
> would be nice to automate.

Sorry; there's the builtin __line__, but that's as fine as the
granularity gets for now. You'd have to patch m4 to add a new builtin
for tracking column position.  It sounds like your workaround is the
best you can do for now.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
signature.asc (application/pgp-signature, 604 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJZEI5ZAAoJEKeha0olJ0NqpuUH/jkvynxeWJNQqOR2TUiqRzUp
uYGuUm6dePR9hS/yMMGAPQ1iCXbum3sMfkDL2kPcbZpAZ1RTk7YQJcfQon2Cylqk
5oSR71seWaIp7kC+njJtco8fTYKyT9mlJQzLIwltvPr8mPpNpAcIS8hEUcneThIi
0Stdn+oRWIQDmo/kZ7aOtfmKkeb6Ea5Ph1Bt4PC20lDXv0QpgWxDojlCf6Y0/W5g
GdmsHztl7NDLZMMTwjN1ERWfeLrUDV/lVC+hjsgKIckMXCS2HH8tTHS95nKc507h
4qXdRpGWux91omxlxIph4bZIDSkqbKWRUkn6Sk/bmsLSOnsSGKq9kf6mW4MdJFA=
=+fnb
-----END PGP SIGNATURE-----