m4-discuss
[Top][All Lists]
Advanced

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

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


From: Eric Blake
Subject: Re: Way for macro to know it's indentation in source?
Date: Mon, 8 May 2017 10:27:21 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/08/2017 10:00 AM, address@hidden 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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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