m4-patches
[Top][All Lists]
Advanced

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

Re: ifdef usage


From: Eric Blake
Subject: Re: ifdef usage
Date: Tue, 21 Apr 2009 21:59:15 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[please keep the list in the loop; swapping over to m4-patches since I'm
adding a patch]

According to Mehul Sanghvi on 4/21/2009 6:45 PM:
>>> Am I missing something or have I misunderstood what the manual says
>>> about how to use ifdef and -D ?
>> You misunderstood the portion about quoting characters.  Let us know if there
>> is any way to improve the manual to make it more obvious that they are
>> intentionally distinct strings.
>>
> 
> Gnu m4 manual
> 
> Section 3.2
> 
> A quoted string is a sequence of characters surrounded by quote
> strings, defaulting to ‘`’ (back tick without the double quotes) and
> ‘'’ (forward tick or single quote without the
> double quotes), ....

Notice how in your sentence above you used Unicode left quote and right
quote (‘,’), which have a nicer symmetry.  However, they aren't
traditional ascii characters, and m4 predates Unicode.  Hence, m4's
defaults use the same quoting as what you have seen in other manuals when
they are trying to use ascii ` and ' to resemble sane single quotes.
Technically, the sequence @samp{`} in texinfo should generate the sequence
‘`’ in output formats that support it, but on ascii terminals, it degrades
to ``' which is indeed less legible.  m4 really does use back-tick and
apostrophe, even though in modern fonts they are not very balanced-looking
compared to Unicode single quotes.  Also note that the changequote builtin
can be used to select real Unicode quotes, but that you still generally
want to avoid identical strings for open and close quotes.

> 
> The above might help improve the manual.  Or something to that effect
> which explicitly
> states that it is indeed a backward tick.  I've seen manuals where
> they've used a
> backward tick for the opening and forward tick for the closing, when
> the intention
> was that you were supposed to use single quotes on both ends.  I made that
> assumption for the m4 manual, hence my mis-interpretation of what was
> written.
> 
> Thank you for pointing it out.

Indeed, calling out the characters by the names that POSIX gives them
seems reasonable.
http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap06.html

I'm applying this:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknulhMACgkQ84KuGfSFAYDXtACeLbZ4gfRQ+EBMvcVwEaDlBm1v
15UAoL+XCcQoAAAn4HCnsBrd9t3zK4xS
=S8Zb
-----END PGP SIGNATURE-----
>From 1f6f9cd34d9b8b1bf369e4cb749145256d0f33d7 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 21 Apr 2009 21:55:57 -0600
Subject: [PATCH] Be more explicit about default quoting characters.

* doc/m4.texinfo (Quoted strings): Call out characters by name.
* THANKS: Update.
Suggested by Mehul Sanghvi.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog      |    7 +++++++
 THANKS         |    1 +
 doc/m4.texinfo |    4 +++-
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cc7b8f6..30a84d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-21  Eric Blake  <address@hidden>
+
+       Be more explicit about default quoting characters.
+       * doc/m4.texinfo (Quoted strings): Call out characters by name.
+       * THANKS: Update.
+       Suggested by Mehul Sanghvi.
+
 2009-04-16  Eric Blake  <address@hidden>

        Drop support for dist-lzma.
diff --git a/THANKS b/THANKS
index 2b42fca..f451c39 100644
--- a/THANKS
+++ b/THANKS
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index e1b3a1b..c37bc9e 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -1124,7 +1124,9 @@ Quoted strings
 @cindex string, quoted
 A quoted string is a sequence of characters surrounded by quote
 strings, defaulting to
address@hidden and @samp{'}, where the nested begin and end quotes within the
address@hidden (grave-accent, also known as back-tick, with UCS value U0060)
+and @samp{'} (apostrophe, also known as single-quote, with UCS value
+U0027), where the nested begin and end quotes within the
 string are balanced.  The value of a string token is the text, with one
 level of quotes stripped off.  Thus

-- 
1.6.1.2


reply via email to

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