m4-commit
[Top][All Lists]
Advanced

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

[SCM] GNU M4 source repository branch, master, updated. cvs-readonly-144


From: Eric Blake
Subject: [SCM] GNU M4 source repository branch, master, updated. cvs-readonly-144-g02a5291
Date: Sat, 19 Jul 2008 15:03:20 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU M4 source repository".

http://git.sv.gnu.org/gitweb/?p=m4.git;a=commitdiff;h=02a5291b279c2523ef95f39c12bc07bcd9fdd177

The branch, master has been updated
       via  02a5291b279c2523ef95f39c12bc07bcd9fdd177 (commit)
      from  3f65aa84e013948949e674e3970b5569383e7455 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 02a5291b279c2523ef95f39c12bc07bcd9fdd177
Author: Eric Blake <address@hidden>
Date:   Fri Jul 18 09:43:22 2008 -0600

    Resynchronize docs from branch.
    
    * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
    name, particularly since the old documentation didn't match code.
    (Standard Modules): Add caveat about using __m4_version__.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    7 +++++
 doc/m4.texinfo |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 70 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e28fcc2..6c36cae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-19  Eric Blake  <address@hidden>
+
+       Resynchronize docs from branch.
+       * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
+       name, particularly since the old documentation didn't match code.
+       (Standard Modules): Add caveat about using __m4_version__.
+
 2008-07-11  Eric Blake  <address@hidden>
 
        Bump required automake to 1.10a; regression introduced 2008-01-22.
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 871679a..56bb940 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -2132,7 +2132,8 @@ A macro definition can be removed with @code{undefine}:
 
 @deffn {Builtin (m4)} undefine (@address@hidden)
 For each argument, remove the macro @var{name}.  The macro names must
-necessarily be quoted, since they will be expanded otherwise.
+necessarily be quoted, since they will be expanded otherwise.  If an
+argument is not a defined macro, a warning is issued.
 
 The expansion of @code{undefine} is void.
 The macro @code{undefine} is recognized only with parameters.
@@ -2167,8 +2168,32 @@ f(`bye')
 @result{}f(bye)
 @end example
 
-It is not an error for @var{name} to have no macro definition.  In that
-case, @code{undefine} does nothing.
+As of M4 1.6, @code{undefine} will warn if @var{name} is not a macro.
+The following example shows how to recover earlier behavior that
+silently ignores undefined names, using concepts that will be explained
+later in the manual.  Or, you could use the command line option
address@hidden (@option{--quiet}, @pxref{Operation modes, , Invoking m4}).
+
address@hidden
+define(`a', `1')
address@hidden
+undefine
address@hidden
+undefine(`a', `a')
address@hidden:stdin:3: Warning: undefine: undefined macro `a'
address@hidden
+define(`a', `1')
address@hidden
+pushdef(`undefine', `ifelse(`$#', `0', ``undefine'', `_$0($@@)')')
address@hidden
+define(`_undefine', `ifdef(`$1', `builtin(`undefine',
+  `$1')')ifelse(`$#', `1', `', `$0(shift($@@))')')
address@hidden
+undefine
address@hidden
+undefine(`a', `a')
address@hidden
address@hidden example
 
 @node Defn
 @section Renaming macros
@@ -2421,7 +2446,8 @@ exactly like @code{define}.
 
 If a macro has several definitions (of which only one is accessible),
 the topmost definition can be removed with @code{popdef}.  If there is
-no previous definition, @code{popdef} behaves like @code{undefine}.
+no previous definition, @code{popdef} behaves like @code{undefine}, and
+if there is no definition at all, @code{popdef} issues a warning.
 
 The expansion of both @code{pushdef} and @code{popdef} is void.
 The macros @code{pushdef} and @code{popdef} are recognized only with
@@ -2494,6 +2520,33 @@ revealing the former definition.
 It is possible to temporarily redefine a builtin with @code{pushdef}
 and @code{defn}.
 
+As of M4 1.6, @code{popdef} will warn if @var{name} is not a macro.
+The following example shows how to recover earlier behavior that
+silently ignores undefined names, using concepts that will be explained
+later in the manual.  Or, you could use the command line option
address@hidden (@option{--quiet}, @pxref{Operation modes, , Invoking m4}).
+
address@hidden
+define(`a', `1')
address@hidden
+popdef
address@hidden
+popdef(`a', `a')
address@hidden:stdin:3: Warning: popdef: undefined macro `a'
address@hidden
+define(`a', `1')
address@hidden
+pushdef(`popdef', `ifelse(`$#', `0', ``popdef'', `_$0($@@)')')
address@hidden
+define(`_popdef', `ifdef(`$1', `builtin(`popdef',
+  `$1')')ifelse(`$#', `1', `', `$0(shift($@@))')')
address@hidden
+popdef
address@hidden
+popdef(`a', `a')
address@hidden
address@hidden example
+
 @node Renamesyms
 @section Renaming macros with regular expressions
 
@@ -6401,9 +6454,12 @@ ifdef(`__gnu__', `Extensions are active', `Minimal 
features')
 @end example
 
 Since the version string is unquoted and can potentially contain macro
-names (consider the beta release @samp{1.9b}, or the use of
address@hidden), the @code{__m4_version__} macro should generally
-be used via @code{defn} rather than directly invoked.
+names (for example, a beta release could be numbered @samp{1.9b}), or be
+impacted by the use of @code{changesyntax}), the
address@hidden macro should generally be used via @code{defn}
+rather than directly invoked (@pxref{Defn}).  In general, feature tests
+are more reliable than version number checks, so exercise caution when
+using this macro.
 
 @comment This test is excluded from the testsuite since it depends on a
 @comment texinfo macro; but builtins.at covers the same thing.


hooks/post-receive
--
GNU M4 source repository




reply via email to

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