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

Re: moving from m4

On Mon, 24 May 1999, Xose Manoel Ramos wrote:

> Hi!
> Before trying `WML' I was using `m4' for my web pages. `m4' is
> usefull,  but it becomes very frustrating. Anyway, I had already
> written plenty of complex macros (recursive and looping), and I
> wanted to still use them.
> Under `WML', `m4'  works with quotes disabled. I can only agree with
> that choice (that was one of the reasons I gave up `m4'). The problem
> is I have plenty of commas (,) inside my macros, so I have to quote
> them.
> I thought about a `<m4>' tag to surround my macros, but somebody has
> already included it before me. (Probably because that was a good
> idea).
> I just make it more handy:
> --------------------------
> <define-container m4>
> m4_quotes
> {: [[s/&lquot;/`/]] [[s/&rquot;/'/]]
> %body 
> :}
> m4_noquotes
> </define-container>
> -------------------------
> I added two entities for (`) and (') if I want to include them in a
> macro. There already exist: &#96; and &acute; but with such a name
> nobody will ever remember them.
> Anyway, I think it should be easier try to migrate my macros to
> Meta-HTML. 

Hi Xose,

in the next release, i took another way. With your method, the quotes
have to be escaped (i mean ``replaced'') in the body of the text. It's
not a problem for you, but it is for people with a minimal knowledge
of programming.

Please keep in mind that macros are written by developers whereas
webpages might be written by everyone.
The <m4> tag in wml::std::tag will be defined by

<define-container m4>
<preserve quotes>\
<set-var quotes="`,'">\
<set-var %attributes>\
m4_changequote(<get-var quotes>)m4_dnl
%body \
<restore quotes>

The <symbol> tag has been redefined to use this new ``quotes''

<define-tag symbol>
<m4 quotes="<`,'>">
<ifeq <get-var %1> undef
      <prog m4_undefine(<`%0'>)>
      <prog m4_define(<`%0'>,\

This is an example of what i expect : tricks are done in macro files,
not in the source of the web pages.

In your case, you could replace all occurences of quotes (` and ') by
<` and '> respectively, and define another macro
<define-container mym4>
<m4 quotes="<`,'>">

Few people use this m4 pass, so any feedback is really helpful.


Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com