groff-commit
[Top][All Lists]
Advanced

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

[groff] 22/25: [mm]: Fix Savannah #66327 (ISO date revamp).


From: G. Branden Robinson
Subject: [groff] 22/25: [mm]: Fix Savannah #66327 (ISO date revamp).
Date: Tue, 29 Oct 2024 02:26:07 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 83b3da136da4f4a9affa9ec2b0abe96008bf33aa
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Oct 28 11:33:03 2024 -0500

    [mm]: Fix Savannah #66327 (ISO date revamp).
    
    * contrib/mm/m.tmac ([initialization]): Rename `Iso` register to
      `Isodate` to make its meaning less ambiguous.  Retain `Iso` as an
      undocumented alias.  Call `ND` to initialize date.
    
      (ISODATE): Throw warning if called, but honor the instruction (using
      existing internal macro `cov*set-date`).
    
      (ND): Accept leading space(s) in argument.  If no argument, call
      `cov*set-date`.
    
    * contrib/mm/groff_mm.7.man (Macros) <ISODATE>: Delete.
    
      (Strings) <DT>: Cross reference `Isodate` register, not `ISODATE`
      macro or old `Iso` register.
    
      (Registers) <Iso>: Replace this...
      (Registers) <Isodate>: ...with this.  Recast.
    
    Fixes <https://savannah.gnu.org/bugs/?66327>.
---
 NEWS                      |  7 +++++++
 contrib/mm/ChangeLog      | 18 ++++++++++++++++++
 contrib/mm/groff_mm.7.man | 45 +++++++++++++--------------------------------
 contrib/mm/m.tmac         | 14 ++++++++++----
 4 files changed, 48 insertions(+), 36 deletions(-)

diff --git a/NEWS b/NEWS
index 6df0c771b..59a70a7f7 100644
--- a/NEWS
+++ b/NEWS
@@ -403,6 +403,10 @@ Macro packages
    argument in vees, instead of basic units, for consistency with the
    rest of the package.
 
+*  The m (mm) macro package's `ISODATE` macro (a GNU extension) is
+   deprecated, warns upon usage, and is slated for withdrawal in the
+   next release.  Assign to the new register `Isodate` instead.
+
 *  Similarly, the m (mm) macro package's `PIC` macro (a GNU extension)
    now interprets an argument to its `-I` option in ens instead of ems
    by default.
@@ -481,6 +485,9 @@ Macro packages
    tag/label) in the first, and resets the paragraph counter when the
    first- or second-level section heading number increments.
 
+*  The m (mm) macro package's `Iso` register is now named `Isodate` to
+   make its meaning less ambiguous.  The old name remains as an alias.
+
 *  The m (mm) macro package's `Rpe` register is now named `Rpej` for
    better symmetry with `Ej`.  The old name remains as an alias.
 
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index bf151dc06..722671d95 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,21 @@
+2024-10-28  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * m.tmac ([initialization]): Rename `Iso` register to `Isodate`
+       to make its meaning less ambiguous.  Retain `Iso` as an
+       undocumented alias.  Call `ND` to initialize date.
+       (ISODATE): Throw warning if called, but honor the instruction
+       {using existing internal macro `cov*set-date`}.
+       (ND): Accept leading space(s) in argument.  If no argument, call
+       `cov*set-date`.
+
+       * groff_mm.7.man (Macros) <ISODATE>: Delete.
+       (Strings) <DT>: Cross reference `Isodate` register, not
+       `ISODATE` macro or old `Iso` register.
+       (Registers) <Iso>: Replace this...
+       (Registers) <Isodate>: ...with this.  Recast.
+
+       Fixes <https://savannah.gnu.org/bugs/?66327>.
+
 2024-10-28  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * m.tmac ([initialization], RP): Rename `Rpe` register to
diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index db8c71f36..6548182de 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -2399,26 +2399,6 @@ without space between the arguments.
 .
 .
 .TP
-.BR ISODATE\~ [ 0 ]
-Use ISO\~8601 format for the date string
-.B DT
-used by some cover sheet and memorandum types;
-that is,
-.IR YYYY - MM - DD .
-.
-Must be called before
-.B ND
-to be effective.
-.
-If given an argument
-.RB of\~ 0,
-the traditional date format for the
-.I groff
-locale is used;
-this is also the default.
-.
-.
-.TP
 .BI LB\~ "text-indent mark-indent pad type"\~\c
 .RI [ mark-or-format \~[ pre-item-space \~[ pre-list-space ]]]
 Begin list.
@@ -4265,10 +4245,9 @@ see
 The
 .I groff
 locale determines its format,
-but see
-.B ISODATE
-and register
-.BR Iso .
+but register
+.B Isodate
+may override it.
 .
 .
 .TP
@@ -5116,15 +5095,17 @@ enables automatic hyphenation of words
 .
 .
 .TP
-.B Iso
-configures the use of ISO\~8601 date format
-if specified
-(with any value)
-on the command line;
-see
-.BR ISODATE .
+.B Isodate
+configures the use of ISO\~8601 date format;
+that is,
+.IR YYYY - MM - DD
+instead of the format specified by the localization file.
 .
-The default is determined by localization files.
+Call
+.B ND
+without arguments after updating its value
+(Boolean-valued;
+.BR 0 ).
 .
 .
 .TP
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 55e6c8871..b1c417228 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -330,6 +330,9 @@ http://savannah.gnu.org/bugs/?group=groff.
 .ds H1txt \" empty
 .\" caption for the index
 .ds Index INDEX
+.\" use ISO 8601 date format
+.nr Isodate 0
+.aln Iso Isodate \" for groff <= 1.23 compatibility
 .\" flag for mkindex (XXX: undocumented: do we need this?)
 .if !r Idxf .nr Idxf 0
 .\" captions for displays
@@ -3508,14 +3511,17 @@ argument: '\\$2'
 .el          .ds cov*new-date \\n[year]-\\n[cov*mm]-\\n[cov*dd]
 .\}
 ..
-.ISODATE 0
+.de ISODATE
+.@warning \\$0: macro is deprecated; define register 'Isodate' instead
+.cov*set-date \\$@
+..
 .als DT cov*new-date
 .de ND
 \\*[debug@dump-args]\\
-.ds cov*new-date \\$1
+.ie \\n[.$] .ds cov*new-date "\\$1\"
+.el         .cov*set-date \\n[Isodate]
 ..
-.\" switch to ISO-date if register Iso exist: YYYY-MM-DD
-.if r Iso .ISODATE 1
+.ND
 .\"-------------------
 .\" Save technical memorandum numbers.
 .de TM



reply via email to

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